gocardless_pro 2.19.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +25 -43
- data/Gemfile +7 -0
- data/gocardless_pro.gemspec +2 -2
- data/lib/gocardless_pro.rb +3 -0
- data/lib/gocardless_pro/api_service.rb +1 -1
- data/lib/gocardless_pro/client.rb +6 -1
- data/lib/gocardless_pro/resources/payout.rb +2 -0
- data/lib/gocardless_pro/resources/payout_item.rb +2 -0
- data/lib/gocardless_pro/resources/tax_rate.rb +48 -0
- data/lib/gocardless_pro/services/bank_details_lookups_service.rb +0 -10
- data/lib/gocardless_pro/services/base_service.rb +11 -0
- data/lib/gocardless_pro/services/creditor_bank_accounts_service.rb +0 -10
- data/lib/gocardless_pro/services/creditors_service.rb +0 -10
- data/lib/gocardless_pro/services/currency_exchange_rates_service.rb +0 -10
- data/lib/gocardless_pro/services/customer_bank_accounts_service.rb +0 -10
- data/lib/gocardless_pro/services/customer_notifications_service.rb +0 -10
- data/lib/gocardless_pro/services/customers_service.rb +0 -10
- data/lib/gocardless_pro/services/events_service.rb +0 -10
- data/lib/gocardless_pro/services/instalment_schedules_service.rb +21 -10
- data/lib/gocardless_pro/services/mandate_import_entries_service.rb +0 -10
- data/lib/gocardless_pro/services/mandate_imports_service.rb +0 -10
- data/lib/gocardless_pro/services/mandate_pdfs_service.rb +0 -10
- data/lib/gocardless_pro/services/mandates_service.rb +0 -10
- data/lib/gocardless_pro/services/payments_service.rb +0 -10
- data/lib/gocardless_pro/services/payout_items_service.rb +0 -10
- data/lib/gocardless_pro/services/payouts_service.rb +0 -10
- data/lib/gocardless_pro/services/redirect_flows_service.rb +0 -10
- data/lib/gocardless_pro/services/refunds_service.rb +6 -11
- data/lib/gocardless_pro/services/subscriptions_service.rb +0 -10
- data/lib/gocardless_pro/services/tax_rates_service.rb +74 -0
- data/lib/gocardless_pro/version.rb +1 -1
- data/spec/resources/instalment_schedule_spec.rb +35 -0
- data/spec/resources/payout_item_spec.rb +5 -0
- data/spec/resources/payout_spec.rb +8 -0
- data/spec/resources/tax_rate_spec.rb +198 -0
- data/spec/services/creditor_bank_accounts_service_spec.rb +1 -1
- data/spec/services/customer_bank_accounts_service_spec.rb +1 -1
- data/spec/services/customer_notifications_service_spec.rb +1 -1
- data/spec/services/customers_service_spec.rb +1 -1
- data/spec/services/instalment_schedules_service_spec.rb +61 -1
- data/spec/services/mandate_imports_service_spec.rb +2 -2
- data/spec/services/mandates_service_spec.rb +2 -2
- data/spec/services/payments_service_spec.rb +2 -2
- data/spec/services/payout_items_service_spec.rb +9 -0
- data/spec/services/payouts_service_spec.rb +12 -0
- data/spec/services/redirect_flows_service_spec.rb +1 -1
- data/spec/services/subscriptions_service_spec.rb +3 -3
- data/spec/services/tax_rates_service_spec.rb +381 -0
- metadata +17 -11
| @@ -0,0 +1,198 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe GoCardlessPro::Resources::TaxRate do
         | 
| 4 | 
            +
              let(:client) do
         | 
| 5 | 
            +
                GoCardlessPro::Client.new(
         | 
| 6 | 
            +
                  access_token: 'SECRET_TOKEN'
         | 
| 7 | 
            +
                )
         | 
| 8 | 
            +
              end
         | 
| 9 | 
            +
             | 
| 10 | 
            +
              let(:response_headers) { { 'Content-Type' => 'application/json' } }
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              describe '#list' do
         | 
| 13 | 
            +
                describe 'with no filters' do
         | 
| 14 | 
            +
                  subject(:get_list_response) { client.tax_rates.list }
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                  before do
         | 
