Sha256: 5df39789b5cb37c1f5abbba64bb163b037b72668152b38ac0ec86076a764584c

Contents?: true

Size: 950 Bytes

Versions: 1

Compression:

Stored size: 950 Bytes

Contents

require "gerencianet"
require_relative "./credentials"

options = {
  client_id: CREDENTIALS::CLIENT_ID,
  client_secret: CREDENTIALS::CLIENT_SECRET,
  sandbox: CREDENTIALS::SANDBOX
}

body = {
  items: [{
    name: "Product 1",
    value: 1000,
    amount: 2
  }],
  shippings: [{
    name: "Default Shipping Cost",
    value: 100
  }],
  payment: {
    credit_card: {
      installments: 1,
      payment_token: "6426f3abd8688639c6772963669bbb8e0eb3c319",
      billing_address: {
        street: "Av. JK",
        number: 909,
        neighborhood: "Bauxita",
        zipcode: "35400000",
        city: "Ouro Preto",
        state: "MG"
      },
      customer: {
        name: "Gorbadoc Oldbuck",
        email: "oldbuck@gerencianet.com.br",
        cpf: "94271564656",
        birth: "1977-01-15",
        phone_number: "5144916523"
      }
    }
  }
}

gerencianet = Gerencianet.new(options)
puts gerencianet.create_charge_onestep(body: body)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gerencianet-1.0.0 examples/default/charge/create_charge_onestep_creditcard.rb