From 5e1f5bf59000c1a6b9d81dbe416fd953de716456 Mon Sep 17 00:00:00 2001 From: Robot Date: Wed, 25 Sep 2024 18:00:31 +0000 Subject: [PATCH 1/5] Changes from gocardless/gocardless-pro-ruby-template@a71a69ce9c544c1bae0fcce0df342e3d057d0f5f --- .../resources/billing_request.rb | 7 +- spec/resources/billing_request_spec.rb | 86 ++++++---------- .../services/billing_requests_service_spec.rb | 98 ++++++------------- 3 files changed, 61 insertions(+), 130 deletions(-) diff --git a/lib/gocardless_pro/resources/billing_request.rb b/lib/gocardless_pro/resources/billing_request.rb index 77ba2b8..bc09b0a 100644 --- a/lib/gocardless_pro/resources/billing_request.rb +++ b/lib/gocardless_pro/resources/billing_request.rb @@ -21,7 +21,7 @@ module Resources # for how-to's, explanations and tutorials. class BillingRequest attr_reader :actions, :created_at, :fallback_enabled, :id, :mandate_request, :metadata, :payment_request, - :purpose_code, :resources, :status, :subscription_request + :purpose_code, :resources, :status # Initialize a billing_request resource instance # @param object [Hash] an object returned from the API @@ -39,7 +39,6 @@ def initialize(object, response = nil) @purpose_code = object['purpose_code'] @resources = object['resources'] @status = object['status'] - @subscription_request = object['subscription_request'] @response = response end @@ -105,10 +104,6 @@ def payment_request def payment_request_payment @links['payment_request_payment'] end - - def subscription_request - @links['subscription_request'] - end end end end diff --git a/spec/resources/billing_request_spec.rb b/spec/resources/billing_request_spec.rb index bbb46b1..054c2ac 100644 --- a/spec/resources/billing_request_spec.rb +++ b/spec/resources/billing_request_spec.rb @@ -25,8 +25,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } end @@ -46,8 +45,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } } ) @@ -67,8 +65,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -121,8 +118,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } end @@ -165,8 +161,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -203,8 +198,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -246,8 +240,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -278,8 +271,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -321,8 +313,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -353,8 +344,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -396,8 +386,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -428,8 +417,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -471,8 +459,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -503,8 +490,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -546,8 +532,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -575,8 +560,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { cursors: { @@ -613,8 +597,6 @@ expect(get_list_response.records.first.resources).to eq('resources-input') expect(get_list_response.records.first.status).to eq('status-input') - - expect(get_list_response.records.first.subscription_request).to eq('subscription_request-input') end it 'exposes the cursors for before and after' do @@ -642,8 +624,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { cursors: { after: 'AB345' }, @@ -669,8 +650,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { limit: 2, @@ -712,8 +692,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -749,8 +728,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -807,8 +785,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -850,8 +827,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -882,8 +858,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -925,8 +900,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -957,8 +931,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -1000,8 +973,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -1032,8 +1004,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -1075,8 +1046,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers diff --git a/spec/services/billing_requests_service_spec.rb b/spec/services/billing_requests_service_spec.rb index 45e64b8..e04b5a9 100644 --- a/spec/services/billing_requests_service_spec.rb +++ b/spec/services/billing_requests_service_spec.rb @@ -25,8 +25,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } end @@ -46,8 +45,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } } ) @@ -67,8 +65,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -144,8 +141,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } end @@ -188,8 +184,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -242,8 +237,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -296,8 +290,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -328,8 +321,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -382,8 +374,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -414,8 +405,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -468,8 +458,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -500,8 +489,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -554,8 +542,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -586,8 +573,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -640,8 +626,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -668,8 +653,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { cursors: { @@ -711,8 +695,6 @@ expect(get_list_response.records.first.resources).to eq('resources-input') expect(get_list_response.records.first.status).to eq('status-input') - - expect(get_list_response.records.first.subscription_request).to eq('subscription_request-input') end it 'exposes the cursors for before and after' do @@ -763,8 +745,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { cursors: { after: 'AB345' }, @@ -790,8 +771,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { limit: 2, @@ -826,8 +806,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { cursors: { after: 'AB345' }, @@ -853,8 +832,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { limit: 2, @@ -885,8 +863,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { cursors: { after: 'AB345' }, @@ -915,8 +892,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' }], meta: { limit: 2, @@ -958,8 +934,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -995,8 +970,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -1108,8 +1082,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -1162,8 +1135,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -1194,8 +1166,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -1248,8 +1219,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -1280,8 +1250,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -1334,8 +1303,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers @@ -1366,8 +1334,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, @@ -1420,8 +1387,7 @@ 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input', - 'subscription_request' => 'subscription_request-input' + 'status' => 'status-input' } }.to_json, headers: response_headers From 9a46f874501154f295575862268c1c7f4d672c0c Mon Sep 17 00:00:00 2001 From: Robot Date: Tue, 15 Oct 2024 14:19:32 +0000 Subject: [PATCH 2/5] Changes from gocardless/gocardless-pro-ruby-template@9b29ce56884ab93963bfb1249a07e8c8ec656054 --- .../resources/billing_request_flow.rb | 3 ++- spec/resources/billing_request_flow_spec.rb | 18 ++++++++++++------ .../billing_request_flows_service_spec.rb | 18 ++++++++++++------ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/lib/gocardless_pro/resources/billing_request_flow.rb b/lib/gocardless_pro/resources/billing_request_flow.rb index fb42143..62a3546 100644 --- a/lib/gocardless_pro/resources/billing_request_flow.rb +++ b/lib/gocardless_pro/resources/billing_request_flow.rb @@ -15,7 +15,7 @@ module Resources # authorisation (such as open banking single payments). class BillingRequestFlow attr_reader :authorisation_url, :auto_fulfil, :created_at, :customer_details_captured, :exit_uri, :expires_at, - :id, :language, :lock_bank_account, :lock_currency, :lock_customer_details, :prefilled_bank_account, :prefilled_customer, :redirect_uri, :session_token, :show_redirect_buttons, :show_success_redirect_button + :id, :language, :lock_bank_account, :lock_currency, :lock_customer_details, :prefilled_bank_account, :prefilled_customer, :redirect_uri, :session_token, :show_redirect_buttons, :show_success_redirect_button, :skip_success_screen # Initialize a billing_request_flow resource instance # @param object [Hash] an object returned from the API @@ -40,6 +40,7 @@ def initialize(object, response = nil) @session_token = object['session_token'] @show_redirect_buttons = object['show_redirect_buttons'] @show_success_redirect_button = object['show_success_redirect_button'] + @skip_success_screen = object['skip_success_screen'] @response = response end diff --git a/spec/resources/billing_request_flow_spec.rb b/spec/resources/billing_request_flow_spec.rb index 106b901..5bf28cd 100644 --- a/spec/resources/billing_request_flow_spec.rb +++ b/spec/resources/billing_request_flow_spec.rb @@ -32,7 +32,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } end @@ -59,7 +60,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } } ) @@ -86,7 +88,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } }.to_json, @@ -146,7 +149,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } end @@ -208,7 +212,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } }.to_json, @@ -257,7 +262,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } }.to_json, headers: response_headers diff --git a/spec/services/billing_request_flows_service_spec.rb b/spec/services/billing_request_flows_service_spec.rb index 4d0d852..bec481e 100644 --- a/spec/services/billing_request_flows_service_spec.rb +++ b/spec/services/billing_request_flows_service_spec.rb @@ -32,7 +32,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } end @@ -59,7 +60,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } } ) @@ -86,7 +88,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } }.to_json, @@ -169,7 +172,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } end @@ -231,7 +235,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } }.to_json, @@ -291,7 +296,8 @@ 'redirect_uri' => 'redirect_uri-input', 'session_token' => 'session_token-input', 'show_redirect_buttons' => 'show_redirect_buttons-input', - 'show_success_redirect_button' => 'show_success_redirect_button-input' + 'show_success_redirect_button' => 'show_success_redirect_button-input', + 'skip_success_screen' => 'skip_success_screen-input' } }.to_json, headers: response_headers From da83a84e5b0b924b9045c4bee8d468bc99591185 Mon Sep 17 00:00:00 2001 From: Robot Date: Tue, 5 Nov 2024 10:07:40 +0000 Subject: [PATCH 3/5] Changes from gocardless/gocardless-pro-ruby-template@28d566ca784f146213a3e6e5682c76c1596ed7bb --- .../resources/billing_request.rb | 5 +-- spec/resources/billing_request_spec.rb | 30 ++++++++++++++++ .../services/billing_requests_service_spec.rb | 34 +++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/lib/gocardless_pro/resources/billing_request.rb b/lib/gocardless_pro/resources/billing_request.rb index bc09b0a..6197cbd 100644 --- a/lib/gocardless_pro/resources/billing_request.rb +++ b/lib/gocardless_pro/resources/billing_request.rb @@ -20,8 +20,8 @@ module Resources # Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/) # for how-to's, explanations and tutorials. class BillingRequest - attr_reader :actions, :created_at, :fallback_enabled, :id, :mandate_request, :metadata, :payment_request, - :purpose_code, :resources, :status + attr_reader :actions, :created_at, :fallback_enabled, :fallback_occurred, :id, :mandate_request, :metadata, + :payment_request, :purpose_code, :resources, :status # Initialize a billing_request resource instance # @param object [Hash] an object returned from the API @@ -31,6 +31,7 @@ def initialize(object, response = nil) @actions = object['actions'] @created_at = object['created_at'] @fallback_enabled = object['fallback_enabled'] + @fallback_occurred = object['fallback_occurred'] @id = object['id'] @links = object['links'] @mandate_request = object['mandate_request'] diff --git a/spec/resources/billing_request_spec.rb b/spec/resources/billing_request_spec.rb index 054c2ac..cf7f845 100644 --- a/spec/resources/billing_request_spec.rb +++ b/spec/resources/billing_request_spec.rb @@ -18,6 +18,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -38,6 +39,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -58,6 +60,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -111,6 +114,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -154,6 +158,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -191,6 +196,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -233,6 +239,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -264,6 +271,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -306,6 +314,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -337,6 +346,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -379,6 +389,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -410,6 +421,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -452,6 +464,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -483,6 +496,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -525,6 +539,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -553,6 +568,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -584,6 +600,8 @@ expect(get_list_response.records.first.fallback_enabled).to eq('fallback_enabled-input') + expect(get_list_response.records.first.fallback_occurred).to eq('fallback_occurred-input') + expect(get_list_response.records.first.id).to eq('id-input') expect(get_list_response.records.first.mandate_request).to eq('mandate_request-input') @@ -617,6 +635,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -643,6 +662,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -685,6 +705,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -721,6 +742,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -778,6 +800,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -820,6 +843,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -851,6 +875,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -893,6 +918,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -924,6 +950,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -966,6 +993,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -997,6 +1025,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -1039,6 +1068,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', diff --git a/spec/services/billing_requests_service_spec.rb b/spec/services/billing_requests_service_spec.rb index e04b5a9..b9e961f 100644 --- a/spec/services/billing_requests_service_spec.rb +++ b/spec/services/billing_requests_service_spec.rb @@ -18,6 +18,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -38,6 +39,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -58,6 +60,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -134,6 +137,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -177,6 +181,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -230,6 +235,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -283,6 +289,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -314,6 +321,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -367,6 +375,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -398,6 +407,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -451,6 +461,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -482,6 +493,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -535,6 +547,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -566,6 +579,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -619,6 +633,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -646,6 +661,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -682,6 +698,8 @@ expect(get_list_response.records.first.fallback_enabled).to eq('fallback_enabled-input') + expect(get_list_response.records.first.fallback_occurred).to eq('fallback_occurred-input') + expect(get_list_response.records.first.id).to eq('id-input') expect(get_list_response.records.first.mandate_request).to eq('mandate_request-input') @@ -738,6 +756,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -764,6 +783,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -799,6 +819,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -825,6 +846,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -856,6 +878,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -885,6 +908,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -927,6 +951,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -963,6 +988,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -1075,6 +1101,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -1128,6 +1155,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -1159,6 +1187,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -1212,6 +1241,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -1243,6 +1273,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -1296,6 +1327,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -1327,6 +1359,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', @@ -1380,6 +1413,7 @@ 'actions' => 'actions-input', 'created_at' => 'created_at-input', 'fallback_enabled' => 'fallback_enabled-input', + 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', From 17b1b00ad6c6c3f863d488e3d9bf959d33f97d2e Mon Sep 17 00:00:00 2001 From: Robot Date: Mon, 2 Dec 2024 16:16:13 +0000 Subject: [PATCH 4/5] Changes from gocardless/gocardless-pro-ruby-template@a4d2ecc39320baacae12ad79c032d237fc6ed0a5 --- .../resources/billing_request.rb | 36 +++-- .../services/billing_requests_service.rb | 4 +- spec/resources/billing_request_spec.rb | 116 +++++++++++---- .../services/billing_requests_service_spec.rb | 132 +++++++++++++----- 4 files changed, 219 insertions(+), 69 deletions(-) diff --git a/lib/gocardless_pro/resources/billing_request.rb b/lib/gocardless_pro/resources/billing_request.rb index 6197cbd..fb813eb 100644 --- a/lib/gocardless_pro/resources/billing_request.rb +++ b/lib/gocardless_pro/resources/billing_request.rb @@ -10,18 +10,20 @@ module GoCardlessPro module Resources # Represents an instance of a billing_request resource returned from the API - # Billing Requests help create resources that require input or action from a - # customer. An example of required input might be additional customer - # billing - # details, while an action would be asking a customer to authorise a payment - # using their mobile banking app. + # Billing Requests help create resources that require input or action from + # a customer. An example of required input might be additional customer + # billing details, while an action would be asking a customer to authorise a + # payment using their mobile banking app. # # See [Billing Requests: # Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/) - # for how-to's, explanations and tutorials. + # for how-to's, explanations and tutorials.