| 17 | 
            +
                    stub_request(:get, %r{.*api.gocardless.com/tax_rates}).to_return(
         | 
| 18 | 
            +
                      body: {
         | 
| 19 | 
            +
                        'tax_rates' => [{
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                          'end_date' => 'end_date-input',
         | 
| 22 | 
            +
                          'id' => 'id-input',
         | 
| 23 | 
            +
                          'jurisdiction' => 'jurisdiction-input',
         | 
| 24 | 
            +
                          'percentage' => 'percentage-input',
         | 
| 25 | 
            +
                          'start_date' => 'start_date-input',
         | 
| 26 | 
            +
                          'type' => 'type-input',
         | 
| 27 | 
            +
                        }],
         | 
| 28 | 
            +
                        meta: {
         | 
| 29 | 
            +
                          cursors: {
         | 
| 30 | 
            +
                            before: nil,
         | 
| 31 | 
            +
                            after: 'ABC123',
         | 
| 32 | 
            +
                          },
         | 
| 33 | 
            +
                        },
         | 
| 34 | 
            +
                      }.to_json,
         | 
| 35 | 
            +
                      headers: response_headers
         | 
| 36 | 
            +
                    )
         | 
| 37 | 
            +
                  end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                  it 'wraps each item in the resource class' do
         | 
| 40 | 
            +
                    expect(get_list_response.records.map(&:class).uniq.first).to eq(GoCardlessPro::Resources::TaxRate)
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                    expect(get_list_response.records.first.end_date).to eq('end_date-input')
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                    expect(get_list_response.records.first.id).to eq('id-input')
         | 
| 45 | 
            +
             | 
| 46 | 
            +
                    expect(get_list_response.records.first.jurisdiction).to eq('jurisdiction-input')
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                    expect(get_list_response.records.first.percentage).to eq('percentage-input')
         | 
| 49 | 
            +
             | 
| 50 | 
            +
                    expect(get_list_response.records.first.start_date).to eq('start_date-input')
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                    expect(get_list_response.records.first.type).to eq('type-input')
         | 
| 53 | 
            +
                  end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                  it 'exposes the cursors for before and after' do
         | 
| 56 | 
            +
                    expect(get_list_response.before).to eq(nil)
         | 
| 57 | 
            +
                    expect(get_list_response.after).to eq('ABC123')
         | 
| 58 | 
            +
                  end
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                  specify { expect(get_list_response.api_response.headers).to eql('content-type' => 'application/json') }
         | 
| 61 | 
            +
                end
         | 
| 62 | 
            +
              end
         | 
| 63 | 
            +
             | 
| 64 | 
            +
              describe '#all' do
         | 
| 65 | 
            +
                let!(:first_response_stub) do
         | 
| 66 | 
            +
                  stub_request(:get, %r{.*api.gocardless.com/tax_rates$}).to_return(
         | 
| 67 | 
            +
                    body: {
         | 
| 68 | 
            +
                      'tax_rates' => [{
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                        'end_date' => 'end_date-input',
         | 
| 71 | 
            +
                        'id' => 'id-input',
         | 
| 72 | 
            +
                        'jurisdiction' => 'jurisdiction-input',
         | 
| 73 | 
            +
                        'percentage' => 'percentage-input',
         | 
| 74 | 
            +
                        'start_date' => 'start_date-input',
         | 
| 75 | 
            +
                        'type' => 'type-input',
         | 
| 76 | 
            +
                      }],
         | 
| 77 | 
            +
                      meta: {
         | 
| 78 | 
            +
                        cursors: { after: 'AB345' },
         | 
| 79 | 
            +
                        limit: 1,
         | 
| 80 | 
            +
                      },
         | 
| 81 | 
            +
                    }.to_json,
         | 
| 82 | 
            +
                    headers: response_headers
         | 
| 83 | 
            +
                  )
         | 
| 84 | 
            +
                end
         | 
| 85 | 
            +
             | 
| 86 | 
            +
                let!(:second_response_stub) do
         | 
| 87 | 
            +
                  stub_request(:get, %r{.*api.gocardless.com/tax_rates\?after=AB345}).to_return(
         | 
| 88 | 
            +
                    body: {
         | 
| 89 | 
            +
                      'tax_rates' => [{
         | 
| 90 | 
            +
             | 
| 91 | 
            +
                        'end_date' => 'end_date-input',
         | 
| 92 | 
            +
                        'id' => 'id-input',
         | 
| 93 | 
            +
                        'jurisdiction' => 'jurisdiction-input',
         | 
| 94 | 
            +
                        'percentage' => 'percentage-input',
         | 
| 95 | 
            +
                        'start_date' => 'start_date-input',
         | 
| 96 | 
            +
                        'type' => 'type-input',
         | 
| 97 | 
            +
                      }],
         | 
| 98 | 
            +
                      meta: {
         | 
| 99 | 
            +
                        limit: 2,
         | 
| 100 | 
            +
                        cursors: {},
         | 
| 101 | 
            +
                      },
         | 
| 102 | 
            +
                    }.to_json,
         | 
| 103 | 
            +
                    headers: response_headers
         | 
| 104 | 
            +
                  )
         | 
