checkout_sdk 1.0.0.beta.0 → 1.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/lib/checkout_sdk/api_client.rb +6 -2
- data/lib/checkout_sdk/apm/apm.rb +0 -1
- data/lib/checkout_sdk/apm/previous/klarna/credit_session_request.rb +19 -21
- data/lib/checkout_sdk/apm/previous/klarna/klarna.rb +13 -15
- data/lib/checkout_sdk/apm/previous/klarna/klarna_client.rb +43 -45
- data/lib/checkout_sdk/apm/previous/klarna/klarna_product.rb +19 -21
- data/lib/checkout_sdk/apm/previous/klarna/order_capture_request.rb +24 -26
- data/lib/checkout_sdk/apm/previous/sepa/sepa_client.rb +25 -27
- data/lib/checkout_sdk/checkout_utils.rb +13 -4
- data/lib/checkout_sdk/common/account_holder.rb +4 -1
- data/lib/checkout_sdk/common/common.rb +2 -0
- data/lib/checkout_sdk/common/marketplace_data.rb +14 -0
- data/lib/checkout_sdk/common/payment_source_type.rb +1 -0
- data/lib/checkout_sdk/common/shipping_info.rb +29 -0
- data/lib/checkout_sdk/customers/customer_request.rb +2 -2
- data/lib/checkout_sdk/disputes/disputes_client.rb +5 -0
- data/lib/checkout_sdk/disputes/disputes_query_filter.rb +3 -3
- data/lib/checkout_sdk/instruments/base_instruments_client.rb +20 -0
- data/lib/checkout_sdk/instruments/create/{instrument_request.rb → instrument.rb} +1 -1
- data/lib/checkout_sdk/instruments/create/{instrument_bank_account_request.rb → instrument_bank_account.rb} +1 -1
- data/lib/checkout_sdk/instruments/create/{instrument_token_request.rb → instrument_token.rb} +1 -1
- data/lib/checkout_sdk/instruments/instruments.rb +14 -7
- data/lib/checkout_sdk/instruments/instruments_client.rb +4 -15
- data/lib/checkout_sdk/instruments/previous/create/instrument.rb +26 -0
- data/lib/checkout_sdk/instruments/previous/instruments_client.rb +28 -0
- data/lib/checkout_sdk/instruments/previous/update/update_instrument.rb +25 -0
- data/lib/checkout_sdk/instruments/update/{update_instrument_request.rb → update_instrument.rb} +1 -1
- data/lib/checkout_sdk/instruments/update/{update_instrument_bank_account_request.rb → update_instrument_bank_account.rb} +1 -1
- data/lib/checkout_sdk/instruments/update/{update_instrument_card_request.rb → update_instrument_card.rb} +1 -1
- data/lib/checkout_sdk/instruments/update/{update_instrument_token_request.rb → update_instrument_token.rb} +1 -1
- data/lib/checkout_sdk/payments/base_payments_client.rb +41 -0
- data/lib/checkout_sdk/payments/billing_plan.rb +17 -0
- data/lib/checkout_sdk/payments/billing_plan_type.rb +14 -0
- data/lib/checkout_sdk/payments/capture_request.rb +4 -0
- data/lib/checkout_sdk/payments/destination/destination.rb +1 -1
- data/lib/checkout_sdk/payments/payment_request.rb +5 -1
- data/lib/checkout_sdk/payments/payments.rb +81 -23
- data/lib/checkout_sdk/payments/payments_client.rb +1 -36
- data/lib/checkout_sdk/payments/payout_request.rb +1 -1
- data/lib/checkout_sdk/payments/previous/capture_request.rb +19 -0
- data/lib/checkout_sdk/payments/previous/destination/card_destination.rb +38 -0
- data/lib/checkout_sdk/payments/previous/destination/destination.rb +21 -0
- data/lib/checkout_sdk/payments/previous/destination/id_destination.rb +23 -0
- data/lib/checkout_sdk/payments/previous/destination/token_destination.rb +29 -0
- data/lib/checkout_sdk/payments/previous/fund_transfer_type.rb +17 -0
- data/lib/checkout_sdk/payments/previous/payment_request.rb +73 -0
- data/lib/checkout_sdk/payments/previous/payments_client.rb +43 -0
- data/lib/checkout_sdk/payments/previous/payout_request.rb +70 -0
- data/lib/checkout_sdk/payments/previous/source/apm/alipay_source.rb +13 -0
- data/lib/checkout_sdk/payments/previous/source/apm/alma_source.rb +23 -0
- data/lib/checkout_sdk/payments/previous/source/apm/bancontact_source.rb +26 -0
- data/lib/checkout_sdk/payments/previous/source/apm/benefit_pay_source.rb +17 -0
- data/lib/checkout_sdk/payments/previous/source/apm/boleto_source.rb +26 -0
- data/lib/checkout_sdk/payments/previous/source/apm/eps_source.rb +20 -0
- data/lib/checkout_sdk/payments/previous/source/apm/fawry_source.rb +47 -0
- data/lib/checkout_sdk/payments/previous/source/apm/giropay_source.rb +32 -0
- data/lib/checkout_sdk/payments/previous/source/apm/ideal_source.rb +23 -0
- data/lib/checkout_sdk/payments/previous/source/apm/integration_type.rb +12 -0
- data/lib/checkout_sdk/payments/previous/source/apm/klarna_source.rb +56 -0
- data/lib/checkout_sdk/payments/previous/source/apm/knet_source.rb +38 -0
- data/lib/checkout_sdk/payments/previous/source/apm/multi_banco_source.rb +23 -0
- data/lib/checkout_sdk/payments/previous/source/apm/oxxo_source.rb +26 -0
- data/lib/checkout_sdk/payments/previous/source/apm/p24_source.rb +26 -0
- data/lib/checkout_sdk/payments/previous/source/apm/pago_facil_source.rb +26 -0
- data/lib/checkout_sdk/payments/previous/source/apm/paypal_source.rb +26 -0
- data/lib/checkout_sdk/payments/previous/source/apm/poli_source.rb +13 -0
- data/lib/checkout_sdk/payments/previous/source/apm/qpay_source.rb +26 -0
- data/lib/checkout_sdk/payments/previous/source/apm/rapi_pago_source.rb +26 -0
- data/lib/checkout_sdk/payments/previous/source/apm/sofort_source.rb +20 -0
- data/lib/checkout_sdk/payments/previous/source/card_source.rb +41 -0
- data/lib/checkout_sdk/payments/previous/source/customer_source.rb +17 -0
- data/lib/checkout_sdk/payments/previous/source/d_local_source.rb +41 -0
- data/lib/checkout_sdk/payments/previous/source/id_source.rb +20 -0
- data/lib/checkout_sdk/payments/previous/source/network_token_source.rb +47 -0
- data/lib/checkout_sdk/payments/previous/source/payment_source.rb +20 -0
- data/lib/checkout_sdk/payments/previous/source/token_source.rb +26 -0
- data/lib/checkout_sdk/payments/processing_settings.rb +15 -0
- data/lib/checkout_sdk/payments/sender/sender.rb +2 -2
- data/lib/checkout_sdk/payments/source/apm/after_pay_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/alipay_plus_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/alma_source.rb +15 -0
- data/lib/checkout_sdk/payments/source/apm/bancontact_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/benefit_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/eps_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/fawry_product.rb +20 -0
- data/lib/checkout_sdk/payments/source/apm/fawry_source.rb +30 -0
- data/lib/checkout_sdk/payments/source/apm/giropay_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/ideal_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/klarna_source.rb +15 -0
- data/lib/checkout_sdk/payments/source/apm/knet_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/mbway_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/multi_banco_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/p24_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/paypal_source.rb +5 -1
- data/lib/checkout_sdk/payments/source/apm/post_finance_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/qpay_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/sofort_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/stcpay_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/tamara_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/apm/we_chat_pay_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/bank_account_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/card_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/currency_account_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/id_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/network_token_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/{payment_request_source.rb → payment_source.rb} +1 -1
- data/lib/checkout_sdk/payments/source/{payout_request_source.rb → payout_source.rb} +3 -3
- data/lib/checkout_sdk/payments/source/provider_token_source.rb +1 -1
- data/lib/checkout_sdk/payments/source/token_source.rb +1 -1
- data/lib/checkout_sdk/payments/three_ds_request.rb +4 -1
- data/lib/checkout_sdk/previous/checkout_api.rb +29 -5
- data/lib/checkout_sdk/sources/mandate_type.rb +12 -0
- data/lib/checkout_sdk/sources/sepa_source_request.rb +20 -0
- data/lib/checkout_sdk/sources/source_data.rb +28 -0
- data/lib/checkout_sdk/sources/source_request.rb +30 -0
- data/lib/checkout_sdk/sources/source_type.rb +11 -0
- data/lib/checkout_sdk/sources/sources.rb +9 -0
- data/lib/checkout_sdk/sources/sources_client.rb +23 -0
- data/lib/checkout_sdk/tokens/wallet_token_request.rb +1 -1
- data/lib/checkout_sdk/version.rb +1 -1
- data/lib/checkout_sdk.rb +3 -0
- metadata +68 -12
- data/lib/checkout_sdk/apm/previous/klarna/klarna_shipping_info.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0d976eb888dbeda40a8ece1c8701d3ba7c1cec555699c5953b425c092a3d9b9
|
4
|
+
data.tar.gz: 44ae834bdb42d042f082030b87137261be0a48188d33f8b6c1864e96ea215787
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a38b94c47462ec0837b57be1ac13c4c916acf8eb2360126f9ef4b3a93667fe281ceb0945209ff51d6d72edde1ca1e4596166a75044cdeb3f5a6c5808d48042
|
7
|
+
data.tar.gz: 270e249ce92268f2346f4da01b3a79e83148ff871a8584844db05fdf60ef786fc6051c22f58d94d3d314e800760d5207d7a43b223b307c261638cb3f20bd28af
|
data/.rubocop.yml
CHANGED
@@ -128,8 +128,12 @@ module CheckoutSdk
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def parse_response(response)
|
131
|
-
|
132
|
-
JSON.parse(response.body, object_class: OpenStruct) if !response.body.nil? && response.body != ''
|
131
|
+
metadata = CheckoutUtils.map_to_http_metadata(response)
|
132
|
+
body = (JSON.parse(response.body, object_class: OpenStruct) if !response.body.nil? && response.body != '')
|
133
|
+
body = OpenStruct.new if body.nil?
|
134
|
+
body = OpenStruct.new(items: body) if body.is_a? Array
|
135
|
+
body.metadata = metadata if body.is_a? OpenStruct
|
136
|
+
body
|
133
137
|
end
|
134
138
|
end
|
135
139
|
end
|
data/lib/checkout_sdk/apm/apm.rb
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
require 'checkout_sdk/apm/previous/klarna/credit_session_request'
|
5
5
|
require 'checkout_sdk/apm/previous/klarna/klarna'
|
6
6
|
require 'checkout_sdk/apm/previous/klarna/klarna_product'
|
7
|
-
require 'checkout_sdk/apm/previous/klarna/klarna_shipping_info'
|
8
7
|
require 'checkout_sdk/apm/previous/klarna/order_capture_request'
|
9
8
|
|
10
9
|
require 'checkout_sdk/apm/previous/klarna/klarna_client'
|
@@ -3,27 +3,25 @@
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Previous
|
5
5
|
module Apm
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
:products
|
26
|
-
end
|
6
|
+
# @!attribute purchase_country
|
7
|
+
# @return [String] {CheckoutSdk::Common::Country}
|
8
|
+
# @!attribute currency
|
9
|
+
# @return [String] {CheckoutSdk::Common::Currency}
|
10
|
+
# @!attribute locale
|
11
|
+
# @return [String]
|
12
|
+
# @!attribute amount
|
13
|
+
# @return [Integer]
|
14
|
+
# @!attribute tax_amount
|
15
|
+
# @return [Integer]
|
16
|
+
# @!attribute products
|
17
|
+
# @return [Array(KlarnaProduct)]
|
18
|
+
class CreditSessionRequest
|
19
|
+
attr_accessor :purchase_country,
|
20
|
+
:currency,
|
21
|
+
:locale,
|
22
|
+
:amount,
|
23
|
+
:tax_amount,
|
24
|
+
:products
|
27
25
|
end
|
28
26
|
end
|
29
27
|
end
|
@@ -3,21 +3,19 @@
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Previous
|
5
5
|
module Apm
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
:shipping_delay
|
20
|
-
end
|
6
|
+
# @!attribute description
|
7
|
+
# @return [String]
|
8
|
+
# @!attribute products
|
9
|
+
# @return [Array(KlarnaProduct)]
|
10
|
+
# @!attribute shipping_info
|
11
|
+
# @return [CheckoutSdk::Common::ShippingInfo]
|
12
|
+
# @!attribute shipping_delay
|
13
|
+
# @return [Integer]
|
14
|
+
class Klarna
|
15
|
+
attr_accessor :description,
|
16
|
+
:products,
|
17
|
+
:shipping_info,
|
18
|
+
:shipping_delay
|
21
19
|
end
|
22
20
|
end
|
23
21
|
end
|
@@ -3,51 +3,49 @@
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Previous
|
5
5
|
module Apm
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
sandbox? ? 'klarna-external' : 'klarna'
|
50
|
-
end
|
6
|
+
class KlarnaClient < Client
|
7
|
+
CREDIT_SESSIONS = 'credit-sessions'
|
8
|
+
ORDERS = 'orders'
|
9
|
+
CAPTURES = 'captures'
|
10
|
+
VOIDS = 'voids'
|
11
|
+
private_constant :CREDIT_SESSIONS, :ORDERS, :CAPTURES, :VOIDS
|
12
|
+
|
13
|
+
# @param [ApiClient] api_client
|
14
|
+
# @param [CheckoutConfiguration] configuration
|
15
|
+
def initialize(api_client, configuration)
|
16
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param credit_session_request [CreditSessionRequest]
|
20
|
+
def create_credit_session(credit_session_request)
|
21
|
+
api_client.invoke_post(build_path(base_url, CREDIT_SESSIONS), sdk_authorization, credit_session_request)
|
22
|
+
end
|
23
|
+
|
24
|
+
# @param session_id [String]
|
25
|
+
def get_credit_session(session_id)
|
26
|
+
api_client.invoke_get(build_path(base_url, CREDIT_SESSIONS, session_id), sdk_authorization)
|
27
|
+
end
|
28
|
+
|
29
|
+
# @param payment_id [String]
|
30
|
+
# @param order_capture_request [OrderCaptureRequest]
|
31
|
+
def capture_payment(payment_id, order_capture_request)
|
32
|
+
api_client.invoke_post(build_path(base_url, ORDERS, payment_id, CAPTURES),
|
33
|
+
sdk_authorization,
|
34
|
+
order_capture_request)
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param payment_id [String]
|
38
|
+
# @param void_request [CheckoutSdk::Payments::VoidRequest]
|
39
|
+
def void_payment(payment_id, void_request)
|
40
|
+
api_client.invoke_post(build_path(base_url, ORDERS, payment_id, VOIDS),
|
41
|
+
sdk_authorization,
|
42
|
+
void_request)
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def base_url
|
48
|
+
sandbox? ? 'klarna-external' : 'klarna'
|
51
49
|
end
|
52
50
|
end
|
53
51
|
end
|
@@ -3,27 +3,25 @@
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Previous
|
5
5
|
module Apm
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
:total_tax_amount
|
26
|
-
end
|
6
|
+
# @!attribute name
|
7
|
+
# @return [String]
|
8
|
+
# @!attribute quantity
|
9
|
+
# @return [Integer]
|
10
|
+
# @!attribute unit_price
|
11
|
+
# @return [Integer]
|
12
|
+
# @!attribute tax_rate
|
13
|
+
# @return [Integer]
|
14
|
+
# @!attribute total_amount
|
15
|
+
# @return [Integer]
|
16
|
+
# @!attribute total_tax_amount
|
17
|
+
# @return [Integer]
|
18
|
+
class KlarnaProduct
|
19
|
+
attr_accessor :name,
|
20
|
+
:quantity,
|
21
|
+
:unit_price,
|
22
|
+
:tax_rate,
|
23
|
+
:total_amount,
|
24
|
+
:total_tax_amount
|
27
25
|
end
|
28
26
|
end
|
29
27
|
end
|
@@ -3,33 +3,31 @@
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Previous
|
5
5
|
module Apm
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
:shipping_delay
|
6
|
+
# @!attribute type
|
7
|
+
# @return [CheckoutSdk::Common::PaymentSourceType]
|
8
|
+
# @!attribute amount
|
9
|
+
# @return [Integer]
|
10
|
+
# @!attribute reference
|
11
|
+
# @return [String]
|
12
|
+
# @!attribute metadata
|
13
|
+
# @return [Hash(String=>Object)]
|
14
|
+
# @!attribute klarna
|
15
|
+
# @return [Klarna]
|
16
|
+
# @!attribute shipping_info
|
17
|
+
# @return [CheckoutSdk::Common::ShippingInfo]
|
18
|
+
# @!attribute shipping_delay
|
19
|
+
# @return [Integer]
|
20
|
+
class OrderCaptureRequest
|
21
|
+
attr_reader :type
|
22
|
+
attr_accessor :amount,
|
23
|
+
:reference,
|
24
|
+
:metadata,
|
25
|
+
:klarna,
|
26
|
+
:shipping_info,
|
27
|
+
:shipping_delay
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
end
|
29
|
+
def initialize
|
30
|
+
@type = CheckoutSdk::Common::PaymentSourceType::KLARNA
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
@@ -3,38 +3,36 @@
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Previous
|
5
5
|
module Apm
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
private_constant :SEPA_MANDATES, :PPRO, :CANCEL
|
6
|
+
class SepaClient < Client
|
7
|
+
SEPA_MANDATES = 'sepa/mandates'
|
8
|
+
PPRO = 'ppro'
|
9
|
+
CANCEL = 'cancel'
|
10
|
+
private_constant :SEPA_MANDATES, :PPRO, :CANCEL
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
# @param [ApiClient] api_client
|
13
|
+
# @param [CheckoutConfiguration] configuration
|
14
|
+
def initialize(api_client, configuration)
|
15
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
|
16
|
+
end
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
# @param mandate_id [String]
|
19
|
+
def get_mandate(mandate_id)
|
20
|
+
api_client.invoke_get(build_path(SEPA_MANDATES, mandate_id), sdk_authorization)
|
21
|
+
end
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
# @param mandate_id [String]
|
24
|
+
def cancel_mandate(mandate_id)
|
25
|
+
api_client.invoke_post(build_path(SEPA_MANDATES, mandate_id, CANCEL), sdk_authorization)
|
26
|
+
end
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
# @param mandate_id [String]
|
29
|
+
def get_mandate_via_ppro(mandate_id)
|
30
|
+
api_client.invoke_get(build_path(PPRO, SEPA_MANDATES, mandate_id), sdk_authorization)
|
31
|
+
end
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
33
|
+
# @param mandate_id [String]
|
34
|
+
def cancel_mandate_via_ppro(mandate_id)
|
35
|
+
api_client.invoke_post(build_path(PPRO, SEPA_MANDATES, mandate_id, CANCEL), sdk_authorization)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
@@ -5,10 +5,19 @@ module CheckoutSdk
|
|
5
5
|
# @return [CheckoutSdk::HttpMetadata]
|
6
6
|
def self.map_to_http_metadata(response)
|
7
7
|
metadata = CheckoutSdk::HttpMetadata.new
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
return metadata if response.nil?
|
9
|
+
|
10
|
+
if response.is_a?(Hash)
|
11
|
+
metadata.headers = response[:headers]
|
12
|
+
metadata.status_code = response[:status]
|
13
|
+
metadata.body = response[:body]
|
14
|
+
end
|
15
|
+
|
16
|
+
if response.class.name.start_with? Faraday::Response.name
|
17
|
+
metadata.headers = response.headers
|
18
|
+
metadata.status_code = response.status
|
19
|
+
metadata.body = response.body
|
20
|
+
end
|
12
21
|
metadata
|
13
22
|
end
|
14
23
|
end
|
@@ -26,6 +26,8 @@ module CheckoutSdk
|
|
26
26
|
# @return [AccountHolderIdentification]
|
27
27
|
# @!attribute email
|
28
28
|
# @return [String]
|
29
|
+
# @!attribute gender
|
30
|
+
# @return [String]
|
29
31
|
class AccountHolder
|
30
32
|
attr_accessor :type,
|
31
33
|
:first_name,
|
@@ -38,7 +40,8 @@ module CheckoutSdk
|
|
38
40
|
:billing_address,
|
39
41
|
:phone,
|
40
42
|
:identification,
|
41
|
-
:email
|
43
|
+
:email,
|
44
|
+
:gender
|
42
45
|
end
|
43
46
|
end
|
44
47
|
end
|
@@ -20,3 +20,5 @@ require 'checkout_sdk/common/file_request'
|
|
20
20
|
require 'checkout_sdk/common/file_purpose'
|
21
21
|
require 'checkout_sdk/common/challenge_indicator'
|
22
22
|
require 'checkout_sdk/common/update_customer_request'
|
23
|
+
require 'checkout_sdk/common/marketplace_data'
|
24
|
+
require 'checkout_sdk/common/shipping_info'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Common
|
5
|
+
# @!attribute sub_entity_id
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute sub_entities
|
8
|
+
# @return [Array(AmountAllocations)]
|
9
|
+
class MarketplaceData
|
10
|
+
attr_accessor :sub_entity_id,
|
11
|
+
:sub_entities
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Common
|
5
|
+
# @!attribute shipping_company
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute shipping_method
|
8
|
+
# @return [String]
|
9
|
+
# @!attribute tracking_number
|
10
|
+
# @return [String]
|
11
|
+
# @!attribute tracking_uri
|
12
|
+
# @return [String]
|
13
|
+
# @!attribute return_shipping_company
|
14
|
+
# @return [String]
|
15
|
+
# @!attribute return_tracking_number
|
16
|
+
# @return [String]
|
17
|
+
# @!attribute return_tracking_uri
|
18
|
+
# @return [String]
|
19
|
+
class ShippingInfo
|
20
|
+
attr_accessor :shipping_company,
|
21
|
+
:shipping_method,
|
22
|
+
:tracking_number,
|
23
|
+
:tracking_uri,
|
24
|
+
:return_shipping_company,
|
25
|
+
:return_tracking_number,
|
26
|
+
:return_tracking_uri
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -11,9 +11,9 @@ module CheckoutSdk
|
|
11
11
|
# @!attribute metadata
|
12
12
|
# @return [Hash{String => Object}]
|
13
13
|
# @!attribute default
|
14
|
-
# @return [String]
|
14
|
+
# @return [String] - Not available on previous
|
15
15
|
# @!attribute instruments
|
16
|
-
# @return [Array(String)]
|
16
|
+
# @return [Array(String)] - Not available on previous
|
17
17
|
class CustomerRequest
|
18
18
|
attr_accessor :email,
|
19
19
|
:name,
|
@@ -50,6 +50,11 @@ module CheckoutSdk
|
|
50
50
|
def upload_file(file_request)
|
51
51
|
api_client.submit_file(FILES, sdk_authorization, file_request)
|
52
52
|
end
|
53
|
+
|
54
|
+
# @param [String] file_id
|
55
|
+
def get_file_details(file_id)
|
56
|
+
api_client.invoke_get(build_path(FILES, file_id), sdk_authorization)
|
57
|
+
end
|
53
58
|
end
|
54
59
|
end
|
55
60
|
end
|
@@ -23,11 +23,11 @@ module CheckoutSdk
|
|
23
23
|
# @!attribute this_channel_only
|
24
24
|
# @return [TrueClass, FalseClass]
|
25
25
|
# @!attribute entity_ids
|
26
|
-
# @return [String]
|
26
|
+
# @return [String] - Not available on Previous.
|
27
27
|
# @!attribute sub_entity_ids
|
28
|
-
# @return [String]
|
28
|
+
# @return [String] - Not available on Previous.
|
29
29
|
# @!attribute payment_mcc
|
30
|
-
# @return [String]
|
30
|
+
# @return [String] - Not available on Previous.
|
31
31
|
class DisputesQueryFilter
|
32
32
|
attr_accessor :limit,
|
33
33
|
:skip,
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
class BaseInstrumentsClient < Client
|
6
|
+
INSTRUMENTS = 'instruments'
|
7
|
+
private_constant :INSTRUMENTS
|
8
|
+
|
9
|
+
# @param [String] instrument_id
|
10
|
+
def get(instrument_id)
|
11
|
+
api_client.invoke_get(build_path(INSTRUMENTS, instrument_id), sdk_authorization)
|
12
|
+
end
|
13
|
+
|
14
|
+
# @param [String] instrument_id
|
15
|
+
def delete(instrument_id)
|
16
|
+
api_client.invoke_delete(build_path(INSTRUMENTS, instrument_id), sdk_authorization)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -28,7 +28,7 @@ module CheckoutSdk
|
|
28
28
|
# @return [CheckoutSdk::Common::BankDetails]
|
29
29
|
# @!attribute customer
|
30
30
|
# @return [CheckoutSdk::Common::CustomerRequest]
|
31
|
-
class
|
31
|
+
class InstrumentBankAccount < Instrument
|
32
32
|
attr_accessor :account_type,
|
33
33
|
:account_number,
|
34
34
|
:bank_code,
|
data/lib/checkout_sdk/instruments/create/{instrument_token_request.rb → instrument_token.rb}
RENAMED
@@ -8,7 +8,7 @@ module CheckoutSdk
|
|
8
8
|
# @return [CheckoutSdk::Common::AccountHolder]
|
9
9
|
# @!attribute customer
|
10
10
|
# @return [CheckoutSdk::Common::CustomerRequest]
|
11
|
-
class
|
11
|
+
class InstrumentToken < Instrument
|
12
12
|
attr_accessor :token,
|
13
13
|
:account_holder,
|
14
14
|
:customer
|
@@ -1,15 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Update
|
4
|
-
require 'checkout_sdk/instruments/update/
|
5
|
-
require 'checkout_sdk/instruments/update/
|
6
|
-
require 'checkout_sdk/instruments/update/
|
7
|
-
require 'checkout_sdk/instruments/update/
|
4
|
+
require 'checkout_sdk/instruments/update/update_instrument'
|
5
|
+
require 'checkout_sdk/instruments/update/update_instrument_card'
|
6
|
+
require 'checkout_sdk/instruments/update/update_instrument_bank_account'
|
7
|
+
require 'checkout_sdk/instruments/update/update_instrument_token'
|
8
8
|
# Get
|
9
9
|
require 'checkout_sdk/instruments/get/payment_network'
|
10
10
|
require 'checkout_sdk/instruments/get/bank_account_field_query'
|
11
11
|
# Create
|
12
|
-
require 'checkout_sdk/instruments/create/
|
13
|
-
require 'checkout_sdk/instruments/create/
|
14
|
-
require 'checkout_sdk/instruments/create/
|
12
|
+
require 'checkout_sdk/instruments/create/instrument'
|
13
|
+
require 'checkout_sdk/instruments/create/instrument_token'
|
14
|
+
require 'checkout_sdk/instruments/create/instrument_bank_account'
|
15
|
+
# Client
|
16
|
+
require 'checkout_sdk/instruments/base_instruments_client'
|
15
17
|
require 'checkout_sdk/instruments/instruments_client'
|
18
|
+
|
19
|
+
# Previous
|
20
|
+
require 'checkout_sdk/instruments/previous/create/instrument'
|
21
|
+
require 'checkout_sdk/instruments/previous/update/update_instrument'
|
22
|
+
require 'checkout_sdk/instruments/previous/instruments_client'
|