Important: All properties associated with + # `subscription_request` and `instalment_schedule_request` are only + # supported for ACH and PAD schemes.

class BillingRequest - attr_reader :actions, :created_at, :fallback_enabled, :fallback_occurred, :id, :mandate_request, :metadata, - :payment_request, :purpose_code, :resources, :status + attr_reader :actions, :created_at, :fallback_enabled, :fallback_occurred, :id, :instalment_schedule_request, + :mandate_request, :metadata, :payment_request, :purpose_code, :resources, :status, :subscription_request # Initialize a billing_request resource instance # @param object [Hash] an object returned from the API @@ -33,6 +35,7 @@ def initialize(object, response = nil) @fallback_enabled = object['fallback_enabled'] @fallback_occurred = object['fallback_occurred'] @id = object['id'] + @instalment_schedule_request = object['instalment_schedule_request'] @links = object['links'] @mandate_request = object['mandate_request'] @metadata = object['metadata'] @@ -40,6 +43,7 @@ def initialize(object, response = nil) @purpose_code = object['purpose_code'] @resources = object['resources'] @status = object['status'] + @subscription_request = object['subscription_request'] @response = response end @@ -82,6 +86,14 @@ def customer_billing_detail @links['customer_billing_detail'] end + def instalment_schedule_request + @links['instalment_schedule_request'] + end + + def instalment_schedule_request_instalment_schedule + @links['instalment_schedule_request_instalment_schedule'] + end + def mandate_request @links['mandate_request'] end @@ -105,6 +117,14 @@ def payment_request def payment_request_payment @links['payment_request_payment'] end + + def subscription_request + @links['subscription_request'] + end + + def subscription_request_subscription + @links['subscription_request_subscription'] + end end end end diff --git a/lib/gocardless_pro/services/billing_requests_service.rb b/lib/gocardless_pro/services/billing_requests_service.rb index f3b6fc9..4329974 100644 --- a/lib/gocardless_pro/services/billing_requests_service.rb +++ b/lib/gocardless_pro/services/billing_requests_service.rb @@ -10,7 +10,9 @@ module GoCardlessPro module Services # Service for making requests to the BillingRequest endpoints class BillingRequestsService < BaseService - # + #

