checkout_sdk 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/checkout_sdk/abstract_checkout_sdk_builder.rb +1 -0
- data/lib/checkout_sdk/accounts/accounts_client.rb +8 -8
- data/lib/checkout_sdk/api_client.rb +1 -1
- data/lib/checkout_sdk/apm/previous/klarna/klarna_client.rb +3 -3
- data/lib/checkout_sdk/checkout_api.rb +5 -1
- data/lib/checkout_sdk/checkout_utils.rb +9 -9
- data/lib/checkout_sdk/common/payment_source_type.rb +1 -0
- data/lib/checkout_sdk/customers/customers_client.rb +2 -2
- data/lib/checkout_sdk/disputes/disputes_client.rb +3 -3
- data/lib/checkout_sdk/events/events_client.rb +1 -1
- data/lib/checkout_sdk/financial/financial.rb +4 -0
- data/lib/checkout_sdk/financial/financial_actions_query.rb +20 -0
- data/lib/checkout_sdk/financial/financial_client.rb +21 -0
- data/lib/checkout_sdk/forex/forex_client.rb +1 -1
- data/lib/checkout_sdk/instruments/instruments_client.rb +3 -3
- data/lib/checkout_sdk/instruments/previous/instruments_client.rb +2 -2
- data/lib/checkout_sdk/json_serializer.rb +2 -0
- data/lib/checkout_sdk/metadata/metadata_client.rb +1 -1
- data/lib/checkout_sdk/oauth_scopes.rb +2 -0
- data/lib/checkout_sdk/payments/base_payments_client.rb +3 -3
- data/lib/checkout_sdk/payments/hosted/hosted_payments_client.rb +1 -1
- data/lib/checkout_sdk/payments/links/payments_links_client.rb +1 -1
- data/lib/checkout_sdk/payments/payments.rb +1 -0
- data/lib/checkout_sdk/payments/payments_client.rb +4 -4
- data/lib/checkout_sdk/payments/previous/payments_client.rb +3 -3
- data/lib/checkout_sdk/payments/processing_settings.rb +3 -0
- data/lib/checkout_sdk/payments/refund_request.rb +4 -1
- data/lib/checkout_sdk/payments/source/apm/sepa_source.rb +33 -0
- data/lib/checkout_sdk/reconciliation/reconciliation_client.rb +4 -4
- data/lib/checkout_sdk/reports/reports_client.rb +1 -1
- data/lib/checkout_sdk/risk/risk_client.rb +2 -2
- data/lib/checkout_sdk/sessions/sessions_client.rb +3 -3
- data/lib/checkout_sdk/sources/sources_client.rb +1 -1
- data/lib/checkout_sdk/tokens/tokens_client.rb +1 -1
- data/lib/checkout_sdk/transfers/transfers_client.rb +1 -1
- data/lib/checkout_sdk/version.rb +1 -1
- data/lib/checkout_sdk/webhooks/webhooks_client.rb +3 -3
- data/lib/checkout_sdk/workflows/workflows_client.rb +4 -4
- data/lib/checkout_sdk.rb +1 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5656bca2a4cfca049006039e30d56ec21f8ad233f79efbbf15d2a830807a6f6
|
4
|
+
data.tar.gz: ddcdcfd5e2d1ce03682caeca02eb8e28699a5eceb7303ccd5b828004fd5c7eef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2f895ff8b8b7709f1dacc950c0c5da3229a3fde8692085e47ab9f8cda2129f9af1d2a7906dac7fdba1f861e749051f2454f2c1bdc060fe09483daaf181f2384
|
7
|
+
data.tar.gz: 32122a90fee6bf37a14681a06ad5bddc25280fba67e5cd767d566e2b416f4502ce450af6b9797c98daa44d1b113552dabcb0786ccfef2741e7b41edd7c6b3524
|
data/README.md
CHANGED
@@ -103,7 +103,15 @@ api = CheckoutSdk.builder
|
|
103
103
|
Then just get any client, and start making requests:
|
104
104
|
|
105
105
|
```ruby
|
106
|
-
request =
|
106
|
+
request = {
|
107
|
+
source: {
|
108
|
+
type: 'token',
|
109
|
+
token: 'tok_4gzeau5o2uqubbk6fufs3m7p54',
|
110
|
+
},
|
111
|
+
reference: '9bf2e1e9-193a-400a-86d5-debabc495237',
|
112
|
+
amount: 10,
|
113
|
+
currency: 'GBP',
|
114
|
+
}
|
107
115
|
payment_response = api.payments.request_payment(request)
|
108
116
|
```
|
109
117
|
|
@@ -21,7 +21,7 @@ module CheckoutSdk
|
|
21
21
|
@files_client = files_client
|
22
22
|
end
|
23
23
|
|
24
|
-
# @param [OnboardEntity] entity_request
|
24
|
+
# @param [Hash, OnboardEntity] entity_request
|
25
25
|
def create_entity(entity_request)
|
26
26
|
api_client.invoke_post(build_path(ACCOUNTS, ENTITIES), sdk_authorization, entity_request)
|
27
27
|
end
|
@@ -32,28 +32,28 @@ module CheckoutSdk
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# @param [String] entity_id
|
35
|
-
# @param [OnboardEntity] entity_request
|
35
|
+
# @param [Hash, OnboardEntity] entity_request
|
36
36
|
def update_entity(entity_id, entity_request)
|
37
37
|
api_client.invoke_put(build_path(ACCOUNTS, ENTITIES, entity_id), sdk_authorization, entity_request)
|
38
38
|
end
|
39
39
|
|
40
40
|
# @deprecated Please use {#add_payment_instrument} instead
|
41
41
|
# @param [String] entity_id
|
42
|
-
# @param [PaymentInstrument] payment_instrument
|
42
|
+
# @param [Hash, PaymentInstrument] payment_instrument
|
43
43
|
def create_payment_instrument(entity_id, payment_instrument)
|
44
44
|
api_client.invoke_post(build_path(ACCOUNTS, ENTITIES, entity_id, INSTRUMENT), sdk_authorization,
|
45
45
|
payment_instrument)
|
46
46
|
end
|
47
47
|
|
48
48
|
# @param [String] entity_id
|
49
|
-
# @param [PaymentInstrumentRequest] payment_instrument
|
49
|
+
# @param [Hash, PaymentInstrumentRequest] payment_instrument
|
50
50
|
def add_payment_instrument(entity_id, payment_instrument)
|
51
51
|
api_client.invoke_post(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS), sdk_authorization,
|
52
52
|
payment_instrument)
|
53
53
|
end
|
54
54
|
|
55
55
|
# @param [String] entity_id
|
56
|
-
# @param [PaymentInstrumentsQuery,nil] payment_instruments_query
|
56
|
+
# @param [Hash, PaymentInstrumentsQuery,nil] payment_instruments_query
|
57
57
|
def query_payment_instruments(entity_id, payment_instruments_query = nil)
|
58
58
|
api_client.invoke_get(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS),
|
59
59
|
sdk_authorization,
|
@@ -69,7 +69,7 @@ module CheckoutSdk
|
|
69
69
|
|
70
70
|
# @param [String] entity_id
|
71
71
|
# @param [String] instrument_id
|
72
|
-
# @param [UpdatePaymentInstrumentRequest] update_payment_instrument
|
72
|
+
# @param [Hash, UpdatePaymentInstrumentRequest] update_payment_instrument
|
73
73
|
def update_payment_instrument(entity_id, instrument_id, update_payment_instrument)
|
74
74
|
api_client.invoke_patch(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS, instrument_id),
|
75
75
|
sdk_authorization,
|
@@ -78,7 +78,7 @@ module CheckoutSdk
|
|
78
78
|
|
79
79
|
# @param [String] entity_id
|
80
80
|
# @param [String] currency {CheckoutSdk::Common::Currency}
|
81
|
-
# @param [UpdateSchedule] update_schedule
|
81
|
+
# @param [Hash, UpdateSchedule] update_schedule
|
82
82
|
def update_payout_schedule(entity_id, currency, update_schedule)
|
83
83
|
api_client.invoke_put(build_path(ACCOUNTS, ENTITIES, entity_id, PAYOUT_SCHEDULE), sdk_authorization,
|
84
84
|
{ currency => update_schedule })
|
@@ -89,7 +89,7 @@ module CheckoutSdk
|
|
89
89
|
api_client.invoke_get(build_path(ACCOUNTS, ENTITIES, entity_id, PAYOUT_SCHEDULE), sdk_authorization)
|
90
90
|
end
|
91
91
|
|
92
|
-
# @param [FileRequest] file_request
|
92
|
+
# @param [Hash, FileRequest] file_request
|
93
93
|
def upload_file(file_request)
|
94
94
|
files_client.submit_file(FILES, sdk_authorization, file_request)
|
95
95
|
end
|
@@ -133,7 +133,7 @@ module CheckoutSdk
|
|
133
133
|
body = parse_json_or_contents(response)
|
134
134
|
body = OpenStruct.new if body.nil?
|
135
135
|
body = OpenStruct.new(items: body) if body.is_a? Array
|
136
|
-
body.
|
136
|
+
body.http_metadata = metadata if body.is_a? OpenStruct
|
137
137
|
body
|
138
138
|
end
|
139
139
|
|
@@ -16,7 +16,7 @@ module CheckoutSdk
|
|
16
16
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
|
17
17
|
end
|
18
18
|
|
19
|
-
# @param credit_session_request [CreditSessionRequest]
|
19
|
+
# @param credit_session_request [Hash, CreditSessionRequest]
|
20
20
|
def create_credit_session(credit_session_request)
|
21
21
|
api_client.invoke_post(build_path(base_url, CREDIT_SESSIONS), sdk_authorization, credit_session_request)
|
22
22
|
end
|
@@ -27,7 +27,7 @@ module CheckoutSdk
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# @param payment_id [String]
|
30
|
-
# @param order_capture_request [OrderCaptureRequest]
|
30
|
+
# @param order_capture_request [Hash, OrderCaptureRequest]
|
31
31
|
def capture_payment(payment_id, order_capture_request)
|
32
32
|
api_client.invoke_post(build_path(base_url, ORDERS, payment_id, CAPTURES),
|
33
33
|
sdk_authorization,
|
@@ -35,7 +35,7 @@ module CheckoutSdk
|
|
35
35
|
end
|
36
36
|
|
37
37
|
# @param payment_id [String]
|
38
|
-
# @param void_request [CheckoutSdk::Payments::VoidRequest]
|
38
|
+
# @param void_request [Hash, CheckoutSdk::Payments::VoidRequest]
|
39
39
|
def void_payment(payment_id, void_request)
|
40
40
|
api_client.invoke_post(build_path(base_url, ORDERS, payment_id, VOIDS),
|
41
41
|
sdk_authorization,
|
@@ -35,6 +35,8 @@ module CheckoutSdk
|
|
35
35
|
# @return [CheckoutSdk::Transfers::TransfersClient]
|
36
36
|
# @!attribute metadata
|
37
37
|
# @return [CheckoutSdk::Metadata::MetadataClient]
|
38
|
+
# @!attribute financial
|
39
|
+
# @return [CheckoutSdk::Financial::FinancialClient]
|
38
40
|
class CheckoutApi
|
39
41
|
attr_reader :customers,
|
40
42
|
:disputes,
|
@@ -52,7 +54,8 @@ module CheckoutSdk
|
|
52
54
|
:risk,
|
53
55
|
:balances,
|
54
56
|
:transfers,
|
55
|
-
:metadata
|
57
|
+
:metadata,
|
58
|
+
:financial
|
56
59
|
|
57
60
|
# @param [CheckoutConfiguration] configuration
|
58
61
|
def initialize(configuration)
|
@@ -74,6 +77,7 @@ module CheckoutSdk
|
|
74
77
|
@balances = CheckoutSdk::Balances::BalancesClient.new(balances_client(configuration), configuration)
|
75
78
|
@transfers = CheckoutSdk::Transfers::TransfersClient.new(transfers_client(configuration), configuration)
|
76
79
|
@metadata = CheckoutSdk::Metadata::MetadataClient.new api_client, configuration
|
80
|
+
@financial = CheckoutSdk::Financial::FinancialClient.new api_client, configuration
|
77
81
|
end
|
78
82
|
|
79
83
|
private
|
@@ -4,21 +4,21 @@ module CheckoutSdk
|
|
4
4
|
class CheckoutUtils
|
5
5
|
# @return [CheckoutSdk::HttpMetadata]
|
6
6
|
def self.map_to_http_metadata(response)
|
7
|
-
|
8
|
-
return
|
7
|
+
http_metadata = CheckoutSdk::HttpMetadata.new
|
8
|
+
return http_metadata if response.nil?
|
9
9
|
|
10
10
|
if response.is_a?(Hash)
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
http_metadata.headers = response[:headers]
|
12
|
+
http_metadata.status_code = response[:status]
|
13
|
+
http_metadata.body = response[:body]
|
14
14
|
end
|
15
15
|
|
16
16
|
if response.class.name.start_with? Faraday::Response.name
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
http_metadata.headers = response.headers
|
18
|
+
http_metadata.status_code = response.status
|
19
|
+
http_metadata.body = response.body
|
20
20
|
end
|
21
|
-
|
21
|
+
http_metadata
|
22
22
|
end
|
23
23
|
|
24
24
|
# @return [Faraday::Connection]
|
@@ -12,7 +12,7 @@ module CheckoutSdk
|
|
12
12
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
13
13
|
end
|
14
14
|
|
15
|
-
# @param [CustomerRequest] customer_request
|
15
|
+
# @param [Hash, CustomerRequest] customer_request
|
16
16
|
def create(customer_request)
|
17
17
|
api_client.invoke_post(CUSTOMERS, sdk_authorization, customer_request)
|
18
18
|
end
|
@@ -23,7 +23,7 @@ module CheckoutSdk
|
|
23
23
|
end
|
24
24
|
|
25
25
|
# @param [String] customer_id
|
26
|
-
# @param [CustomerRequest] customer_request
|
26
|
+
# @param [Hash, CustomerRequest] customer_request
|
27
27
|
def update(customer_id, customer_request)
|
28
28
|
api_client.invoke_patch(build_path(CUSTOMERS, customer_id), sdk_authorization, customer_request)
|
29
29
|
end
|
@@ -16,7 +16,7 @@ module CheckoutSdk
|
|
16
16
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
17
17
|
end
|
18
18
|
|
19
|
-
# @param [DisputesQueryFilter] disputes_query_filter
|
19
|
+
# @param [Hash, DisputesQueryFilter] disputes_query_filter
|
20
20
|
def query(disputes_query_filter)
|
21
21
|
api_client.invoke_get(DISPUTES, sdk_authorization, disputes_query_filter)
|
22
22
|
end
|
@@ -32,7 +32,7 @@ module CheckoutSdk
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# @param [String] dispute_id
|
35
|
-
# @param [DisputeEvidence] dispute_evidence
|
35
|
+
# @param [Hash, DisputeEvidence] dispute_evidence
|
36
36
|
def put_evidence(dispute_id, dispute_evidence)
|
37
37
|
api_client.invoke_put(build_path(DISPUTES, dispute_id, EVIDENCE), sdk_authorization, dispute_evidence)
|
38
38
|
end
|
@@ -52,7 +52,7 @@ module CheckoutSdk
|
|
52
52
|
api_client.invoke_get(build_path(DISPUTES, dispute_id, SCHEME_FILES), sdk_authorization)
|
53
53
|
end
|
54
54
|
|
55
|
-
# @param [CheckoutSdk::Common::FileRequest] file_request
|
55
|
+
# @param [Hash, CheckoutSdk::Common::FileRequest] file_request
|
56
56
|
def upload_file(file_request)
|
57
57
|
api_client.submit_file(FILES, sdk_authorization, file_request)
|
58
58
|
end
|
@@ -24,7 +24,7 @@ module CheckoutSdk
|
|
24
24
|
api_client.invoke_get(EVENT_TYPES, sdk_authorization, query)
|
25
25
|
end
|
26
26
|
|
27
|
-
# @param [EventsQueryFilter] query_filter
|
27
|
+
# @param [Hash, EventsQueryFilter] query_filter
|
28
28
|
def retrieve_events(query_filter)
|
29
29
|
api_client.invoke_get(EVENTS, sdk_authorization, query_filter)
|
30
30
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Financial
|
5
|
+
# @!attribute payment_id
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute action_id
|
8
|
+
# @return [String]
|
9
|
+
# @!attribute limit
|
10
|
+
# @return [Integer]
|
11
|
+
# @!attribute pagination_token
|
12
|
+
# @return [String]
|
13
|
+
class FinancialActionsQuery
|
14
|
+
attr_accessor :payment_id,
|
15
|
+
:action_id,
|
16
|
+
:limit,
|
17
|
+
:pagination_token
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Financial
|
5
|
+
class FinancialClient < Client
|
6
|
+
FINANCIAL_ACTIONS = 'financial-actions'
|
7
|
+
private_constant :FINANCIAL_ACTIONS
|
8
|
+
|
9
|
+
# @param [ApiClient] api_client
|
10
|
+
# @param [CheckoutConfiguration] configuration
|
11
|
+
def initialize(api_client, configuration)
|
12
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
13
|
+
end
|
14
|
+
|
15
|
+
# @param [Hash, FinancialActionsQuery] query_filter
|
16
|
+
def query(query_filter)
|
17
|
+
api_client.invoke_get(FINANCIAL_ACTIONS, sdk_authorization, query_filter)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -12,7 +12,7 @@ module CheckoutSdk
|
|
12
12
|
super(api_client, configuration, CheckoutSdk::AuthorizationType::OAUTH)
|
13
13
|
end
|
14
14
|
|
15
|
-
# @param [QuoteRequest] quote_request
|
15
|
+
# @param [Hash, QuoteRequest] quote_request
|
16
16
|
def request_quote(quote_request)
|
17
17
|
api_client.invoke_post(FOREX, sdk_authorization, quote_request)
|
18
18
|
end
|
@@ -12,13 +12,13 @@ module CheckoutSdk
|
|
12
12
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
13
13
|
end
|
14
14
|
|
15
|
-
# @param [Instrument] create_instrument_request
|
15
|
+
# @param [Hash, Instrument] create_instrument_request
|
16
16
|
def create(create_instrument_request)
|
17
17
|
api_client.invoke_post(INSTRUMENTS, sdk_authorization, create_instrument_request)
|
18
18
|
end
|
19
19
|
|
20
20
|
# @param [String] instrument_id
|
21
|
-
# @param [UpdateInstrument] update_instrument_request
|
21
|
+
# @param [Hash, UpdateInstrument] update_instrument_request
|
22
22
|
def update(instrument_id, update_instrument_request)
|
23
23
|
api_client.invoke_patch(build_path(INSTRUMENTS, instrument_id),
|
24
24
|
sdk_authorization,
|
@@ -27,7 +27,7 @@ module CheckoutSdk
|
|
27
27
|
|
28
28
|
# @param [String] country {CheckoutSdk::Common::Country}
|
29
29
|
# @param [String] currency {CheckoutSdk::Common::Currency}
|
30
|
-
# @param [BankAccountFieldQuery] bank_account_field_query
|
30
|
+
# @param [Hash, BankAccountFieldQuery] bank_account_field_query
|
31
31
|
def get_bank_account_field_formatting(country, currency, bank_account_field_query)
|
32
32
|
api_client.invoke_get(build_path(VALIDATION, country, currency),
|
33
33
|
sdk_authorization(CheckoutSdk::AuthorizationType::OAUTH),
|
@@ -10,13 +10,13 @@ module CheckoutSdk
|
|
10
10
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
|
11
11
|
end
|
12
12
|
|
13
|
-
# @param [CustomerRequest] create_instrument_request
|
13
|
+
# @param [Hash, CustomerRequest] create_instrument_request
|
14
14
|
def create(create_instrument_request)
|
15
15
|
api_client.invoke_post(INSTRUMENTS, sdk_authorization, create_instrument_request)
|
16
16
|
end
|
17
17
|
|
18
18
|
# @param [String] instrument_id
|
19
|
-
# @param [UpdateInstrument] update_instrument_request
|
19
|
+
# @param [Hash, UpdateInstrument] update_instrument_request
|
20
20
|
def update(instrument_id, update_instrument_request)
|
21
21
|
api_client.invoke_patch(build_path(INSTRUMENTS, instrument_id),
|
22
22
|
sdk_authorization,
|
@@ -13,7 +13,7 @@ module CheckoutSdk
|
|
13
13
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
14
14
|
end
|
15
15
|
|
16
|
-
# @param [MetadataRequest] metadata_request
|
16
|
+
# @param [Hash, MetadataRequest] metadata_request
|
17
17
|
def request_card_metadata(metadata_request)
|
18
18
|
api_client.invoke_post(build_path(METADATA, CARD), sdk_authorization, metadata_request)
|
19
19
|
end
|
@@ -5,7 +5,7 @@ module CheckoutSdk
|
|
5
5
|
class BasePaymentsClient < Client
|
6
6
|
PAYMENTS_PATH = 'payments'
|
7
7
|
|
8
|
-
# @param [PaymentsQueryFilter] query_filter
|
8
|
+
# @param [Hash, PaymentsQueryFilter] query_filter
|
9
9
|
def get_payments_list(query_filter)
|
10
10
|
api_client.invoke_get(PAYMENTS_PATH, sdk_authorization, query_filter)
|
11
11
|
end
|
@@ -23,7 +23,7 @@ module CheckoutSdk
|
|
23
23
|
end
|
24
24
|
|
25
25
|
# @param [String] payment_id
|
26
|
-
# @param [RefundRequest] refund_request
|
26
|
+
# @param [Hash, RefundRequest] refund_request
|
27
27
|
# @param [String, nil] idempotency_key
|
28
28
|
def refund_payment(payment_id, refund_request = nil, idempotency_key = nil)
|
29
29
|
api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'refunds'),
|
@@ -33,7 +33,7 @@ module CheckoutSdk
|
|
33
33
|
end
|
34
34
|
|
35
35
|
# @param [String] payment_id
|
36
|
-
# @param [VoidRequest] void_request
|
36
|
+
# @param [Hash, VoidRequest] void_request
|
37
37
|
# @param [String, nil] idempotency_key
|
38
38
|
def void_payment(payment_id, void_request = nil, idempotency_key = nil)
|
39
39
|
api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'voids'),
|
@@ -11,7 +11,7 @@ module CheckoutSdk
|
|
11
11
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
|
12
12
|
end
|
13
13
|
|
14
|
-
# @param [HostedPaymentsSession] hosted_payments_session
|
14
|
+
# @param [Hash, HostedPaymentsSession] hosted_payments_session
|
15
15
|
def create_hosted_payments_page_session(hosted_payments_session)
|
16
16
|
api_client.invoke_post(HOSTED_PAYMENTS, sdk_authorization, hosted_payments_session)
|
17
17
|
end
|
@@ -11,7 +11,7 @@ module CheckoutSdk
|
|
11
11
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
|
12
12
|
end
|
13
13
|
|
14
|
-
# @param [PaymentLink] payment_link
|
14
|
+
# @param [Hash, PaymentLink] payment_link
|
15
15
|
def create_payment_link(payment_link)
|
16
16
|
api_client.invoke_post(PAYMENT_LINKS, sdk_authorization, payment_link)
|
17
17
|
end
|
@@ -80,6 +80,7 @@ require 'checkout_sdk/payments/source/apm/klarna_source'
|
|
80
80
|
require 'checkout_sdk/payments/source/apm/cv_connect_source'
|
81
81
|
require 'checkout_sdk/payments/source/apm/trustly_source'
|
82
82
|
require 'checkout_sdk/payments/source/apm/illicado_source'
|
83
|
+
require 'checkout_sdk/payments/source/apm/sepa_source'
|
83
84
|
|
84
85
|
# Sender
|
85
86
|
require 'checkout_sdk/payments/sender/sender'
|
@@ -9,7 +9,7 @@ module CheckoutSdk
|
|
9
9
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
10
10
|
end
|
11
11
|
|
12
|
-
# @param [PaymentRequest] payment_request
|
12
|
+
# @param [Hash, PaymentRequest] payment_request
|
13
13
|
# @param [String, nil] idempotency_key
|
14
14
|
def request_payment(payment_request, idempotency_key = nil)
|
15
15
|
api_client.invoke_post(PAYMENTS_PATH,
|
@@ -18,7 +18,7 @@ module CheckoutSdk
|
|
18
18
|
idempotency_key)
|
19
19
|
end
|
20
20
|
|
21
|
-
# @param [PayoutRequest] payout_request
|
21
|
+
# @param [Hash, PayoutRequest] payout_request
|
22
22
|
# @param [String, nil] idempotency_key
|
23
23
|
def request_payout(payout_request, idempotency_key = nil)
|
24
24
|
api_client.invoke_post(PAYMENTS_PATH,
|
@@ -28,7 +28,7 @@ module CheckoutSdk
|
|
28
28
|
end
|
29
29
|
|
30
30
|
# @param [String] payment_id
|
31
|
-
# @param [CaptureRequest] capture_request
|
31
|
+
# @param [Hash, CaptureRequest] capture_request
|
32
32
|
# @param [String, nil] idempotency_key
|
33
33
|
def capture_payment(payment_id, capture_request = nil, idempotency_key = nil)
|
34
34
|
api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'captures'),
|
@@ -38,7 +38,7 @@ module CheckoutSdk
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# @param [String] payment_id
|
41
|
-
# @param [AuthorizationRequest] authorization_request
|
41
|
+
# @param [Hash, AuthorizationRequest] authorization_request
|
42
42
|
# @param [String, nil] idempotency_key
|
43
43
|
def increment_payment_authorization(payment_id, authorization_request = nil, idempotency_key = nil)
|
44
44
|
api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'authorizations'),
|
@@ -10,7 +10,7 @@ module CheckoutSdk
|
|
10
10
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
11
11
|
end
|
12
12
|
|
13
|
-
# @param [PaymentRequest] payment_request
|
13
|
+
# @param [Hash, PaymentRequest] payment_request
|
14
14
|
# @param [String, nil] idempotency_key
|
15
15
|
def request_payment(payment_request, idempotency_key = nil)
|
16
16
|
api_client.invoke_post(PAYMENTS_PATH,
|
@@ -19,7 +19,7 @@ module CheckoutSdk
|
|
19
19
|
idempotency_key)
|
20
20
|
end
|
21
21
|
|
22
|
-
# @param [PayoutRequest] payout_request
|
22
|
+
# @param [Hash, PayoutRequest] payout_request
|
23
23
|
# @param [String, nil] idempotency_key
|
24
24
|
def request_payout(payout_request, idempotency_key = nil)
|
25
25
|
api_client.invoke_post(PAYMENTS_PATH,
|
@@ -29,7 +29,7 @@ module CheckoutSdk
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# @param [String] payment_id
|
32
|
-
# @param [CaptureRequest] capture_request
|
32
|
+
# @param [Hash, CaptureRequest] capture_request
|
33
33
|
# @param [String, nil] idempotency_key
|
34
34
|
def capture_payment(payment_id, capture_request = nil, idempotency_key = nil)
|
35
35
|
api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'captures'),
|
@@ -56,6 +56,8 @@ module CheckoutSdk
|
|
56
56
|
# @return [Array(String)]
|
57
57
|
# @!attribute merchant_callback_url
|
58
58
|
# @return [String]
|
59
|
+
# @!attribute line_of_business
|
60
|
+
# @return [String]
|
59
61
|
# @!attribute shipping_delay
|
60
62
|
# @return [Integer]
|
61
63
|
# @!attribute shipping_info
|
@@ -94,6 +96,7 @@ module CheckoutSdk
|
|
94
96
|
:purchase_country,
|
95
97
|
:custom_payment_method_ids,
|
96
98
|
:merchant_callback_url,
|
99
|
+
:line_of_business,
|
97
100
|
:shipping_delay,
|
98
101
|
:shipping_info,
|
99
102
|
:dlocal,
|
@@ -8,10 +8,13 @@ module CheckoutSdk
|
|
8
8
|
# @return [String]
|
9
9
|
# @!attribute metadata
|
10
10
|
# @return [Hash{String => Object}]
|
11
|
+
# @!attribute amount_allocations
|
12
|
+
# @return [Array(CheckoutSdk::Common::AmountAllocations)] - Not available on Previous.
|
11
13
|
class RefundRequest
|
12
14
|
attr_accessor :amount,
|
13
15
|
:reference,
|
14
|
-
:metadata
|
16
|
+
:metadata,
|
17
|
+
:amount_allocations
|
15
18
|
end
|
16
19
|
end
|
17
20
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Payments
|
5
|
+
# @!attribute country
|
6
|
+
# @return [CheckoutSdk::Common::Country]
|
7
|
+
# @!attribute account_number
|
8
|
+
# @return [String]
|
9
|
+
# @!attribute bank_code
|
10
|
+
# @return [String]
|
11
|
+
# @!attribute currency
|
12
|
+
# @return [CheckoutSdk::Common::Currency]
|
13
|
+
# @!attribute mandate_id
|
14
|
+
# @return [String]
|
15
|
+
# @!attribute date_of_signature
|
16
|
+
# @return [String]
|
17
|
+
# @!attribute account_holder
|
18
|
+
# @return [CheckoutSdk::Common::AccountHolder]
|
19
|
+
class SepaSource < PaymentSource
|
20
|
+
attr_accessor :country,
|
21
|
+
:account_number,
|
22
|
+
:bank_code,
|
23
|
+
:currency,
|
24
|
+
:mandate_id,
|
25
|
+
:date_of_signature,
|
26
|
+
:account_holder
|
27
|
+
|
28
|
+
def initialize
|
29
|
+
super CheckoutSdk::Common::PaymentSourceType::SEPA
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -16,7 +16,7 @@ module CheckoutSdk
|
|
16
16
|
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY)
|
17
17
|
end
|
18
18
|
|
19
|
-
# @param [ReconciliationQueryPaymentsFilter] payments_filter
|
19
|
+
# @param [Hash, ReconciliationQueryPaymentsFilter] payments_filter
|
20
20
|
def query_payments_report(payments_filter)
|
21
21
|
api_client.invoke_get(build_path(REPORTING, PAYMENTS), sdk_authorization, payments_filter)
|
22
22
|
end
|
@@ -26,12 +26,12 @@ module CheckoutSdk
|
|
26
26
|
api_client.invoke_get(build_path(REPORTING, PAYMENTS, payment_id), sdk_authorization)
|
27
27
|
end
|
28
28
|
|
29
|
-
# @param [CheckoutSdk::Common::DateRangeQueryFilter] data_range
|
29
|
+
# @param [Hash, CheckoutSdk::Common::DateRangeQueryFilter] data_range
|
30
30
|
def query_statements_report(data_range)
|
31
31
|
api_client.invoke_get(build_path(REPORTING, STATEMENTS), sdk_authorization, data_range)
|
32
32
|
end
|
33
33
|
|
34
|
-
# @param [CheckoutSdk::Common::DateRangeQueryFilter] data_range
|
34
|
+
# @param [Hash, CheckoutSdk::Common::DateRangeQueryFilter] data_range
|
35
35
|
def retrieve_csv_payment_report(data_range)
|
36
36
|
api_client.invoke_get(build_path(REPORTING, PAYMENTS, DOWNLOAD), sdk_authorization, data_range)
|
37
37
|
end
|
@@ -41,7 +41,7 @@ module CheckoutSdk
|
|
41
41
|
api_client.invoke_get(build_path(REPORTING, STATEMENTS, statement_id, PAYMENTS, DOWNLOAD), sdk_authorization)
|
42
42
|
end
|
43
43
|
|
44
|
-
# @param [CheckoutSdk::Common::DateRangeQueryFilter] data_range
|
44
|
+
# @param [Hash, CheckoutSdk::Common::DateRangeQueryFilter] data_range
|
45
45
|
def retrieve_csv_statements_report(data_range)
|
46
46
|
api_client.invoke_get(build_path(REPORTING, STATEMENTS, DOWNLOAD), sdk_authorization, data_range)
|
47
47
|
end
|
@@ -12,7 +12,7 @@ module CheckoutSdk
|
|
12
12
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
13
13
|
end
|
14
14
|
|
15
|
-
# @param [ReportsQuery] query_filter
|
15
|
+
# @param [Hash, ReportsQuery] query_filter
|
16
16
|
def get_all_reports(query_filter)
|
17
17
|
api_client.invoke_get(REPORTS, sdk_authorization, query_filter)
|
18
18
|
end
|
@@ -15,12 +15,12 @@ module CheckoutSdk
|
|
15
15
|
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY)
|
16
16
|
end
|
17
17
|
|
18
|
-
# @param [PreAuthenticationAssessment] pre_authentication_request
|
18
|
+
# @param [Hash, PreAuthenticationAssessment] pre_authentication_request
|
19
19
|
def pre_authentication_scan(pre_authentication_request)
|
20
20
|
api_client.invoke_post(PRE_AUTHENTICATION, sdk_authorization, pre_authentication_request)
|
21
21
|
end
|
22
22
|
|
23
|
-
# @param [PreCaptureAssessment] pre_capture_request
|
23
|
+
# @param [Hash, PreCaptureAssessment] pre_capture_request
|
24
24
|
def pre_capture_scan(pre_capture_request)
|
25
25
|
api_client.invoke_post(PRE_CAPTURE, sdk_authorization, pre_capture_request)
|
26
26
|
end
|
@@ -15,7 +15,7 @@ module CheckoutSdk
|
|
15
15
|
super api_client, configuration, CheckoutSdk::AuthorizationType::OAUTH
|
16
16
|
end
|
17
17
|
|
18
|
-
# @param [SessionRequest] session_request
|
18
|
+
# @param [Hash, SessionRequest] session_request
|
19
19
|
def request_session(session_request)
|
20
20
|
api_client.invoke_post(SESSIONS, sdk_authorization, session_request)
|
21
21
|
end
|
@@ -27,7 +27,7 @@ module CheckoutSdk
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# @param [String] session_id
|
30
|
-
# @param [ChannelData] channel_data
|
30
|
+
# @param [Hash, ChannelData] channel_data
|
31
31
|
# @param [String, nil] session_secret
|
32
32
|
def update_session(session_id, channel_data, session_secret = nil)
|
33
33
|
api_client.invoke_put(build_path(SESSIONS, session_id, COLLECT_DATA),
|
@@ -42,7 +42,7 @@ module CheckoutSdk
|
|
42
42
|
end
|
43
43
|
|
44
44
|
# @param [String] session_id
|
45
|
-
# @param [ThreeDsMethodCompletionRequest] three_ds_method_completion_request
|
45
|
+
# @param [Hash, ThreeDsMethodCompletionRequest] three_ds_method_completion_request
|
46
46
|
# @param [String, nil] session_secret
|
47
47
|
def update_3ds_method_completion(session_id, three_ds_method_completion_request, session_secret = nil)
|
48
48
|
api_client.invoke_put(build_path(SESSIONS, session_id, ISSUER_FINGERPRINT),
|
@@ -13,7 +13,7 @@ module CheckoutSdk
|
|
13
13
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
|
14
14
|
end
|
15
15
|
|
16
|
-
# @param [SepaSourceRequest] sepa_source_request
|
16
|
+
# @param [Hash, SepaSourceRequest] sepa_source_request
|
17
17
|
def create_sepa_source(sepa_source_request)
|
18
18
|
api_client.invoke_post(SOURCES, sdk_authorization, sepa_source_request)
|
19
19
|
end
|
@@ -12,7 +12,7 @@ module CheckoutSdk
|
|
12
12
|
super(api_client, configuration, CheckoutSdk::AuthorizationType::PUBLIC_KEY)
|
13
13
|
end
|
14
14
|
|
15
|
-
# @param [CardTokenRequest, WalletTokenRequest] token_request
|
15
|
+
# @param [Hash, CardTokenRequest, WalletTokenRequest] token_request
|
16
16
|
def request_token(token_request)
|
17
17
|
api_client.invoke_post(TOKENS, sdk_authorization, token_request)
|
18
18
|
end
|
@@ -12,7 +12,7 @@ module CheckoutSdk
|
|
12
12
|
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
|
13
13
|
end
|
14
14
|
|
15
|
-
# @param [CreateTransfer] create_transfer
|
15
|
+
# @param [Hash, CreateTransfer] create_transfer
|
16
16
|
# @param [String, nil] idempotency_key
|
17
17
|
def initiate_transfer_of_funds(create_transfer, idempotency_key = nil)
|
18
18
|
api_client.invoke_post(TRANSFERS, sdk_authorization, create_transfer, idempotency_key)
|
data/lib/checkout_sdk/version.rb
CHANGED
@@ -17,7 +17,7 @@ module CheckoutSdk
|
|
17
17
|
api_client.invoke_get(WEBHOOKS, sdk_authorization)
|
18
18
|
end
|
19
19
|
|
20
|
-
# @param [WebhookRequest] webhook_request
|
20
|
+
# @param [Hash, WebhookRequest] webhook_request
|
21
21
|
# @param [String,nil] idempotency_key
|
22
22
|
def register_webhook(webhook_request, idempotency_key = nil)
|
23
23
|
api_client.invoke_post(WEBHOOKS, sdk_authorization, webhook_request, idempotency_key)
|
@@ -29,13 +29,13 @@ module CheckoutSdk
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# @param [String] webhook_id
|
32
|
-
# @param [WebhookRequest] webhook_request
|
32
|
+
# @param [Hash, WebhookRequest] webhook_request
|
33
33
|
def update_webhook(webhook_id, webhook_request)
|
34
34
|
api_client.invoke_put(build_path(WEBHOOKS, webhook_id), sdk_authorization, webhook_request)
|
35
35
|
end
|
36
36
|
|
37
37
|
# @param [String] webhook_id
|
38
|
-
# @param [WebhookRequest] webhook_request
|
38
|
+
# @param [Hash, WebhookRequest] webhook_request
|
39
39
|
def patch_webhook(webhook_id, webhook_request)
|
40
40
|
api_client.invoke_patch(build_path(WEBHOOKS, webhook_id), sdk_authorization, webhook_request)
|
41
41
|
end
|
@@ -21,7 +21,7 @@ module CheckoutSdk
|
|
21
21
|
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
|
22
22
|
end
|
23
23
|
|
24
|
-
# @param [CreateWorkflow] create_workflow
|
24
|
+
# @param [Hash, CreateWorkflow] create_workflow
|
25
25
|
def create_workflow(create_workflow)
|
26
26
|
api_client.invoke_post(WORKFLOWS, sdk_authorization, create_workflow)
|
27
27
|
end
|
@@ -36,7 +36,7 @@ module CheckoutSdk
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# @param [String] workflow_id
|
39
|
-
# @param [PatchWorkflow] patch_workflow
|
39
|
+
# @param [Hash, PatchWorkflow] patch_workflow
|
40
40
|
def patch_workflow(workflow_id, patch_workflow)
|
41
41
|
api_client.invoke_patch(build_path(WORKFLOWS, workflow_id), sdk_authorization, patch_workflow)
|
42
42
|
end
|
@@ -48,7 +48,7 @@ module CheckoutSdk
|
|
48
48
|
|
49
49
|
# @param [String] workflow_id
|
50
50
|
# @param [String] action_id
|
51
|
-
# @param [WorkflowAction] workflow_action
|
51
|
+
# @param [Hash, WorkflowAction] workflow_action
|
52
52
|
def update_workflow_action(workflow_id, action_id, workflow_action)
|
53
53
|
api_client.invoke_put(build_path(WORKFLOWS, workflow_id, ACTIONS, action_id), sdk_authorization,
|
54
54
|
workflow_action)
|
@@ -56,7 +56,7 @@ module CheckoutSdk
|
|
56
56
|
|
57
57
|
# @param [String] workflow_id
|
58
58
|
# @param [String] condition_id
|
59
|
-
# @param [WorkflowCondition] workflow_condition
|
59
|
+
# @param [Hash, WorkflowCondition] workflow_condition
|
60
60
|
def update_workflow_condition(workflow_id, condition_id, workflow_condition)
|
61
61
|
api_client.invoke_put(build_path(WORKFLOWS, workflow_id, CONDITIONS, condition_id), sdk_authorization,
|
62
62
|
workflow_condition)
|
data/lib/checkout_sdk.rb
CHANGED
@@ -63,6 +63,7 @@ require 'checkout_sdk/risk/risk'
|
|
63
63
|
require 'checkout_sdk/balances/balances'
|
64
64
|
require 'checkout_sdk/transfers/transfers'
|
65
65
|
require 'checkout_sdk/metadata/metadata'
|
66
|
+
require 'checkout_sdk/financial/financial'
|
66
67
|
|
67
68
|
# Checkout modules (previous)
|
68
69
|
require 'checkout_sdk/sources/sources'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkout_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Checkout
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -217,6 +217,9 @@ files:
|
|
217
217
|
- lib/checkout_sdk/events/events.rb
|
218
218
|
- lib/checkout_sdk/events/events_client.rb
|
219
219
|
- lib/checkout_sdk/events/events_query_filter.rb
|
220
|
+
- lib/checkout_sdk/financial/financial.rb
|
221
|
+
- lib/checkout_sdk/financial/financial_actions_query.rb
|
222
|
+
- lib/checkout_sdk/financial/financial_client.rb
|
220
223
|
- lib/checkout_sdk/forex/forex.rb
|
221
224
|
- lib/checkout_sdk/forex/forex_client.rb
|
222
225
|
- lib/checkout_sdk/forex/quote_request.rb
|
@@ -365,6 +368,7 @@ files:
|
|
365
368
|
- lib/checkout_sdk/payments/source/apm/paypal_source.rb
|
366
369
|
- lib/checkout_sdk/payments/source/apm/post_finance_source.rb
|
367
370
|
- lib/checkout_sdk/payments/source/apm/qpay_source.rb
|
371
|
+
- lib/checkout_sdk/payments/source/apm/sepa_source.rb
|
368
372
|
- lib/checkout_sdk/payments/source/apm/sofort_source.rb
|
369
373
|
- lib/checkout_sdk/payments/source/apm/stcpay_source.rb
|
370
374
|
- lib/checkout_sdk/payments/source/apm/tamara_source.rb
|