Sha256: 393672121499a8edc292d00cd21c547ecf49676096946beb7861019b68685b56

Contents?: true

Size: 1.08 KB

Versions: 14

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

module GoTransverseTractApi

  RSpec.describe BillingAccount::Invoice do
    before(:each) { http_auth }

    let(:eid) { '48406' }
    let(:response)  { {a: 'b', c: 'd'} }

    context ".apply_payment" do
      it "applies a payment to the invoice" do
        data = {
          billing_account: {
            eid: '123'
          },
          invoice: {
            eid: '456'
          },
          payment: {
            amount: '27',
            use_recurring_payment: 'false',
            credit_card_payment: {
              card_type: 'VISA',
              card_holder_first_name: 'Mary',
              card_holder_last_name: 'Smith',
              card_identifier_number: '4111111111111111111',
              card_verification_number: '123',
              card_expiration: '12/2016'
            },
            billing_account: {
              eid: '123'
            }
          }
        }

        allow(subject).to receive(:apply_payment).with(eid, data).and_return(response)
        expect(subject.apply_payment(eid, data)).to eq(response)
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
gotransverse-tract-api-0.7.5 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.7.4 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.7.3 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.7.2 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.7.1 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.7.0 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.6.7 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.6.6 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.6.5 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.6.4 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.6.3 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.6.2 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.6.1 spec/gotransverse-tract-api/billing_account/invoice_spec.rb
gotransverse-tract-api-0.6.0 spec/gotransverse-tract-api/billing_account/invoice_spec.rb