| 105 | 
            +
                end
         | 
| 106 | 
            +
             | 
| 107 | 
            +
                it 'automatically makes the extra requests' do
         | 
| 108 | 
            +
                  expect(client.tax_rates.all.to_a.length).to eq(2)
         | 
| 109 | 
            +
                  expect(first_response_stub).to have_been_requested
         | 
| 110 | 
            +
                  expect(second_response_stub).to have_been_requested
         | 
| 111 | 
            +
                end
         | 
| 112 | 
            +
              end
         | 
| 113 | 
            +
             | 
| 114 | 
            +
              describe '#get' do
         | 
| 115 | 
            +
                let(:id) { 'ID123' }
         | 
| 116 | 
            +
             | 
| 117 | 
            +
                subject(:get_response) { client.tax_rates.get(id) }
         | 
| 118 | 
            +
             | 
| 119 | 
            +
                context 'passing in a custom header' do
         | 
| 120 | 
            +
                  let!(:stub) do
         | 
| 121 | 
            +
                    stub_url = '/tax_rates/:identity'.gsub(':identity', id)
         | 
| 122 | 
            +
                    stub_request(:get, /.*api.gocardless.com#{stub_url}/).
         | 
| 123 | 
            +
                      with(headers: { 'Foo' => 'Bar' }).
         | 
| 124 | 
            +
                      to_return(
         | 
| 125 | 
            +
                        body: {
         | 
| 126 | 
            +
                          'tax_rates' => {
         | 
| 127 | 
            +
             | 
| 128 | 
            +
                            'end_date' => 'end_date-input',
         | 
| 129 | 
            +
                            'id' => 'id-input',
         | 
| 130 | 
            +
                            'jurisdiction' => 'jurisdiction-input',
         | 
| 131 | 
            +
                            'percentage' => 'percentage-input',
         | 
| 132 | 
            +
                            'start_date' => 'start_date-input',
         | 
| 133 | 
            +
                            'type' => 'type-input',
         | 
| 134 | 
            +
                          },
         | 
| 135 | 
            +
                        }.to_json,
         | 
| 136 | 
            +
                        headers: response_headers
         | 
| 137 | 
            +
                      )
         | 
| 138 | 
            +
                  end
         | 
| 139 | 
            +
             | 
| 140 | 
            +
                  subject(:get_response) do
         | 
| 141 | 
            +
                    client.tax_rates.get(id, headers: {
         | 
| 142 | 
            +
                                           'Foo' => 'Bar',
         | 
| 143 | 
            +
                                         })
         | 
| 144 | 
            +
                  end
         | 
| 145 | 
            +
             | 
| 146 | 
            +
                  it 'includes the header' do
         | 
| 147 | 
            +
                    get_response
         | 
| 148 | 
            +
                    expect(stub).to have_been_requested
         | 
| 149 | 
            +
                  end
         | 
| 150 | 
            +
                end
         | 
| 151 | 
            +
             | 
| 152 | 
            +
                context 'when there is a tax_rate to return' do
         | 
| 153 | 
            +
                  before do
         | 
| 154 | 
            +
                    stub_url = '/tax_rates/:identity'.gsub(':identity', id)
         | 
| 155 | 
            +
                    stub_request(:get, /.*api.gocardless.com#{stub_url}/).to_return(
         | 
| 156 | 
            +
                      body: {
         | 
| 157 | 
            +
                        'tax_rates' => {
         | 
| 158 | 
            +
             | 
| 159 | 
            +
                          'end_date' => 'end_date-input',
         | 
| 160 | 
            +
                          'id' => 'id-input',
         | 
| 161 | 
            +
                          'jurisdiction' => 'jurisdiction-input',
         | 
| 162 | 
            +
                          'percentage' => 'percentage-input',
         | 
| 163 | 
            +
                          'start_date' => 'start_date-input',
         | 
| 164 | 
            +
                          'type' => 'type-input',
         | 
| 165 | 
            +
                        },
         | 
| 166 | 
            +
                      }.to_json,
         | 
| 167 | 
            +
                      headers: response_headers
         | 
| 168 | 
            +
                    )
         | 
| 169 | 
            +
                  end
         | 
| 170 | 
            +
             | 
| 171 | 
            +
                  it 'wraps the response in a resource' do
         | 
| 172 | 
            +
                    expect(get_response).to be_a(GoCardlessPro::Resources::TaxRate)
         | 
| 173 | 
            +
                  end
         | 
| 174 | 
            +
                end
         | 
| 175 | 
            +
             | 
| 176 | 
            +
                context 'when nothing is returned' do
         | 
| 177 | 
            +
                  before do
         | 
| 178 | 
            +
                    stub_url = '/tax_rates/:identity'.gsub(':identity', id)
         | 
| 179 | 
            +
                    stub_request(:get, /.*api.gocardless.com#{stub_url}/).to_return(
         | 
| 180 | 
            +
                      body: '',
         | 
| 181 | 
            +
                      headers: response_headers
         | 
| 182 | 
            +
                    )
         | 
| 183 | 
            +
                  end
         | 
| 184 | 
            +
             | 
| 185 | 
            +
                  it 'returns nil' do
         | 
| 186 | 
            +
                    expect(get_response).to be_nil
         | 
| 187 | 
            +
                  end
         | 
| 188 | 
            +
                end
         | 
| 189 | 
            +
             | 
| 190 | 
            +
                context "when an ID is specified which can't be included in a valid URI" do
         | 
| 191 | 
            +
                  let(:id) { '`' }
         | 
| 192 | 
            +
             | 
| 193 | 
            +
                  it "doesn't raise an error" do
         | 
| 194 | 
            +
                    expect { get_response }.to_not raise_error(/bad URI/)
         | 
| 195 | 
            +
                  end
         | 
| 196 | 
            +
                end
         | 
| 197 | 
            +
              end
         | 
| 198 | 
            +
            end
         | 
| @@ -692,7 +692,7 @@ describe GoCardlessPro::Services::CreditorBankAccountsService do | |
| 692 692 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 693 693 | 
             
                           to_timeout
         | 
| 694 694 |  | 
| 695 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 695 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 696 696 | 
             
                    expect(stub).to have_been_requested
         | 
| 697 697 | 
             
                  end
         | 
| 698 698 | 
             
                end
         | 
| @@ -754,7 +754,7 @@ describe GoCardlessPro::Services::CustomerBankAccountsService do | |
| 754 754 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 755 755 | 
             
                           to_timeout
         | 
| 756 756 |  | 
| 757 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 757 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 758 758 | 
             
                    expect(stub).to have_been_requested
         | 
| 759 759 | 
             
                  end
         | 
| 760 760 | 
             
                end
         | 
| @@ -45,7 +45,7 @@ describe GoCardlessPro::Services::CustomerNotificationsService do | |
| 45 45 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 46 46 | 
             
                           to_timeout
         | 
| 47 47 |  | 
| 48 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 48 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 49 49 | 
             
                    expect(stub).to have_been_requested
         | 
| 50 50 | 
             
                  end
         | 
| 51 51 | 
             
                end
         | 
| @@ -882,7 +882,7 @@ describe GoCardlessPro::Services::CustomersService do | |
| 882 882 | 
             
                    stub = stub_request(:delete, /.*api.gocardless.com#{stub_url}/).
         | 
| 883 883 | 
             
                           to_timeout
         | 
| 884 884 |  | 
| 885 | 
            -
                    expect { delete_response }.to raise_error(Faraday:: | 
| 885 | 
            +
                    expect { delete_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 886 886 | 
             
                    expect(stub).to have_been_requested
         | 
| 887 887 | 
             
                  end
         | 
| 888 888 | 
             
                end
         | 
| @@ -828,6 +828,66 @@ describe GoCardlessPro::Services::InstalmentSchedulesService do | |
| 828 828 | 
             
                end
         | 
| 829 829 | 
             
              end
         | 
| 830 830 |  | 
| 831 | 
            +
              describe '#update' do
         | 
| 832 | 
            +
                subject(:put_update_response) { client.instalment_schedules.update(id, params: update_params) }
         | 
| 833 | 
            +
                let(:id) { 'ABC123' }
         | 
| 834 | 
            +
             | 
| 835 | 
            +
                context 'with a valid request' do
         | 
| 836 | 
            +
                  let(:update_params) { { 'hello' => 'world' } }
         | 
| 837 | 
            +
             | 
| 838 | 
            +
                  let!(:stub) do
         | 
| 839 | 
            +
                    stub_url = '/instalment_schedules/:identity'.gsub(':identity', id)
         | 
| 840 | 
            +
                    stub_request(:put, /.*api.gocardless.com#{stub_url}/).to_return(
         | 
| 841 | 
            +
                      body: {
         | 
| 842 | 
            +
                        'instalment_schedules' => {
         | 
| 843 | 
            +
             | 
| 844 | 
            +
                          'created_at' => 'created_at-input',
         | 
| 845 | 
            +
                          'currency' => 'currency-input',
         | 
| 846 | 
            +
                          'id' => 'id-input',
         | 
| 847 | 
            +
                          'links' => 'links-input',
         | 
| 848 | 
            +
                          'metadata' => 'metadata-input',
         | 
| 849 | 
            +
                          'name' => 'name-input',
         | 
| 850 | 
            +
                          'payment_errors' => 'payment_errors-input',
         | 
| 851 | 
            +
                          'status' => 'status-input',
         | 
| 852 | 
            +
                          'total_amount' => 'total_amount-input',
         | 
| 853 | 
            +
                        },
         | 
| 854 | 
            +
                      }.to_json,
         | 
| 855 | 
            +
                      headers: response_headers
         | 
| 856 | 
            +
                    )
         | 
| 857 | 
            +
                  end
         | 
| 858 | 
            +
             | 
| 859 | 
            +
                  it 'updates and returns the resource' do
         | 
| 860 | 
            +
                    expect(put_update_response).to be_a(GoCardlessPro::Resources::InstalmentSchedule)
         | 
| 861 | 
            +
                    expect(stub).to have_been_requested
         | 
| 862 | 
            +
                  end
         | 
| 863 | 
            +
             | 
| 864 | 
            +
                  describe 'retry behaviour' do
         | 
| 865 | 
            +
                    before { allow_any_instance_of(GoCardlessPro::Request).to receive(:sleep) }
         | 
| 866 | 
            +
             | 
| 867 | 
            +
                    it 'retries timeouts' do
         | 
| 868 | 
            +
                      stub_url = '/instalment_schedules/:identity'.gsub(':identity', id)
         | 
| 869 | 
            +
                      stub = stub_request(:put, /.*api.gocardless.com#{stub_url}/).
         | 
| 870 | 
            +
                             to_timeout.then.to_return(status: 200, headers: response_headers)
         | 
| 871 | 
            +
             | 
| 872 | 
            +
                      put_update_response
         | 
| 873 | 
            +
                      expect(stub).to have_been_requested.twice
         | 
| 874 | 
            +
                    end
         | 
| 875 | 
            +
             | 
| 876 | 
            +
                    it 'retries 5XX errors' do
         | 
| 877 | 
            +
                      stub_url = '/instalment_schedules/:identity'.gsub(':identity', id)
         | 
| 878 | 
            +
                      stub = stub_request(:put, /.*api.gocardless.com#{stub_url}/).
         | 
| 879 | 
            +
                             to_return(status: 502,
         | 
| 880 | 
            +
                                       headers: { 'Content-Type' => 'text/html' },
         | 
| 881 | 
            +
                                       body: '<html><body>Response from Cloudflare</body></html>').
         | 
| 882 | 
            +
                             then.to_return(status: 200, headers: response_headers)
         | 
| 883 | 
            +
             | 
| 884 | 
            +
                      put_update_response
         | 
| 885 | 
            +
                      expect(stub).to have_been_requested.twice
         | 
| 886 | 
            +
                    end
         | 
| 887 | 
            +
                  end
         | 
| 888 | 
            +
                end
         | 
| 889 | 
            +
              end
         | 
| 890 | 
            +
             | 
| 831 891 | 
             
              describe '#cancel' do
         | 
| 832 892 | 
             
                subject(:post_response) { client.instalment_schedules.cancel(resource_id) }
         | 
| 833 893 |  | 
| @@ -867,7 +927,7 @@ describe GoCardlessPro::Services::InstalmentSchedulesService do | |
| 867 927 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 868 928 | 
             
                           to_timeout
         | 
| 869 929 |  | 
| 870 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 930 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 871 931 | 
             
                    expect(stub).to have_been_requested
         | 
| 872 932 | 
             
                  end
         | 
| 873 933 | 
             
                end
         | 
| @@ -363,7 +363,7 @@ describe GoCardlessPro::Services::MandateImportsService do | |
| 363 363 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 364 364 | 
             
                           to_timeout
         | 
| 365 365 |  | 
| 366 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 366 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 367 367 | 
             
                    expect(stub).to have_been_requested
         | 
| 368 368 | 
             
                  end
         | 
| 369 369 | 
             
                end
         | 
| @@ -432,7 +432,7 @@ describe GoCardlessPro::Services::MandateImportsService do | |
| 432 432 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 433 433 | 
             
                           to_timeout
         | 
| 434 434 |  | 
| 435 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 435 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 436 436 | 
             
                    expect(stub).to have_been_requested
         | 
| 437 437 | 
             
                  end
         | 
| 438 438 | 
             
                end
         | 
| @@ -718,7 +718,7 @@ describe GoCardlessPro::Services::MandatesService do | |
| 718 718 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 719 719 | 
             
                           to_timeout
         | 
| 720 720 |  | 
| 721 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 721 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 722 722 | 
             
                    expect(stub).to have_been_requested
         | 
| 723 723 | 
             
                  end
         | 
| 724 724 | 
             
                end
         | 
| @@ -797,7 +797,7 @@ describe GoCardlessPro::Services::MandatesService do | |
| 797 797 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 798 798 | 
             
                           to_timeout
         | 
| 799 799 |  | 
| 800 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 800 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 801 801 | 
             
                    expect(stub).to have_been_requested
         | 
| 802 802 | 
             
                  end
         | 
| 803 803 | 
             
                end
         | 
| @@ -790,7 +790,7 @@ describe GoCardlessPro::Services::PaymentsService do | |
| 790 790 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 791 791 | 
             
                           to_timeout
         | 
| 792 792 |  | 
| 793 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 793 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 794 794 | 
             
                    expect(stub).to have_been_requested
         | 
| 795 795 | 
             
                  end
         | 
| 796 796 | 
             
                end
         | 
| @@ -877,7 +877,7 @@ describe GoCardlessPro::Services::PaymentsService do | |
| 877 877 | 
             
                    stub = stub_request(:post, /.*api.gocardless.com#{stub_url}/).
         | 
| 878 878 | 
             
                           to_timeout
         | 
| 879 879 |  | 
| 880 | 
            -
                    expect { post_response }.to raise_error(Faraday:: | 
| 880 | 
            +
                    expect { post_response }.to raise_error(Faraday::ConnectionFailed)
         | 
| 881 881 | 
             
                    expect(stub).to have_been_requested
         | 
| 882 882 | 
             
                  end
         | 
| 883 883 | 
             
                end
         | 
| @@ -19,6 +19,7 @@ describe GoCardlessPro::Services::PayoutItemsService do | |
| 19 19 |  | 
| 20 20 | 
             
                        'amount' => 'amount-input',
         | 
| 21 21 | 
             
                        'links' => 'links-input',
         | 
| 22 | 
            +
                        'taxes' => 'taxes-input',
         | 
| 22 23 | 
             
                        'type' => 'type-input',
         | 
| 23 24 | 
             
                      }],
         | 
| 24 25 | 
             
                      meta: {
         | 
| @@ -42,6 +43,8 @@ describe GoCardlessPro::Services::PayoutItemsService do | |
| 42 43 |  | 
| 43 44 | 
             
                    expect(get_list_response.records.first.amount).to eq('amount-input')
         | 
| 44 45 |  | 
| 46 | 
            +
                    expect(get_list_response.records.first.taxes).to eq('taxes-input')
         | 
| 47 | 
            +
             | 
| 45 48 | 
             
                    expect(get_list_response.records.first.type).to eq('type-input')
         | 
| 46 49 | 
             
                  end
         | 
| 47 50 |  | 
| @@ -85,6 +88,7 @@ describe GoCardlessPro::Services::PayoutItemsService do | |
| 85 88 |  | 
| 86 89 | 
             
                        'amount' => 'amount-input',
         | 
| 87 90 | 
             
                        'links' => 'links-input',
         | 
| 91 | 
            +
                        'taxes' => 'taxes-input',
         | 
| 88 92 | 
             
                        'type' => 'type-input',
         | 
| 89 93 | 
             
                      }],
         | 
| 90 94 | 
             
                      meta: {
         | 
| @@ -103,6 +107,7 @@ describe GoCardlessPro::Services::PayoutItemsService do | |
| 103 107 |  | 
| 104 108 | 
             
                        'amount' => 'amount-input',
         | 
| 105 109 | 
             
                        'links' => 'links-input',
         | 
| 110 | 
            +
                        'taxes' => 'taxes-input',
         | 
| 106 111 | 
             
                        'type' => 'type-input',
         | 
| 107 112 | 
             
                      }],
         | 
| 108 113 | 
             
                      meta: {
         | 
| @@ -130,6 +135,7 @@ describe GoCardlessPro::Services::PayoutItemsService do | |
| 130 135 |  | 
| 131 136 | 
             
                          'amount' => 'amount-input',
         | 
| 132 137 | 
             
                          'links' => 'links-input',
         | 
| 138 | 
            +
                          'taxes' => 'taxes-input',
         | 
| 133 139 | 
             
                          'type' => 'type-input',
         | 
| 134 140 | 
             
                        }],
         | 
| 135 141 | 
             
                        meta: {
         | 
| @@ -148,6 +154,7 @@ describe GoCardlessPro::Services::PayoutItemsService do | |
| 148 154 |  | 
| 149 155 | 
             
                                                 'amount' => 'amount-input',
         | 
| 150 156 | 
             
                                                 'links' => 'links-input',
         | 
| 157 | 
            +
                                                 'taxes' => 'taxes-input',
         | 
| 151 158 | 
             
                                                 'type' => 'type-input',
         | 
| 152 159 | 
             
                                               }],
         | 
| 153 160 | 
             
                                               meta: {
         | 
| @@ -171,6 +178,7 @@ describe GoCardlessPro::Services::PayoutItemsService do | |
| 171 178 |  | 
| 172 179 | 
             
                          'amount' => 'amount-input',
         | 
| 173 180 | 
             
                          'links' => 'links-input',
         | 
| 181 | 
            +
                          'taxes' => 'taxes-input',
         | 
| 174 182 | 
             
                          'type' => 'type-input',
         | 
| 175 183 | 
             
                        }],
         | 
| 176 184 | 
             
                        meta: {
         | 
| @@ -192,6 +200,7 @@ describe GoCardlessPro::Services::PayoutItemsService do | |
| 192 200 |  | 
| 193 201 | 
             
                                                 'amount' => 'amount-input',
         | 
| 194 202 | 
             
                                                 'links' => 'links-input',
         | 
| 203 | 
            +
                                                 'taxes' => 'taxes-input',
         | 
| 195 204 | 
             
                                                 'type' => 'type-input',
         | 
| 196 205 | 
             
                                               }],
         | 