Important: All properties associated with + # `subscription_request` and `instalment_schedule_request` are only supported + # for ACH and PAD schemes.

# Example URL: /billing_requests # @param options [Hash] parameters as a hash, under a params key. def create(options = {}) diff --git a/spec/resources/billing_request_spec.rb b/spec/resources/billing_request_spec.rb index cf7f845..cbf2150 100644 --- a/spec/resources/billing_request_spec.rb +++ b/spec/resources/billing_request_spec.rb @@ -20,13 +20,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } end @@ -41,13 +43,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } } ) @@ -62,13 +66,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -116,13 +122,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } end @@ -160,13 +168,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -198,13 +208,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -241,13 +253,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -273,13 +287,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -316,13 +332,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -348,13 +366,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -391,13 +411,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -423,13 +445,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -466,13 +490,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -498,13 +524,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -541,13 +569,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -570,13 +600,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { cursors: { @@ -604,6 +636,8 @@ expect(get_list_response.records.first.id).to eq('id-input') + expect(get_list_response.records.first.instalment_schedule_request).to eq('instalment_schedule_request-input') + expect(get_list_response.records.first.mandate_request).to eq('mandate_request-input') expect(get_list_response.records.first.metadata).to eq('metadata-input') @@ -615,6 +649,8 @@ expect(get_list_response.records.first.resources).to eq('resources-input') expect(get_list_response.records.first.status).to eq('status-input') + + expect(get_list_response.records.first.subscription_request).to eq('subscription_request-input') end it 'exposes the cursors for before and after' do @@ -637,13 +673,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { cursors: { after: 'AB345' }, @@ -664,13 +702,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { limit: 2, @@ -707,13 +747,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -744,13 +786,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -802,13 +846,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -845,13 +891,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -877,13 +925,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -920,13 +970,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -952,13 +1004,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -995,13 +1049,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -1027,13 +1083,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -1070,13 +1128,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers diff --git a/spec/services/billing_requests_service_spec.rb b/spec/services/billing_requests_service_spec.rb index b9e961f..9619ea3 100644 --- a/spec/services/billing_requests_service_spec.rb +++ b/spec/services/billing_requests_service_spec.rb @@ -20,13 +20,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } end @@ -41,13 +43,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } } ) @@ -62,13 +66,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -139,13 +145,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } end @@ -183,13 +191,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -237,13 +247,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -291,13 +303,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -323,13 +337,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -377,13 +393,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -409,13 +427,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -463,13 +483,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -495,13 +517,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -549,13 +573,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -581,13 +607,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -635,13 +663,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -663,13 +693,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { cursors: { @@ -702,6 +734,8 @@ expect(get_list_response.records.first.id).to eq('id-input') + expect(get_list_response.records.first.instalment_schedule_request).to eq('instalment_schedule_request-input') + expect(get_list_response.records.first.mandate_request).to eq('mandate_request-input') expect(get_list_response.records.first.metadata).to eq('metadata-input') @@ -713,6 +747,8 @@ expect(get_list_response.records.first.resources).to eq('resources-input') expect(get_list_response.records.first.status).to eq('status-input') + + expect(get_list_response.records.first.subscription_request).to eq('subscription_request-input') end it 'exposes the cursors for before and after' do @@ -758,13 +794,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { cursors: { after: 'AB345' }, @@ -785,13 +823,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { limit: 2, @@ -821,13 +861,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { cursors: { after: 'AB345' }, @@ -848,13 +890,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { limit: 2, @@ -880,13 +924,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { cursors: { after: 'AB345' }, @@ -910,13 +956,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' }], meta: { limit: 2, @@ -953,13 +1001,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -990,13 +1040,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -1103,13 +1155,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -1157,13 +1211,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -1189,13 +1245,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -1243,13 +1301,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -1275,13 +1335,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -1329,13 +1391,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers @@ -1361,13 +1425,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, @@ -1415,13 +1481,15 @@ 'fallback_enabled' => 'fallback_enabled-input', 'fallback_occurred' => 'fallback_occurred-input', 'id' => 'id-input', + 'instalment_schedule_request' => 'instalment_schedule_request-input', 'links' => 'links-input', 'mandate_request' => 'mandate_request-input', 'metadata' => 'metadata-input', 'payment_request' => 'payment_request-input', 'purpose_code' => 'purpose_code-input', 'resources' => 'resources-input', - 'status' => 'status-input' + 'status' => 'status-input', + 'subscription_request' => 'subscription_request-input' } }.to_json, headers: response_headers From cc30bbb32c243f7ec06e4bd6a2751a54831a1f6a Mon Sep 17 00:00:00 2001 From: Robot Date: Tue, 3 Dec 2024 08:32:39 +0000 Subject: [PATCH 5/5] Changes from gocardless/gocardless-pro-ruby-template@93e6c4d893a751768da4fa13ea2d29da33da66b8 --- lib/gocardless_pro/client.rb | 2 +- lib/gocardless_pro/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gocardless_pro/client.rb b/lib/gocardless_pro/client.rb index 7f9ba3c..7d89c3e 100644 --- a/lib/gocardless_pro/client.rb +++ b/lib/gocardless_pro/client.rb @@ -233,7 +233,7 @@ def default_options 'User-Agent' => "#{user_agent}", 'Content-Type' => 'application/json', 'GoCardless-Client-Library' => 'gocardless-pro-ruby', - 'GoCardless-Client-Version' => '3.0.0' + 'GoCardless-Client-Version' => '3.1.0' } } end diff --git a/lib/gocardless_pro/version.rb b/lib/gocardless_pro/version.rb index ba64b1c..bd6a60f 100644 --- a/lib/gocardless_pro/version.rb +++ b/lib/gocardless_pro/version.rb @@ -3,5 +3,5 @@ module GoCardlessPro module GoCardlessPro # Current version of the GC gem - VERSION = '3.0.0' + VERSION = '3.1.0' end