Sha256: ed1953436c1ef0d16aa0cf20a95dabc2a7f3a1cd2eafdddb16bca18254555833

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

describe Moip2::PaymentApi do

  let(:payment_api) { described_class.new(sandbox_client)  }

  let(:created_payment) do
    VCR.use_cassette("create_payment_success") do
      payment_api.create("ORD-UEK2XGEXNWL9", {
        installmentCount: 1,
        fundingInstrument: {
          method: "CREDIT_CARD",
          creditCard: {
            expirationMonth: 05,
            expirationYear: 18,
            number: "4012001038443335",
            cvc: "123",
            holder: {
              fullname: "Jose Portador da Silva",
              birthdate: "1988-12-30",
              taxDocument: {
                type: "CPF",
                number: "33333333333"
              },
              phone: {
                countryCode: "55",
                areaCode: "11",
                number: "66778899"
              }
            }
          }
        }
      })
    end
  end

  it "creates a credit card payment on moip" do
    expect(created_payment.id).to eq("PAY-W3MNW718O3AI")
  end

  it "returns a Payment object" do
    expect(created_payment).to be_a(Moip2::Resource::Payment)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
moip2-0.1.0 spec/moip2/payment_api_spec.rb