| 197 206 | 
             
                                               meta: {
         | 
| @@ -29,6 +29,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 29 29 | 
             
                        'payout_type' => 'payout_type-input',
         | 
| 30 30 | 
             
                        'reference' => 'reference-input',
         | 
| 31 31 | 
             
                        'status' => 'status-input',
         | 
| 32 | 
            +
                        'tax_currency' => 'tax_currency-input',
         | 
| 32 33 | 
             
                      }],
         | 
| 33 34 | 
             
                      meta: {
         | 
| 34 35 | 
             
                        cursors: {
         | 
| @@ -70,6 +71,8 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 70 71 | 
             
                    expect(get_list_response.records.first.reference).to eq('reference-input')
         | 
| 71 72 |  | 
| 72 73 | 
             
                    expect(get_list_response.records.first.status).to eq('status-input')
         | 
| 74 | 
            +
             | 
| 75 | 
            +
                    expect(get_list_response.records.first.tax_currency).to eq('tax_currency-input')
         | 
| 73 76 | 
             
                  end
         | 
| 74 77 |  | 
| 75 78 | 
             
                  it 'exposes the cursors for before and after' do
         | 
| @@ -122,6 +125,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 122 125 | 
             
                        'payout_type' => 'payout_type-input',
         | 
| 123 126 | 
             
                        'reference' => 'reference-input',
         | 
| 124 127 | 
             
                        'status' => 'status-input',
         | 
| 128 | 
            +
                        'tax_currency' => 'tax_currency-input',
         | 
| 125 129 | 
             
                      }],
         | 
