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
@@ -2,10 +2,9 @@
|
|
2
2
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Instruments
|
5
|
-
class InstrumentsClient <
|
6
|
-
INSTRUMENTS = 'instruments'
|
5
|
+
class InstrumentsClient < BaseInstrumentsClient
|
7
6
|
VALIDATION = 'validation/bank-accounts'
|
8
|
-
private_constant :
|
7
|
+
private_constant :VALIDATION
|
9
8
|
|
10
9
|
# @param [ApiClient] api_client
|
11
10
|
# @param [CheckoutConfiguration] configuration
|
@@ -13,29 +12,19 @@ module CheckoutSdk
|
|
13
12
|
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
14
13
|
end
|
15
14
|
|
16
|
-
# @param [
|
15
|
+
# @param [Instrument] create_instrument_request
|
17
16
|
def create(create_instrument_request)
|
18
17
|
api_client.invoke_post(INSTRUMENTS, sdk_authorization, create_instrument_request)
|
19
18
|
end
|
20
19
|
|
21
20
|
# @param [String] instrument_id
|
22
|
-
|
23
|
-
api_client.invoke_get(build_path(INSTRUMENTS, instrument_id), sdk_authorization)
|
24
|
-
end
|
25
|
-
|
26
|
-
# @param [String] instrument_id
|
27
|
-
# @param [UpdateInstrumentRequest] update_instrument_request
|
21
|
+
# @param [UpdateInstrument] update_instrument_request
|
28
22
|
def update(instrument_id, update_instrument_request)
|
29
23
|
api_client.invoke_patch(build_path(INSTRUMENTS, instrument_id),
|
30
24
|
sdk_authorization,
|
31
25
|
update_instrument_request)
|
32
26
|
end
|
33
27
|
|
34
|
-
# @param [String] instrument_id
|
35
|
-
def delete(instrument_id)
|
36
|
-
api_client.invoke_delete(build_path(INSTRUMENTS, instrument_id), sdk_authorization)
|
37
|
-
end
|
38
|
-
|
39
28
|
# @param [String] country {CheckoutSdk::Common::Country}
|
40
29
|
# @param [String] currency {CheckoutSdk::Common::Currency}
|
41
30
|
# @param [BankAccountFieldQuery] bank_account_field_query
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Previous
|
5
|
+
module Instruments
|
6
|
+
# @!attribute type
|
7
|
+
# @return [String] {CheckoutSdk::Common::InstrumentType}
|
8
|
+
# @!attribute token
|
9
|
+
# @return [String]
|
10
|
+
# @!attribute account_holder
|
11
|
+
# @return [CheckoutSdk::Common::AccountHolder]
|
12
|
+
# @!attribute customer
|
13
|
+
# @return [CheckoutSdk::Common::CustomerRequest]
|
14
|
+
class Instrument
|
15
|
+
attr_accessor :type,
|
16
|
+
:token,
|
17
|
+
:account_holder,
|
18
|
+
:customer
|
19
|
+
|
20
|
+
def initialize
|
21
|
+
@type = CheckoutSdk::Common::InstrumentType::TOKEN
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Previous
|
5
|
+
module Instruments
|
6
|
+
class InstrumentsClient < CheckoutSdk::Instruments::BaseInstrumentsClient
|
7
|
+
# @param [ApiClient] api_client
|
8
|
+
# @param [CheckoutConfiguration] configuration
|
9
|
+
def initialize(api_client, configuration)
|
10
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
|
11
|
+
end
|
12
|
+
|
13
|
+
# @param [CustomerRequest] create_instrument_request
|
14
|
+
def create(create_instrument_request)
|
15
|
+
api_client.invoke_post(INSTRUMENTS, sdk_authorization, create_instrument_request)
|
16
|
+
end
|
17
|
+
|
18
|
+
# @param [String] instrument_id
|
19
|
+
# @param [UpdateInstrument] update_instrument_request
|
20
|
+
def update(instrument_id, update_instrument_request)
|
21
|
+
api_client.invoke_patch(build_path(INSTRUMENTS, instrument_id),
|
22
|
+
sdk_authorization,
|
23
|
+
update_instrument_request)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Previous
|
5
|
+
module Instruments
|
6
|
+
# @!attribute expiry_month
|
7
|
+
# @return [Integer]
|
8
|
+
# @!attribute expiry_month
|
9
|
+
# @return [Integer]
|
10
|
+
# @!attribute name
|
11
|
+
# @return [String]
|
12
|
+
# @!attribute account_holder
|
13
|
+
# @return [CheckoutSdk::Common::AccountHolder]
|
14
|
+
# @!attribute customer
|
15
|
+
# @return [CheckoutSdk::Common::CustomerRequest]
|
16
|
+
class UpdateInstrument
|
17
|
+
attr_accessor :expiry_month,
|
18
|
+
:expiry_year,
|
19
|
+
:name,
|
20
|
+
:account_holder,
|
21
|
+
:customer
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
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 UpdateInstrumentBankAccount < UpdateInstrument
|
32
32
|
attr_accessor :account_type,
|
33
33
|
:account_number,
|
34
34
|
:bank_code,
|
@@ -12,7 +12,7 @@ module CheckoutSdk
|
|
12
12
|
# @return [CheckoutSdk::Common::AccountHolder]
|
13
13
|
# @!attribute customer
|
14
14
|
# @return [CheckoutSdk::Common::UpdateCustomerRequest]
|
15
|
-
class
|
15
|
+
class UpdateInstrumentCard < UpdateInstrument
|
16
16
|
attr_accessor :expiry_month,
|
17
17
|
:expiry_year,
|
18
18
|
:name,
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Payments
|
5
|
+
class BasePaymentsClient < Client
|
6
|
+
PAYMENTS_PATH = 'payments'
|
7
|
+
|
8
|
+
# @param [String] payment_id
|
9
|
+
def get_payment_details(payment_id)
|
10
|
+
api_client.invoke_get(build_path(PAYMENTS_PATH, payment_id),
|
11
|
+
sdk_authorization)
|
12
|
+
end
|
13
|
+
|
14
|
+
# @param [String] payment_id
|
15
|
+
def get_payment_actions(payment_id)
|
16
|
+
api_client.invoke_get(build_path(PAYMENTS_PATH, payment_id, 'actions'),
|
17
|
+
sdk_authorization)
|
18
|
+
end
|
19
|
+
|
20
|
+
# @param [String] payment_id
|
21
|
+
# @param [RefundRequest] refund_request
|
22
|
+
# @param [String, nil] idempotency_key
|
23
|
+
def refund_payment(payment_id, refund_request = nil, idempotency_key = nil)
|
24
|
+
api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'refunds'),
|
25
|
+
sdk_authorization,
|
26
|
+
refund_request,
|
27
|
+
idempotency_key)
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param [String] payment_id
|
31
|
+
# @param [VoidRequest] void_request
|
32
|
+
# @param [String, nil] idempotency_key
|
33
|
+
def void_payment(payment_id, void_request = nil, idempotency_key = nil)
|
34
|
+
api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'voids'),
|
35
|
+
sdk_authorization,
|
36
|
+
void_request,
|
37
|
+
idempotency_key)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Payments
|
5
|
+
# @!attribute type
|
6
|
+
# @return [String] {BillingPlanType}
|
7
|
+
# @!attribute skip_shipping_address
|
8
|
+
# @return [TrueClass, FalseClass]
|
9
|
+
# @!attribute immutable_shipping_address
|
10
|
+
# @return [TrueClass, FalseClass]
|
11
|
+
class BillingPlan
|
12
|
+
attr_accessor :type,
|
13
|
+
:skip_shipping_address,
|
14
|
+
:immutable_shipping_address
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Payments
|
5
|
+
module BillingPlanType
|
6
|
+
MERCHANT_INITIATED_BILLING = 'MERCHANT_INITIATED_BILLING'
|
7
|
+
MERCHANT_INITIATED_BILLING_SINGLE_AGREEMENT = 'MERCHANT_INITIATED_BILLING_SINGLE_AGREEMENT'
|
8
|
+
CHANNEL_INITIATED_BILLING = 'CHANNEL_INITIATED_BILLING'
|
9
|
+
CHANNEL_INITIATED_BILLING_SINGLE_AGREEMENT = 'CHANNEL_INITIATED_BILLING_SINGLE_AGREEMENT'
|
10
|
+
RECURRING_PAYMENTS = 'RECURRING_PAYMENTS'
|
11
|
+
PRE_APPROVED_PAYMENTS = 'PRE_APPROVED_PAYMENTS'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -18,6 +18,9 @@ module CheckoutSdk
|
|
18
18
|
# @return [ShippingDetails]
|
19
19
|
# @!attribute items
|
20
20
|
# @return [Array(Product)]
|
21
|
+
# @!attribute marketplace
|
22
|
+
# @deprecated Please use {#amount_allocations} instead
|
23
|
+
# @return [Array(CheckoutSdk::Common::MarketplaceData)]
|
21
24
|
# @!attribute amount_allocations
|
22
25
|
# @return [Array(CheckoutSdk::Common::AmountAllocations)]
|
23
26
|
# @!attribute processing
|
@@ -33,6 +36,7 @@ module CheckoutSdk
|
|
33
36
|
:billing_descriptor,
|
34
37
|
:shipping,
|
35
38
|
:items,
|
39
|
+
:marketplace,
|
36
40
|
:amount_allocations,
|
37
41
|
:processing,
|
38
42
|
:metadata
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Payments
|
5
5
|
# @!attribute source
|
6
|
-
# @return [
|
6
|
+
# @return [PaymentSource]
|
7
7
|
# @!attribute amount
|
8
8
|
# @return [Integer]
|
9
9
|
# @!attribute currency
|
@@ -46,6 +46,9 @@ module CheckoutSdk
|
|
46
46
|
# @return [Sender]
|
47
47
|
# @!attribute recipient
|
48
48
|
# @return [PaymentRecipient]
|
49
|
+
# @!attribute marketplace
|
50
|
+
# @deprecated Please use {#amount_allocations} instead
|
51
|
+
# @return [Array(CheckoutSdk::Common::MarketplaceData)]
|
49
52
|
# @!attribute amount_allocations
|
50
53
|
# @return [Array(CheckoutSdk::Common::AmountAllocations)]
|
51
54
|
# @!attribute processing
|
@@ -77,6 +80,7 @@ module CheckoutSdk
|
|
77
80
|
:payment_ip,
|
78
81
|
:sender,
|
79
82
|
:recipient,
|
83
|
+
:marketplace,
|
80
84
|
:amount_allocations,
|
81
85
|
:processing,
|
82
86
|
:metadata,
|
@@ -16,8 +16,33 @@ require 'checkout_sdk/payments/os_type'
|
|
16
16
|
require 'checkout_sdk/payments/payment_instruction'
|
17
17
|
require 'checkout_sdk/payments/refund_request'
|
18
18
|
require 'checkout_sdk/payments/product'
|
19
|
-
require 'checkout_sdk/payments/
|
20
|
-
require 'checkout_sdk/payments/
|
19
|
+
require 'checkout_sdk/payments/capture_type'
|
20
|
+
require 'checkout_sdk/payments/payment_type'
|
21
|
+
require 'checkout_sdk/payments/merchant_initiated_reason'
|
22
|
+
require 'checkout_sdk/payments/preferred_schema'
|
23
|
+
require 'checkout_sdk/payments/airline_data'
|
24
|
+
require 'checkout_sdk/payments/risk_request'
|
25
|
+
require 'checkout_sdk/payments/billing_descriptor'
|
26
|
+
require 'checkout_sdk/payments/payment_recipient'
|
27
|
+
require 'checkout_sdk/payments/d_local_installments'
|
28
|
+
require 'checkout_sdk/payments/shipping_preference'
|
29
|
+
require 'checkout_sdk/payments/exemption'
|
30
|
+
require 'checkout_sdk/payments/three_ds_flow_type'
|
31
|
+
require 'checkout_sdk/payments/void_request'
|
32
|
+
require 'checkout_sdk/payments/payment_request'
|
33
|
+
require 'checkout_sdk/payments/passenger_name'
|
34
|
+
require 'checkout_sdk/payments/processing_settings'
|
35
|
+
require 'checkout_sdk/payments/charge_bearer'
|
36
|
+
require 'checkout_sdk/payments/instruction_scheme'
|
37
|
+
require 'checkout_sdk/payments/network_token_type'
|
38
|
+
require 'checkout_sdk/payments/terminal_type'
|
39
|
+
require 'checkout_sdk/payments/flight_leg_details'
|
40
|
+
require 'checkout_sdk/payments/billing_plan'
|
41
|
+
require 'checkout_sdk/payments/billing_plan_type'
|
42
|
+
|
43
|
+
# Source
|
44
|
+
require 'checkout_sdk/payments/source/payment_source'
|
45
|
+
require 'checkout_sdk/payments/source/payout_source'
|
21
46
|
require 'checkout_sdk/payments/source/network_token_source'
|
22
47
|
require 'checkout_sdk/payments/source/token_source'
|
23
48
|
require 'checkout_sdk/payments/source/provider_token_source'
|
@@ -44,6 +69,12 @@ require 'checkout_sdk/payments/source/apm/sofort_source'
|
|
44
69
|
require 'checkout_sdk/payments/source/apm/stcpay_source'
|
45
70
|
require 'checkout_sdk/payments/source/apm/tamara_source'
|
46
71
|
require 'checkout_sdk/payments/source/apm/we_chat_pay_source'
|
72
|
+
require 'checkout_sdk/payments/source/apm/alma_source'
|
73
|
+
require 'checkout_sdk/payments/source/apm/fawry_product'
|
74
|
+
require 'checkout_sdk/payments/source/apm/fawry_source'
|
75
|
+
require 'checkout_sdk/payments/source/apm/klarna_source'
|
76
|
+
|
77
|
+
# Sender
|
47
78
|
require 'checkout_sdk/payments/sender/sender'
|
48
79
|
require 'checkout_sdk/payments/sender/sender_type'
|
49
80
|
require 'checkout_sdk/payments/sender/source_of_funds'
|
@@ -52,31 +83,58 @@ require 'checkout_sdk/payments/sender/individual_sender'
|
|
52
83
|
require 'checkout_sdk/payments/sender/corporate_sender'
|
53
84
|
require 'checkout_sdk/payments/sender/instrument_sender'
|
54
85
|
require 'checkout_sdk/payments/sender/ticket'
|
55
|
-
|
56
|
-
|
86
|
+
|
87
|
+
# Destination
|
57
88
|
require 'checkout_sdk/payments/destination/destination'
|
58
89
|
require 'checkout_sdk/payments/destination/token_destination'
|
59
90
|
require 'checkout_sdk/payments/destination/bank_account_destination'
|
60
91
|
require 'checkout_sdk/payments/destination/card_destination'
|
61
92
|
require 'checkout_sdk/payments/destination/destination_type'
|
62
93
|
require 'checkout_sdk/payments/destination/id_destination'
|
63
|
-
|
64
|
-
|
65
|
-
require 'checkout_sdk/payments/
|
66
|
-
require 'checkout_sdk/payments/
|
94
|
+
|
95
|
+
## Previous
|
96
|
+
require 'checkout_sdk/payments/previous/fund_transfer_type'
|
97
|
+
require 'checkout_sdk/payments/previous/capture_request'
|
98
|
+
require 'checkout_sdk/payments/previous/payout_request'
|
99
|
+
require 'checkout_sdk/payments/previous/payment_request'
|
100
|
+
|
101
|
+
# Source
|
102
|
+
require 'checkout_sdk/payments/previous/source/payment_source'
|
103
|
+
require 'checkout_sdk/payments/previous/source/network_token_source'
|
104
|
+
require 'checkout_sdk/payments/previous/source/customer_source'
|
105
|
+
require 'checkout_sdk/payments/previous/source/token_source'
|
106
|
+
require 'checkout_sdk/payments/previous/source/id_source'
|
107
|
+
require 'checkout_sdk/payments/previous/source/card_source'
|
108
|
+
require 'checkout_sdk/payments/previous/source/d_local_source'
|
109
|
+
require 'checkout_sdk/payments/previous/source/apm/alipay_source'
|
110
|
+
require 'checkout_sdk/payments/previous/source/apm/alma_source'
|
111
|
+
require 'checkout_sdk/payments/previous/source/apm/bancontact_source'
|
112
|
+
require 'checkout_sdk/payments/previous/source/apm/benefit_pay_source'
|
113
|
+
require 'checkout_sdk/payments/previous/source/apm/boleto_source'
|
114
|
+
require 'checkout_sdk/payments/previous/source/apm/eps_source'
|
115
|
+
require 'checkout_sdk/payments/previous/source/apm/fawry_source'
|
116
|
+
require 'checkout_sdk/payments/previous/source/apm/giropay_source'
|
117
|
+
require 'checkout_sdk/payments/previous/source/apm/ideal_source'
|
118
|
+
require 'checkout_sdk/payments/previous/source/apm/integration_type'
|
119
|
+
require 'checkout_sdk/payments/previous/source/apm/klarna_source'
|
120
|
+
require 'checkout_sdk/payments/previous/source/apm/knet_source'
|
121
|
+
require 'checkout_sdk/payments/previous/source/apm/multi_banco_source'
|
122
|
+
require 'checkout_sdk/payments/previous/source/apm/oxxo_source'
|
123
|
+
require 'checkout_sdk/payments/previous/source/apm/p24_source'
|
124
|
+
require 'checkout_sdk/payments/previous/source/apm/pago_facil_source'
|
125
|
+
require 'checkout_sdk/payments/previous/source/apm/paypal_source'
|
126
|
+
require 'checkout_sdk/payments/previous/source/apm/poli_source'
|
127
|
+
require 'checkout_sdk/payments/previous/source/apm/qpay_source'
|
128
|
+
require 'checkout_sdk/payments/previous/source/apm/rapi_pago_source'
|
129
|
+
require 'checkout_sdk/payments/previous/source/apm/sofort_source'
|
130
|
+
|
131
|
+
# Destination
|
132
|
+
require 'checkout_sdk/payments/previous/destination/destination'
|
133
|
+
require 'checkout_sdk/payments/previous/destination/token_destination'
|
134
|
+
require 'checkout_sdk/payments/previous/destination/card_destination'
|
135
|
+
require 'checkout_sdk/payments/previous/destination/id_destination'
|
136
|
+
|
137
|
+
# Client
|
138
|
+
require 'checkout_sdk/payments/base_payments_client'
|
67
139
|
require 'checkout_sdk/payments/payments_client'
|
68
|
-
require 'checkout_sdk/payments/
|
69
|
-
require 'checkout_sdk/payments/payment_recipient'
|
70
|
-
require 'checkout_sdk/payments/d_local_installments'
|
71
|
-
require 'checkout_sdk/payments/shipping_preference'
|
72
|
-
require 'checkout_sdk/payments/exemption'
|
73
|
-
require 'checkout_sdk/payments/three_ds_flow_type'
|
74
|
-
require 'checkout_sdk/payments/void_request'
|
75
|
-
require 'checkout_sdk/payments/payment_request'
|
76
|
-
require 'checkout_sdk/payments/passenger_name'
|
77
|
-
require 'checkout_sdk/payments/processing_settings'
|
78
|
-
require 'checkout_sdk/payments/charge_bearer'
|
79
|
-
require 'checkout_sdk/payments/instruction_scheme'
|
80
|
-
require 'checkout_sdk/payments/network_token_type'
|
81
|
-
require 'checkout_sdk/payments/terminal_type'
|
82
|
-
require 'checkout_sdk/payments/flight_leg_details'
|
140
|
+
require 'checkout_sdk/payments/previous/payments_client'
|
@@ -2,10 +2,7 @@
|
|
2
2
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Payments
|
5
|
-
class PaymentsClient <
|
6
|
-
PAYMENTS_PATH = 'payments'
|
7
|
-
private_constant :PAYMENTS_PATH
|
8
|
-
|
5
|
+
class PaymentsClient < BasePaymentsClient
|
9
6
|
# @param [ApiClient] api_client
|
10
7
|
# @param [CheckoutConfiguration] configuration
|
11
8
|
def initialize(api_client, configuration)
|
@@ -30,18 +27,6 @@ module CheckoutSdk
|
|
30
27
|
idempotency_key)
|
31
28
|
end
|
32
29
|
|
33
|
-
# @param [String] payment_id
|
34
|
-
def get_payment_details(payment_id)
|
35
|
-
api_client.invoke_get(build_path(PAYMENTS_PATH, payment_id),
|
36
|
-
sdk_authorization)
|
37
|
-
end
|
38
|
-
|
39
|
-
# @param [String] payment_id
|
40
|
-
def get_payment_actions(payment_id)
|
41
|
-
api_client.invoke_get(build_path(PAYMENTS_PATH, payment_id, 'actions'),
|
42
|
-
sdk_authorization)
|
43
|
-
end
|
44
|
-
|
45
30
|
# @param [String] payment_id
|
46
31
|
# @param [CaptureRequest] capture_request
|
47
32
|
# @param [String, nil] idempotency_key
|
@@ -52,26 +37,6 @@ module CheckoutSdk
|
|
52
37
|
idempotency_key)
|
53
38
|
end
|
54
39
|
|
55
|
-
# @param [String] payment_id
|
56
|
-
# @param [RefundRequest] refund_request
|
57
|
-
# @param [String, nil] idempotency_key
|
58
|
-
def refund_payment(payment_id, refund_request = nil, idempotency_key = nil)
|
59
|
-
api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'refunds'),
|
60
|
-
sdk_authorization,
|
61
|
-
refund_request,
|
62
|
-
idempotency_key)
|
63
|
-
end
|
64
|
-
|
65
|
-
# @param [String] payment_id
|
66
|
-
# @param [VoidRequest] void_request
|
67
|
-
# @param [String, nil] idempotency_key
|
68
|
-
def void_payment(payment_id, void_request = nil, idempotency_key = nil)
|
69
|
-
api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'voids'),
|
70
|
-
sdk_authorization,
|
71
|
-
void_request,
|
72
|
-
idempotency_key)
|
73
|
-
end
|
74
|
-
|
75
40
|
# @param [String] payment_id
|
76
41
|
# @param [AuthorizationRequest] authorization_request
|
77
42
|
# @param [String, nil] idempotency_key
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Previous
|
5
|
+
module Payments
|
6
|
+
# @!attribute amount
|
7
|
+
# @return [Integer]
|
8
|
+
# @!attribute reference
|
9
|
+
# @return [String]
|
10
|
+
# @!attribute metadata
|
11
|
+
# @return [Hash{String => Object}]
|
12
|
+
class CaptureRequest
|
13
|
+
attr_accessor :amount,
|
14
|
+
:reference,
|
15
|
+
:metadata
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Previous
|
5
|
+
module Payments
|
6
|
+
# @!attribute number
|
7
|
+
# @return [String]
|
8
|
+
# @!attribute expiry_month
|
9
|
+
# @return [Integer]
|
10
|
+
# @!attribute expiry_year
|
11
|
+
# @return [Integer]
|
12
|
+
# @!attribute first_name
|
13
|
+
# @return [String]
|
14
|
+
# @!attribute last_name
|
15
|
+
# @return [String]
|
16
|
+
# @!attribute name
|
17
|
+
# @return [String]
|
18
|
+
# @!attribute billing_address
|
19
|
+
# @return [CheckoutSdk::Common::Address]
|
20
|
+
# @!attribute phone
|
21
|
+
# @return [CheckoutSdk::Common::Phone]
|
22
|
+
class CardDestination < Destination
|
23
|
+
attr_accessor :number,
|
24
|
+
:expiry_month,
|
25
|
+
:expiry_year,
|
26
|
+
:first_name,
|
27
|
+
:last_name,
|
28
|
+
:name,
|
29
|
+
:billing_address,
|
30
|
+
:phone
|
31
|
+
|
32
|
+
def initialize
|
33
|
+
super CheckoutSdk::Payments::DestinationType::CARD
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Previous
|
5
|
+
module Payments
|
6
|
+
# @!attribute type
|
7
|
+
# @return [String] {CheckoutSdk::Payments::DestinationType}
|
8
|
+
class Destination
|
9
|
+
attr_reader :type
|
10
|
+
|
11
|
+
protected
|
12
|
+
|
13
|
+
# @abstract
|
14
|
+
# @param [String] type {CheckoutSdk::Payments::DestinationType}
|
15
|
+
def initialize(type)
|
16
|
+
@type = type
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Previous
|
5
|
+
module Payments
|
6
|
+
# @!attribute id
|
7
|
+
# @return [String]
|
8
|
+
# @!attribute first_name
|
9
|
+
# @return [String]
|
10
|
+
# @!attribute last_name
|
11
|
+
# @return [String]
|
12
|
+
class IdDestination < Destination
|
13
|
+
attr_accessor :id,
|
14
|
+
:first_name,
|
15
|
+
:last_name
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
super CheckoutSdk::Payments::DestinationType::ID
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Previous
|
5
|
+
module Payments
|
6
|
+
# @!attribute token
|
7
|
+
# @return [String]
|
8
|
+
# @!attribute first_name
|
9
|
+
# @return [String]
|
10
|
+
# @!attribute last_name
|
11
|
+
# @return [String]
|
12
|
+
# @!attribute billing_address
|
13
|
+
# @return [CheckoutSdk::Common::Address]
|
14
|
+
# @!attribute phone
|
15
|
+
# @return [CheckoutSdk::Common::Phone]
|
16
|
+
class TokenDestination < Destination
|
17
|
+
attr_accessor :token,
|
18
|
+
:first_name,
|
19
|
+
:last_name,
|
20
|
+
:billing_address,
|
21
|
+
:phone
|
22
|
+
|
23
|
+
def initialize
|
24
|
+
super CheckoutSdk::Payments::DestinationType::TOKEN
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|