adyen-ruby-api-library 11.3.0 → 12.0.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/.github/workflows/ruby.yml +2 -2
- data/Gemfile +2 -2
- data/README.md +30 -7
- data/VERSION +1 -1
- data/adyen-ruby-api-library.gemspec +1 -1
- data/lib/adyen/client.rb +6 -11
- data/lib/adyen/deprecation.rb +34 -0
- data/lib/adyen/services/balanceControl/balance_control_api.rb +2 -0
- data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +0 -40
- data/lib/adyen/services/balancePlatform/custom_payout_schedules_sweeps_api.rb +56 -0
- data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +2 -0
- data/lib/adyen/services/balancePlatform/grant_offers_api.rb +4 -0
- data/lib/adyen/services/balancePlatform/managed_payout_schedules_api.rb +80 -0
- data/lib/adyen/services/balancePlatform/recurring_top_ups_api.rb +48 -0
- data/lib/adyen/services/balancePlatform/sca_device_management_api.rb +8 -0
- data/lib/adyen/services/balancePlatform.rb +15 -0
- data/lib/adyen/services/checkout/payments_api.rb +8 -0
- data/lib/adyen/services/checkout/utility_api.rb +2 -0
- data/lib/adyen/services/checkout.rb +1 -1
- data/lib/adyen/services/management/donation_campaigns_api.rb +64 -0
- data/lib/adyen/services/management.rb +5 -0
- data/lib/adyen/services/payment/modifications_api.rb +2 -0
- data/lib/adyen/services/posMobile/pos_mobile_api.rb +5 -0
- data/lib/adyen/services/posTerminalManagement.rb +10 -0
- data/lib/adyen/services/recurring/recurring_api.rb +4 -0
- data/lib/adyen/services/service.rb +2 -0
- data/lib/adyen/services/transfers/capital_api.rb +6 -0
- data/lib/adyen/services/transfers/cash_out_api.rb +24 -0
- data/lib/adyen/services/transfers.rb +5 -0
- data/lib/adyen/utils/hmac_validator.rb +15 -17
- data/lib/adyen/version.rb +1 -1
- data/sdk-generation-log/balanceplatform.json +4 -4
- data/sdk-generation-log/checkout.json +4 -4
- data/sdk-generation-log/management.json +4 -4
- data/sdk-generation-log/posmobile.json +4 -4
- data/sdk-generation-log/transfers.json +4 -4
- data/spec/balance_control_spec.rb +41 -0
- data/spec/balance_platform_spec.rb +498 -4
- data/spec/checkout-oauth_spec.rb +220 -10
- data/spec/checkout_spec.rb +245 -10
- data/spec/client_spec.rb +1 -5
- data/spec/deprecation_spec.rb +112 -0
- data/spec/management_spec.rb +184 -0
- data/spec/mocks/requests/BalancePlatform/apply_managed_schedule.json +14 -0
- data/spec/mocks/requests/BalancePlatform/begin_sca_device_registration.json +4 -0
- data/spec/mocks/requests/BalancePlatform/create_recurring_top_up.json +21 -0
- data/spec/mocks/requests/BalancePlatform/create_sweep.json +10 -0
- data/spec/mocks/requests/BalancePlatform/finish_sca_device_registration.json +3 -0
- data/spec/mocks/requests/BalancePlatform/submit_sca_association.json +8 -0
- data/spec/mocks/requests/BalancePlatform/update_balance_account_managed_schedule.json +5 -0
- data/spec/mocks/requests/BalancePlatform/update_recurring_top_ups.json +3 -0
- data/spec/mocks/requests/BalancePlatform/update_sweep.json +6 -0
- data/spec/mocks/requests/Checkout/amount_updates.json +1 -1
- data/spec/mocks/requests/Checkout/card_details.json +3 -0
- data/spec/mocks/requests/Checkout/create_stored_payment_method.json +10 -0
- data/spec/mocks/requests/Checkout/donation_campaigns.json +4 -0
- data/spec/mocks/requests/Checkout/donations.json +9 -0
- data/spec/mocks/requests/Checkout/orders.json +5 -3
- data/spec/mocks/requests/Checkout/payment-details.json +2 -14
- data/spec/mocks/requests/Checkout/payment_methods_balance.json +5 -2
- data/spec/mocks/requests/Checkout/payments.json +9 -10
- data/spec/mocks/requests/Checkout/paypal_update_order.json +5 -0
- data/spec/mocks/requests/Checkout/reversals.json +3 -0
- data/spec/mocks/requests/Checkout/update_session.json +7 -0
- data/spec/mocks/requests/Management/create_donation_campaign.json +7 -0
- data/spec/mocks/requests/Management/list_nonprofits.json +5 -0
- data/spec/mocks/requests/Management/update_donation_campaign.json +6 -0
- data/spec/mocks/requests/Transfers/initiate_cashout.json +12 -0
- data/spec/mocks/responses/BalancePlatform/apply_managed_schedule.json +17 -0
- data/spec/mocks/responses/BalancePlatform/begin_sca_device_registration.json +8 -0
- data/spec/mocks/responses/BalancePlatform/create_recurring_top_up.json +23 -0
- data/spec/mocks/responses/BalancePlatform/create_sweep.json +12 -0
- data/spec/mocks/responses/BalancePlatform/finish_sca_device_registration.json +7 -0
- data/spec/mocks/responses/BalancePlatform/get_all_sweeps_for_balance_account.json +31 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedule_by_id.json +17 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedules.json +26 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedule_by_id.json +27 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedules.json +31 -0
- data/spec/mocks/responses/BalancePlatform/get_payout_schedule_executions.json +21 -0
- data/spec/mocks/responses/BalancePlatform/get_recurring_top_ups.json +35 -0
- data/spec/mocks/responses/BalancePlatform/get_sweep.json +12 -0
- data/spec/mocks/responses/BalancePlatform/submit_sca_association.json +10 -0
- data/spec/mocks/responses/BalancePlatform/update_balance_account_managed_schedule.json +18 -0
- data/spec/mocks/responses/BalancePlatform/update_recurring_top_ups.json +23 -0
- data/spec/mocks/responses/BalancePlatform/update_sweep.json +12 -0
- data/spec/mocks/responses/Checkout/amount_updates.json +1 -1
- data/spec/mocks/responses/Checkout/card_details.json +5 -0
- data/spec/mocks/responses/Checkout/create_stored_payment_method.json +5 -0
- data/spec/mocks/responses/Checkout/donation_campaigns.json +1 -0
- data/spec/mocks/responses/Checkout/donations.json +5 -0
- data/spec/mocks/responses/Checkout/orders.json +6 -1
- data/spec/mocks/responses/Checkout/orders_cancel.json +1 -1
- data/spec/mocks/responses/Checkout/payment-details.json +2 -13
- data/spec/mocks/responses/Checkout/payment_links.json +3 -0
- data/spec/mocks/responses/Checkout/payment_methods.json +2 -2
- data/spec/mocks/responses/Checkout/payment_methods_balance.json +5 -1
- data/spec/mocks/responses/Checkout/payments.json +4 -94
- data/spec/mocks/responses/Checkout/paypal_update_order.json +4 -0
- data/spec/mocks/responses/Checkout/reversals.json +6 -0
- data/spec/mocks/responses/Checkout/update_session.json +3 -0
- data/spec/mocks/responses/Management/donation_campaign.json +13 -0
- data/spec/mocks/responses/Management/list_donation_campaigns.json +19 -0
- data/spec/mocks/responses/Management/list_nonprofits.json +34 -0
- data/spec/mocks/responses/Transfers/initiate_cashout.json +31 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/transfers_spec.rb +28 -0
- data/spec/utils/consumer_smoke.rb +23 -0
- data/spec/utils/hmac_validator_spec.rb +55 -0
- data/templates/api-small.mustache +4 -2
- data/templates/api.mustache +4 -2
- metadata +58 -2
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Adyen::Deprecation do
|
|
4
|
+
describe '.warn' do
|
|
5
|
+
around do |example|
|
|
6
|
+
previous = Warning[:deprecated]
|
|
7
|
+
example.run
|
|
8
|
+
ensure
|
|
9
|
+
Warning[:deprecated] = previous
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
context 'message formatting' do
|
|
13
|
+
before { Warning[:deprecated] = true }
|
|
14
|
+
|
|
15
|
+
it 'formats a warning with the method name only' do
|
|
16
|
+
expect { described_class.warn(:get_payment_methods) }
|
|
17
|
+
.to output(/\[DEPRECATED\] `get_payment_methods` is deprecated\n/).to_stderr
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'formats a warning with since' do
|
|
21
|
+
expect { described_class.warn(:get_payment_methods, since: 'Adyen Checkout API v67') }
|
|
22
|
+
.to output(/\[DEPRECATED\] `get_payment_methods` is deprecated since Adyen Checkout API v67\n/).to_stderr
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it 'formats a warning with message' do
|
|
26
|
+
expect { described_class.warn(:get_payment_methods, message: 'Use `payments` instead.') }
|
|
27
|
+
.to output(/\[DEPRECATED\] `get_payment_methods` is deprecated\. Use `payments` instead\.\n/).to_stderr
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it 'formats a warning with both since and message' do
|
|
31
|
+
expect do
|
|
32
|
+
described_class.warn(:get_payment_methods,
|
|
33
|
+
since: 'Adyen Checkout API v67',
|
|
34
|
+
message: 'Use `payments` instead.')
|
|
35
|
+
end
|
|
36
|
+
.to output(/\[DEPRECATED\] `get_payment_methods` is deprecated since Adyen Checkout API v67\. Use `payments` instead\.\n/).to_stderr
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
context 'when Warning[:deprecated] is true' do
|
|
41
|
+
it 'writes the formatted message to stderr' do
|
|
42
|
+
Warning[:deprecated] = true
|
|
43
|
+
expect { described_class.warn(:foo, since: 'Adyen Checkout API v67') }
|
|
44
|
+
.to output(/\[DEPRECATED\] `foo` is deprecated since Adyen Checkout API v67\n/).to_stderr
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
it 'attributes the warning to the call site (file:line: warning: format)' do
|
|
48
|
+
Warning[:deprecated] = true
|
|
49
|
+
expect { described_class.warn(:foo, since: 'Adyen Checkout API v67') }
|
|
50
|
+
.to output(/\A.+:\d+: warning: \[DEPRECATED\] `foo`/).to_stderr
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
it 'emits through Warning.warn tagged with the :deprecated category' do
|
|
54
|
+
Warning[:deprecated] = true
|
|
55
|
+
expect(Warning).to receive(:warn).with(
|
|
56
|
+
/:\d+: warning: \[DEPRECATED\] `foo` is deprecated since Adyen Checkout API v67\n/,
|
|
57
|
+
category: :deprecated
|
|
58
|
+
)
|
|
59
|
+
described_class.warn(:foo, since: 'Adyen Checkout API v67')
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
context 'when Warning[:deprecated] is false' do
|
|
64
|
+
it 'writes nothing to stderr' do
|
|
65
|
+
Warning[:deprecated] = false
|
|
66
|
+
expect { described_class.warn(:foo, since: 'Adyen Checkout API v67') }
|
|
67
|
+
.not_to output.to_stderr
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
context 'silencing' do
|
|
72
|
+
around do |example|
|
|
73
|
+
original_env = ENV.fetch('ADYEN_SILENCE_DEPRECATIONS', nil)
|
|
74
|
+
example.run
|
|
75
|
+
ensure
|
|
76
|
+
described_class.silenced = nil
|
|
77
|
+
if original_env.nil?
|
|
78
|
+
ENV.delete('ADYEN_SILENCE_DEPRECATIONS')
|
|
79
|
+
else
|
|
80
|
+
ENV['ADYEN_SILENCE_DEPRECATIONS'] = original_env
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
before { Warning[:deprecated] = true }
|
|
85
|
+
|
|
86
|
+
it 'emits nothing when silenced is true, even with the category enabled' do
|
|
87
|
+
described_class.silenced = true
|
|
88
|
+
expect { described_class.warn(:foo, since: 'Adyen Checkout API v67') }
|
|
89
|
+
.not_to output.to_stderr
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
it 'is silenced when ADYEN_SILENCE_DEPRECATIONS has a truthy value' do
|
|
93
|
+
ENV['ADYEN_SILENCE_DEPRECATIONS'] = '1'
|
|
94
|
+
expect { described_class.warn(:foo, since: 'Adyen Checkout API v67') }
|
|
95
|
+
.not_to output.to_stderr
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
it 'is not silenced when ADYEN_SILENCE_DEPRECATIONS has a falsy value' do
|
|
99
|
+
ENV['ADYEN_SILENCE_DEPRECATIONS'] = '0'
|
|
100
|
+
expect { described_class.warn(:foo, since: 'Adyen Checkout API v67') }
|
|
101
|
+
.to output(/\[DEPRECATED\] `foo` is deprecated since Adyen Checkout API v67\n/).to_stderr
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
it 'lets the attribute override the environment variable' do
|
|
105
|
+
ENV['ADYEN_SILENCE_DEPRECATIONS'] = '1'
|
|
106
|
+
described_class.silenced = false
|
|
107
|
+
expect { described_class.warn(:foo, since: 'Adyen Checkout API v67') }
|
|
108
|
+
.to output(/\[DEPRECATED\] `foo` is deprecated since Adyen Checkout API v67\n/).to_stderr
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
data/spec/management_spec.rb
CHANGED
|
@@ -63,4 +63,188 @@ RSpec.describe Adyen::Management, service: 'Management' do
|
|
|
63
63
|
expect(result.status)
|
|
64
64
|
.to eq(200)
|
|
65
65
|
end
|
|
66
|
+
|
|
67
|
+
## Donation campaigns
|
|
68
|
+
|
|
69
|
+
it 'makes a create_donation_campaign POST call' do
|
|
70
|
+
request_body = JSON.parse(json_from_file('mocks/requests/Management/create_donation_campaign.json'))
|
|
71
|
+
response_body = json_from_file('mocks/responses/Management/donation_campaign.json')
|
|
72
|
+
|
|
73
|
+
url = @shared_values[:client].service_url(@shared_values[:service], 'companies/companyID/campaignManagement',
|
|
74
|
+
@shared_values[:client].management.version)
|
|
75
|
+
WebMock.stub_request(:post, url)
|
|
76
|
+
.with(
|
|
77
|
+
body: request_body,
|
|
78
|
+
headers: {
|
|
79
|
+
'x-api-key' => @shared_values[:client].api_key
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
.to_return(
|
|
83
|
+
body: response_body
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
result = @shared_values[:client].management.donation_campaigns_api.create_donation_campaign(request_body,
|
|
87
|
+
'companyID')
|
|
88
|
+
response_hash = result.response
|
|
89
|
+
|
|
90
|
+
expect(result.status)
|
|
91
|
+
.to eq(200)
|
|
92
|
+
expect(response_hash)
|
|
93
|
+
.to eq(JSON.parse(response_body))
|
|
94
|
+
expect(response_hash)
|
|
95
|
+
.to be_a Adyen::HashWithAccessors
|
|
96
|
+
expect(response_hash)
|
|
97
|
+
.to be_a_kind_of Hash
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
it 'makes a delete_donation_campaign DELETE call' do
|
|
101
|
+
url = @shared_values[:client].service_url(@shared_values[:service],
|
|
102
|
+
'companies/companyID/campaignManagement/donationCampaignID',
|
|
103
|
+
@shared_values[:client].management.version)
|
|
104
|
+
WebMock.stub_request(:delete, url)
|
|
105
|
+
.with(
|
|
106
|
+
headers: {
|
|
107
|
+
'x-api-key' => @shared_values[:client].api_key
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
.to_return(status: 204, body: '')
|
|
111
|
+
|
|
112
|
+
result = @shared_values[:client].management.donation_campaigns_api.delete_donation_campaign('companyID',
|
|
113
|
+
'donationCampaignID')
|
|
114
|
+
|
|
115
|
+
expect(result.status)
|
|
116
|
+
.to eq(204)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
it 'makes a list_donation_campaigns_for_account_holder GET call' do
|
|
120
|
+
response_body = json_from_file('mocks/responses/Management/list_donation_campaigns.json')
|
|
121
|
+
|
|
122
|
+
url = @shared_values[:client].service_url(@shared_values[:service],
|
|
123
|
+
'companies/companyID/campaignManagement/accountHolders/accountHolderID',
|
|
124
|
+
@shared_values[:client].management.version)
|
|
125
|
+
WebMock.stub_request(:get, url)
|
|
126
|
+
.with(
|
|
127
|
+
query: { 'status' => 'active', 'pageNumber' => 1, 'pageSize' => 10 },
|
|
128
|
+
headers: {
|
|
129
|
+
'x-api-key' => @shared_values[:client].api_key
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
.to_return(
|
|
133
|
+
body: response_body
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
result = @shared_values[:client].management.donation_campaigns_api
|
|
137
|
+
.list_donation_campaigns_for_account_holder('companyID', 'accountHolderID',
|
|
138
|
+
query_params: { 'status' => 'active',
|
|
139
|
+
'pageNumber' => 1,
|
|
140
|
+
'pageSize' => 10 })
|
|
141
|
+
response_hash = result.response
|
|
142
|
+
|
|
143
|
+
expect(result.status)
|
|
144
|
+
.to eq(200)
|
|
145
|
+
expect(response_hash)
|
|
146
|
+
.to eq(JSON.parse(response_body))
|
|
147
|
+
expect(response_hash)
|
|
148
|
+
.to be_a Adyen::HashWithAccessors
|
|
149
|
+
expect(response_hash)
|
|
150
|
+
.to be_a_kind_of Hash
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
it 'makes a list_nonprofits POST call' do
|
|
154
|
+
request_body = JSON.parse(json_from_file('mocks/requests/Management/list_nonprofits.json'))
|
|
155
|
+
response_body = json_from_file('mocks/responses/Management/list_nonprofits.json')
|
|
156
|
+
|
|
157
|
+
url = @shared_values[:client].service_url(@shared_values[:service], 'companies/companyID/nonprofits',
|
|
158
|
+
@shared_values[:client].management.version)
|
|
159
|
+
WebMock.stub_request(:post, url)
|
|
160
|
+
.with(
|
|
161
|
+
body: request_body,
|
|
162
|
+
query: { 'searchTerm' => 'example', 'pageNumber' => 1, 'pageSize' => 10 },
|
|
163
|
+
headers: {
|
|
164
|
+
'x-api-key' => @shared_values[:client].api_key
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
.to_return(
|
|
168
|
+
body: response_body
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
result = @shared_values[:client].management.donation_campaigns_api
|
|
172
|
+
.list_nonprofits(request_body, 'companyID',
|
|
173
|
+
query_params: { 'searchTerm' => 'example',
|
|
174
|
+
'pageNumber' => 1,
|
|
175
|
+
'pageSize' => 10 })
|
|
176
|
+
response_hash = result.response
|
|
177
|
+
|
|
178
|
+
expect(result.status)
|
|
179
|
+
.to eq(200)
|
|
180
|
+
expect(response_hash)
|
|
181
|
+
.to eq(JSON.parse(response_body))
|
|
182
|
+
expect(response_hash)
|
|
183
|
+
.to be_a Adyen::HashWithAccessors
|
|
184
|
+
expect(response_hash)
|
|
185
|
+
.to be_a_kind_of Hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
it 'makes an update_donation_campaign PATCH call' do
|
|
189
|
+
request_body = JSON.parse(json_from_file('mocks/requests/Management/update_donation_campaign.json'))
|
|
190
|
+
response_body = json_from_file('mocks/responses/Management/donation_campaign.json')
|
|
191
|
+
|
|
192
|
+
url = @shared_values[:client].service_url(@shared_values[:service],
|
|
193
|
+
'companies/companyID/campaignManagement/donationCampaignID',
|
|
194
|
+
@shared_values[:client].management.version)
|
|
195
|
+
WebMock.stub_request(:patch, url)
|
|
196
|
+
.with(
|
|
197
|
+
body: request_body,
|
|
198
|
+
headers: {
|
|
199
|
+
'x-api-key' => @shared_values[:client].api_key
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
.to_return(
|
|
203
|
+
body: response_body
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
result = @shared_values[:client].management.donation_campaigns_api.update_donation_campaign(request_body,
|
|
207
|
+
'companyID',
|
|
208
|
+
'donationCampaignID')
|
|
209
|
+
response_hash = result.response
|
|
210
|
+
|
|
211
|
+
expect(result.status)
|
|
212
|
+
.to eq(200)
|
|
213
|
+
expect(response_hash)
|
|
214
|
+
.to eq(JSON.parse(response_body))
|
|
215
|
+
expect(response_hash)
|
|
216
|
+
.to be_a Adyen::HashWithAccessors
|
|
217
|
+
expect(response_hash)
|
|
218
|
+
.to be_a_kind_of Hash
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
it 'makes an update_donation_campaign_status POST call' do
|
|
222
|
+
response_body = json_from_file('mocks/responses/Management/donation_campaign.json')
|
|
223
|
+
|
|
224
|
+
url = @shared_values[:client].service_url(@shared_values[:service],
|
|
225
|
+
'companies/companyID/campaignManagement/donationCampaignID/status/activate',
|
|
226
|
+
@shared_values[:client].management.version)
|
|
227
|
+
WebMock.stub_request(:post, url)
|
|
228
|
+
.with(
|
|
229
|
+
headers: {
|
|
230
|
+
'x-api-key' => @shared_values[:client].api_key
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
.to_return(
|
|
234
|
+
body: response_body
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
result = @shared_values[:client].management.donation_campaigns_api
|
|
238
|
+
.update_donation_campaign_status('companyID', 'donationCampaignID', 'activate')
|
|
239
|
+
response_hash = result.response
|
|
240
|
+
|
|
241
|
+
expect(result.status)
|
|
242
|
+
.to eq(200)
|
|
243
|
+
expect(response_hash)
|
|
244
|
+
.to eq(JSON.parse(response_body))
|
|
245
|
+
expect(response_hash)
|
|
246
|
+
.to be_a Adyen::HashWithAccessors
|
|
247
|
+
expect(response_hash)
|
|
248
|
+
.to be_a_kind_of Hash
|
|
249
|
+
end
|
|
66
250
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"balancePlatformPayoutScheduleId": "PSPC00000000000000000000000001",
|
|
3
|
+
"transferInstrumentId": "SE00000000000000000000001",
|
|
4
|
+
"currency": "EUR",
|
|
5
|
+
"reference": "Monthly payout",
|
|
6
|
+
"description": "Scheduled payout to merchant bank account",
|
|
7
|
+
"referenceForBeneficiary": "PAYOUT-REF-001",
|
|
8
|
+
"retainedAmount": 10000,
|
|
9
|
+
"minPayoutAmount": 1000,
|
|
10
|
+
"maxPayoutAmount": 100000000,
|
|
11
|
+
"enabled": true,
|
|
12
|
+
"frequency": "monthly",
|
|
13
|
+
"frequencyValue": 1
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"counterparty": {
|
|
3
|
+
"transferInstrumentId": "SE000000000000000000000001"
|
|
4
|
+
},
|
|
5
|
+
"description": "My description",
|
|
6
|
+
"topUpAmount": {
|
|
7
|
+
"fixed": {
|
|
8
|
+
"value": 1000,
|
|
9
|
+
"currency": "EUR"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"trigger": {
|
|
13
|
+
"schedule": {
|
|
14
|
+
"type": "weekdays"
|
|
15
|
+
},
|
|
16
|
+
"threshold": {
|
|
17
|
+
"value": 100,
|
|
18
|
+
"currency": "EUR"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"amount": {
|
|
3
|
-
"currency": "USD",
|
|
4
|
-
"value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0NSbjBwbHU3QVF2Q3hPZXMzRFg5ZTR3WDZBd1FhaXhIUjRQbXM2TnJxMVFuRkZLNHNrMW5kRGZqRTdEaXhGdlVpWlhUOHklMkZGcEFFMENPR0VhRCUyQmpGR1ZDYVI0NkVuMEo2RmJkOGFyQVYxaGJSNGZ5cFlaMFFuNFF6dE1MTWtpWW4xR0NQeWZyTjJxZEJ1aExmNFBqeUtSeFRLa2x6JTJGTmVvSnM1Smc2dVJiNVA0eiUyQiUyQkhlMUZqWFlUMXBXRzBnaDZtSDNvakttQyUyRmdOSTV3cHFlWDRpY2ZIb2t3RVB0VXAyTDFKYWNjd2xlZkU5dGlMZGZlQXJEbVZGJTJGRGp6UjE2S0JPNW1VMUR4R2dnd09DRDMzRkVqSCUyRjVERDklMkZwSW5IU0lSZFpmZDlRN2E1b1VwYmFFbFdhV2dxZjBEQ3RwWmluU2ZCWUZMNFBKeTAlMkZEdWd0VWZuWHdCVFNJV045c1lVYmFxODRMZXhkbVBHeFBwWUUyVHFaUWluVmRMTmtLbEJhQUpjUDV0JTJGTWQ4Nk5HM0lLVDZzalozJTJCVWxkMXRyNWIxVW8xbThCaSZ2ZXJzaW9uPTI=",
|
|
11
3
|
"details": {
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
"returnUrl": "",
|
|
16
|
-
"reference": "Merchant Reference",
|
|
17
|
-
"merchantAccount": "TestMerchant"
|
|
4
|
+
"returnUrlQueryString": "mock_return_url_query_string"
|
|
5
|
+
}
|
|
18
6
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"amount": {
|
|
3
|
-
"currency": "
|
|
3
|
+
"currency": "EUR",
|
|
4
4
|
"value": 1000
|
|
5
5
|
},
|
|
6
|
-
"
|
|
6
|
+
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
|
|
7
7
|
"paymentMethod": {
|
|
8
8
|
"type": "scheme",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"cvc": "737"
|
|
9
|
+
"encryptedCardNumber": "test_4111111111111111",
|
|
10
|
+
"encryptedExpiryMonth": "test_03",
|
|
11
|
+
"encryptedExpiryYear": "test_2030",
|
|
12
|
+
"encryptedSecurityCode": "test_737"
|
|
14
13
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
}
|
|
14
|
+
"reference": "YOUR_REFERENCE_0001",
|
|
15
|
+
"returnUrl": "https://your-company.example/checkout?orderRef=123"
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"amount": {
|
|
3
|
+
"value": 110000,
|
|
4
|
+
"currency": "EUR"
|
|
5
|
+
},
|
|
6
|
+
"instructingBalanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4",
|
|
7
|
+
"counterparty": {
|
|
8
|
+
"transferInstrumentId": "SE000JVZ7Q8D2ZJ4VZ0J"
|
|
9
|
+
},
|
|
10
|
+
"referenceForBeneficiary": "Your-reference-sent-to-the-beneficiary",
|
|
11
|
+
"description": "Your description for the cashout"
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "PSAC00000000000000000000000001",
|
|
3
|
+
"balancePlatformPayoutScheduleId": "PSPC00000000000000000000000001",
|
|
4
|
+
"balanceAccountId": "BA000000000000000000001",
|
|
5
|
+
"transferInstrumentId": "SE00000000000000000000001",
|
|
6
|
+
"currency": "EUR",
|
|
7
|
+
"reference": "Monthly payout",
|
|
8
|
+
"description": "Scheduled payout to merchant bank account",
|
|
9
|
+
"referenceForBeneficiary": "PAYOUT-REF-001",
|
|
10
|
+
"retainedAmount": 10000,
|
|
11
|
+
"minPayoutAmount": 1000,
|
|
12
|
+
"maxPayoutAmount": 100000000,
|
|
13
|
+
"createdAt": "2024-01-15T10:30:00Z",
|
|
14
|
+
"enabled": true,
|
|
15
|
+
"frequency": "monthly",
|
|
16
|
+
"frequencyValue": 1
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "TUPC0000000000000000000001",
|
|
3
|
+
"counterparty": {
|
|
4
|
+
"transferInstrumentId": "SE000000000000000000000001"
|
|
5
|
+
},
|
|
6
|
+
"description": "My description",
|
|
7
|
+
"topUpAmount": {
|
|
8
|
+
"fixed": {
|
|
9
|
+
"value": 1000,
|
|
10
|
+
"currency": "EUR"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"trigger": {
|
|
14
|
+
"schedule": {
|
|
15
|
+
"type": "weekdays"
|
|
16
|
+
},
|
|
17
|
+
"threshold": {
|
|
18
|
+
"value": 100,
|
|
19
|
+
"currency": "EUR"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"status": "active"
|
|
23
|
+
}
|