| 126 130 | 
             
                      meta: {
         | 
| 127 131 | 
             
                        cursors: { after: 'AB345' },
         | 
| @@ -149,6 +153,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 149 153 | 
             
                        'payout_type' => 'payout_type-input',
         | 
| 150 154 | 
             
                        'reference' => 'reference-input',
         | 
| 151 155 | 
             
                        'status' => 'status-input',
         | 
| 156 | 
            +
                        'tax_currency' => 'tax_currency-input',
         | 
| 152 157 | 
             
                      }],
         | 
| 153 158 | 
             
                      meta: {
         | 
| 154 159 | 
             
                        limit: 2,
         | 
| @@ -185,6 +190,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 185 190 | 
             
                          'payout_type' => 'payout_type-input',
         | 
| 186 191 | 
             
                          'reference' => 'reference-input',
         | 
| 187 192 | 
             
                          'status' => 'status-input',
         | 
| 193 | 
            +
                          'tax_currency' => 'tax_currency-input',
         | 
| 188 194 | 
             
                        }],
         | 
| 189 195 | 
             
                        meta: {
         | 
| 190 196 | 
             
                          cursors: { after: 'AB345' },
         | 
| @@ -212,6 +218,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 212 218 | 
             
                                                 'payout_type' => 'payout_type-input',
         | 
| 213 219 | 
             
                                                 'reference' => 'reference-input',
         | 
| 214 220 | 
             
                                                 'status' => 'status-input',
         | 
| 221 | 
            +
                                                 'tax_currency' => 'tax_currency-input',
         | 
| 215 222 | 
             
                                               }],
         | 
| 216 223 | 
             
                                               meta: {
         | 
| 217 224 | 
             
                                                 limit: 2,
         | 
| @@ -244,6 +251,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 244 251 | 
             
                          'payout_type' => 'payout_type-input',
         | 
| 245 252 | 
             
                          'reference' => 'reference-input',
         | 
| 246 253 | 
             
                          'status' => 'status-input',
         | 
| 254 | 
            +
                          'tax_currency' => 'tax_currency-input',
         | 
| 247 255 | 
             
                        }],
         | 
| 248 256 | 
             
                        meta: {
         | 
| 249 257 | 
             
                          cursors: { after: 'AB345' },
         | 
| @@ -274,6 +282,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 274 282 | 
             
                                                 'payout_type' => 'payout_type-input',
         | 
| 275 283 | 
             
                                                 'reference' => 'reference-input',
         | 
| 276 284 | 
             
                                                 'status' => 'status-input',
         | 
| 285 | 
            +
                                                 'tax_currency' => 'tax_currency-input',
         | 
| 277 286 | 
             
                                               }],
         | 
| 278 287 | 
             
                                               meta: {
         | 
| 279 288 | 
             
                                                 limit: 2,
         | 
| @@ -317,6 +326,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 317 326 | 
             
                            'payout_type' => 'payout_type-input',
         | 
| 318 327 | 
             
                            'reference' => 'reference-input',
         | 
| 319 328 | 
             
                            'status' => 'status-input',
         | 
| 329 | 
            +
                            'tax_currency' => 'tax_currency-input',
         | 
| 320 330 | 
             
                          },
         | 
| 321 331 | 
             
                        }.to_json,
         | 
| 322 332 | 
             
                        headers: response_headers
         | 
| @@ -354,6 +364,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 354 364 | 
             
                          'payout_type' => 'payout_type-input',
         | 
| 355 365 | 
             
                          'reference' => 'reference-input',
         | 
| 356 366 | 
             
                          'status' => 'status-input',
         | 
| 367 | 
            +
                          'tax_currency' => 'tax_currency-input',
         | 
| 357 368 | 
             
                        },
         | 
| 358 369 | 
             
                      }.to_json,
         | 
| 359 370 | 
             
                      headers: response_headers
         | 
| @@ -468,6 +479,7 @@ describe GoCardlessPro::Services::PayoutsService do | |
| 468 479 | 
             
                          'payout_type' => 'payout_type-input',
         | 
| 469 480 | 
             
                          'reference' => 'reference-input',
         | 
| 470 481 | 
             
                          'status' => 'status-input',
         | 
| 482 | 
            +
                          'tax_currency' => 'tax_currency-input',
         | 
| 471 483 | 
             
                        },
         | 
| 472 484 | 
             
                      }.to_json,
         | 
| 473 485 | 
             
                      headers: response_headers
         |