checkout_sdk 0.3.0 → 1.0.0.beta.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +31 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +5 -2
- data/LICENSE.md +9 -0
- data/README.md +96 -110
- data/Rakefile +3 -1
- data/lib/checkout_sdk/abstract_checkout_sdk_builder.rb +28 -0
- data/lib/checkout_sdk/api_client.rb +135 -0
- data/lib/checkout_sdk/apm/apm.rb +12 -0
- data/lib/checkout_sdk/apm/ideal/ideal_client.rb +25 -0
- data/lib/checkout_sdk/apm/previous/klarna/credit_session_request.rb +30 -0
- data/lib/checkout_sdk/apm/previous/klarna/klarna.rb +24 -0
- data/lib/checkout_sdk/apm/previous/klarna/klarna_client.rb +55 -0
- data/lib/checkout_sdk/apm/previous/klarna/klarna_product.rb +30 -0
- data/lib/checkout_sdk/apm/previous/klarna/klarna_shipping_info.rb +33 -0
- data/lib/checkout_sdk/apm/previous/klarna/order_capture_request.rb +37 -0
- data/lib/checkout_sdk/apm/previous/sepa/sepa_client.rb +42 -0
- data/lib/checkout_sdk/authorization_type.rb +12 -0
- data/lib/checkout_sdk/checkout_api.rb +51 -0
- data/lib/checkout_sdk/checkout_configuration.rb +22 -0
- data/lib/checkout_sdk/checkout_oauth_sdk_builder.rb +52 -0
- data/lib/checkout_sdk/checkout_sdk_builder.rb +20 -0
- data/lib/checkout_sdk/checkout_static_keys_sdk_builder.rb +23 -0
- data/lib/checkout_sdk/checkout_utils.rb +15 -0
- data/lib/checkout_sdk/client.rb +46 -0
- data/lib/checkout_sdk/common/abstract_file_request.rb +11 -0
- data/lib/checkout_sdk/common/account_holder.rb +44 -0
- data/lib/checkout_sdk/common/account_holder_identification.rb +20 -0
- data/lib/checkout_sdk/common/account_holder_identification_type.rb +13 -0
- data/lib/checkout_sdk/common/account_holder_type.rb +11 -0
- data/lib/checkout_sdk/common/account_type.rb +11 -0
- data/lib/checkout_sdk/common/address.rb +26 -0
- data/lib/checkout_sdk/common/amount_allocations.rb +20 -0
- data/lib/checkout_sdk/common/bank_details.rb +17 -0
- data/lib/checkout_sdk/common/challenge_indicator.rb +12 -0
- data/lib/checkout_sdk/common/commission.rb +14 -0
- data/lib/checkout_sdk/common/common.rb +22 -0
- data/lib/checkout_sdk/common/country.rb +260 -0
- data/lib/checkout_sdk/common/currency.rb +168 -0
- data/lib/checkout_sdk/common/customer_request.rb +26 -0
- data/lib/checkout_sdk/common/file_purpose.rb +9 -0
- data/lib/checkout_sdk/common/file_request.rb +11 -0
- data/lib/checkout_sdk/common/instrument_type.rb +11 -0
- data/lib/checkout_sdk/common/payment_source_type.rb +52 -0
- data/lib/checkout_sdk/common/phone.rb +14 -0
- data/lib/checkout_sdk/common/update_customer_request.rb +14 -0
- data/lib/checkout_sdk/customers/customer_request.rb +26 -0
- data/lib/checkout_sdk/customers/customers.rb +4 -0
- data/lib/checkout_sdk/customers/customers_client.rb +37 -0
- data/lib/checkout_sdk/disputes/dispute_evidence_request.rb +60 -0
- data/lib/checkout_sdk/disputes/dispute_status.rb +19 -0
- data/lib/checkout_sdk/disputes/disputes.rb +6 -0
- data/lib/checkout_sdk/disputes/disputes_client.rb +55 -0
- data/lib/checkout_sdk/disputes/disputes_query_filter.rb +47 -0
- data/lib/checkout_sdk/environment.rb +59 -0
- data/lib/checkout_sdk/error.rb +30 -0
- data/lib/checkout_sdk/forex/forex.rb +4 -0
- data/lib/checkout_sdk/forex/forex_client.rb +21 -0
- data/lib/checkout_sdk/forex/quote_request.rb +23 -0
- data/lib/checkout_sdk/http_metadata.rb +9 -0
- data/lib/checkout_sdk/instruments/create/instrument_bank_account_request.rb +51 -0
- data/lib/checkout_sdk/instruments/create/instrument_request.rb +17 -0
- data/lib/checkout_sdk/instruments/create/instrument_token_request.rb +21 -0
- data/lib/checkout_sdk/instruments/get/bank_account_field_query.rb +14 -0
- data/lib/checkout_sdk/instruments/get/payment_network.rb +14 -0
- data/lib/checkout_sdk/instruments/instruments.rb +15 -0
- data/lib/checkout_sdk/instruments/instruments_client.rb +49 -0
- data/lib/checkout_sdk/instruments/update/update_instrument_bank_account_request.rb +51 -0
- data/lib/checkout_sdk/instruments/update/update_instrument_card_request.rb +27 -0
- data/lib/checkout_sdk/instruments/update/update_instrument_request.rb +17 -0
- data/lib/checkout_sdk/instruments/update/update_instrument_token_request.rb +15 -0
- data/lib/checkout_sdk/json_serializer.rb +54 -0
- data/lib/checkout_sdk/oauth_access_token.rb +27 -0
- data/lib/checkout_sdk/oauth_scopes.rb +41 -0
- data/lib/checkout_sdk/oauth_sdk_credentials.rb +112 -0
- data/lib/checkout_sdk/payments/airline_data.rb +17 -0
- data/lib/checkout_sdk/payments/authorization_request.rb +17 -0
- data/lib/checkout_sdk/payments/authorization_type.rb +11 -0
- data/lib/checkout_sdk/payments/billing_descriptor.rb +17 -0
- data/lib/checkout_sdk/payments/capture_request.rb +41 -0
- data/lib/checkout_sdk/payments/capture_type.rb +10 -0
- data/lib/checkout_sdk/payments/charge_bearer.rb +10 -0
- data/lib/checkout_sdk/payments/d_local_installments.rb +11 -0
- data/lib/checkout_sdk/payments/d_local_processing_settings.rb +17 -0
- data/lib/checkout_sdk/payments/destination/bank_account_destination.rb +42 -0
- data/lib/checkout_sdk/payments/destination/card_destination.rb +24 -0
- data/lib/checkout_sdk/payments/destination/destination.rb +19 -0
- data/lib/checkout_sdk/payments/destination/destination_type.rb +12 -0
- data/lib/checkout_sdk/payments/destination/id_destination.rb +18 -0
- data/lib/checkout_sdk/payments/destination/token_destination.rb +18 -0
- data/lib/checkout_sdk/payments/exemption.rb +17 -0
- data/lib/checkout_sdk/payments/flight_leg_details.rb +35 -0
- data/lib/checkout_sdk/payments/instruction_scheme.rb +11 -0
- data/lib/checkout_sdk/payments/merchant_initiated_reason.rb +12 -0
- data/lib/checkout_sdk/payments/network_token_type.rb +12 -0
- data/lib/checkout_sdk/payments/os_type.rb +10 -0
- data/lib/checkout_sdk/payments/passenger.rb +17 -0
- data/lib/checkout_sdk/payments/passenger_name.rb +11 -0
- data/lib/checkout_sdk/payments/payer.rb +17 -0
- data/lib/checkout_sdk/payments/payment_instruction.rb +32 -0
- data/lib/checkout_sdk/payments/payment_recipient.rb +20 -0
- data/lib/checkout_sdk/payments/payment_request.rb +86 -0
- data/lib/checkout_sdk/payments/payment_type.rb +13 -0
- data/lib/checkout_sdk/payments/payments.rb +82 -0
- data/lib/checkout_sdk/payments/payments_client.rb +86 -0
- data/lib/checkout_sdk/payments/payout_billing_descriptor.rb +11 -0
- data/lib/checkout_sdk/payments/payout_request.rb +38 -0
- data/lib/checkout_sdk/payments/preferred_schema.rb +11 -0
- data/lib/checkout_sdk/payments/processing_settings.rb +80 -0
- data/lib/checkout_sdk/payments/product.rb +47 -0
- data/lib/checkout_sdk/payments/product_type.rb +12 -0
- data/lib/checkout_sdk/payments/refund_request.rb +17 -0
- data/lib/checkout_sdk/payments/risk_request.rb +11 -0
- data/lib/checkout_sdk/payments/sender/corporate_sender.rb +27 -0
- data/lib/checkout_sdk/payments/sender/government_sender.rb +27 -0
- data/lib/checkout_sdk/payments/sender/individual_sender.rb +42 -0
- data/lib/checkout_sdk/payments/sender/instrument_sender.rb +11 -0
- data/lib/checkout_sdk/payments/sender/sender.rb +22 -0
- data/lib/checkout_sdk/payments/sender/sender_type.rb +12 -0
- data/lib/checkout_sdk/payments/sender/source_of_funds.rb +14 -0
- data/lib/checkout_sdk/payments/sender/ticket.rb +23 -0
- data/lib/checkout_sdk/payments/shipping_details.rb +17 -0
- data/lib/checkout_sdk/payments/shipping_preference.rb +11 -0
- data/lib/checkout_sdk/payments/source/apm/after_pay_source.rb +15 -0
- data/lib/checkout_sdk/payments/source/apm/alipay_plus_source.rb +47 -0
- data/lib/checkout_sdk/payments/source/apm/bancontact_source.rb +24 -0
- data/lib/checkout_sdk/payments/source/apm/benefit_source.rb +11 -0
- data/lib/checkout_sdk/payments/source/apm/eps_source.rb +15 -0
- data/lib/checkout_sdk/payments/source/apm/giropay_source.rb +27 -0
- data/lib/checkout_sdk/payments/source/apm/ideal_source.rb +21 -0
- data/lib/checkout_sdk/payments/source/apm/knet_source.rb +36 -0
- data/lib/checkout_sdk/payments/source/apm/mbway_source.rb +11 -0
- data/lib/checkout_sdk/payments/source/apm/multi_banco_source.rb +21 -0
- data/lib/checkout_sdk/payments/source/apm/p24_source.rb +24 -0
- data/lib/checkout_sdk/payments/source/apm/paypal_source.rb +11 -0
- data/lib/checkout_sdk/payments/source/apm/post_finance_source.rb +21 -0
- data/lib/checkout_sdk/payments/source/apm/qpay_source.rb +24 -0
- data/lib/checkout_sdk/payments/source/apm/sofort_source.rb +18 -0
- data/lib/checkout_sdk/payments/source/apm/stcpay_source.rb +11 -0
- data/lib/checkout_sdk/payments/source/apm/tamara_source.rb +15 -0
- data/lib/checkout_sdk/payments/source/apm/we_chat_pay_source.rb +15 -0
- data/lib/checkout_sdk/payments/source/bank_account_source.rb +30 -0
- data/lib/checkout_sdk/payments/source/card_source.rb +39 -0
- data/lib/checkout_sdk/payments/source/currency_account_source.rb +15 -0
- data/lib/checkout_sdk/payments/source/id_source.rb +21 -0
- data/lib/checkout_sdk/payments/source/network_token_source.rb +45 -0
- data/lib/checkout_sdk/payments/source/payment_request_source.rb +18 -0
- data/lib/checkout_sdk/payments/source/payout_request_source.rb +22 -0
- data/lib/checkout_sdk/payments/source/payout_source_type.rb +9 -0
- data/lib/checkout_sdk/payments/source/provider_token_source.rb +21 -0
- data/lib/checkout_sdk/payments/source/token_source.rb +24 -0
- data/lib/checkout_sdk/payments/terminal_type.rb +11 -0
- data/lib/checkout_sdk/payments/three_ds_flow_type.rb +11 -0
- data/lib/checkout_sdk/payments/three_ds_request.rb +56 -0
- data/lib/checkout_sdk/payments/user_action.rb +10 -0
- data/lib/checkout_sdk/payments/void_request.rb +14 -0
- data/lib/checkout_sdk/platform_type.rb +10 -0
- data/lib/checkout_sdk/previous/checkout_api.rb +29 -0
- data/lib/checkout_sdk/previous/checkout_previous_sdk_builder.rb +11 -0
- data/lib/checkout_sdk/previous/checkout_previous_static_keys_sdk_builder.rb +24 -0
- data/lib/checkout_sdk/previous/previous_static_keys_sdk_credentials.rb +38 -0
- data/lib/checkout_sdk/sdk_authorization.rb +25 -0
- data/lib/checkout_sdk/sdk_credentials.rb +12 -0
- data/lib/checkout_sdk/sessions/authentication_method.rb +14 -0
- data/lib/checkout_sdk/sessions/authentication_type.rb +10 -0
- data/lib/checkout_sdk/sessions/card_holder_account_info.rb +32 -0
- data/lib/checkout_sdk/sessions/category.rb +10 -0
- data/lib/checkout_sdk/sessions/channel/app_session.rb +36 -0
- data/lib/checkout_sdk/sessions/channel/browser_session.rb +42 -0
- data/lib/checkout_sdk/sessions/channel/channel_data.rb +19 -0
- data/lib/checkout_sdk/sessions/channel/channel_data_type.rb +10 -0
- data/lib/checkout_sdk/sessions/channel/sdk_ephemeral_public_key.rb +19 -0
- data/lib/checkout_sdk/sessions/channel/sdk_interface_type.rb +11 -0
- data/lib/checkout_sdk/sessions/channel/three_ds_method_completion.rb +11 -0
- data/lib/checkout_sdk/sessions/channel/uie_elements.rb +13 -0
- data/lib/checkout_sdk/sessions/completion/completion_info.rb +19 -0
- data/lib/checkout_sdk/sessions/completion/completion_info_type.rb +10 -0
- data/lib/checkout_sdk/sessions/completion/hosted_completion_info.rb +21 -0
- data/lib/checkout_sdk/sessions/completion/non_hosted_completion_info.rb +15 -0
- data/lib/checkout_sdk/sessions/delivery_timeframe.rb +12 -0
- data/lib/checkout_sdk/sessions/installment.rb +17 -0
- data/lib/checkout_sdk/sessions/merchant_risk_info.rb +23 -0
- data/lib/checkout_sdk/sessions/recurring.rb +14 -0
- data/lib/checkout_sdk/sessions/session_address.rb +11 -0
- data/lib/checkout_sdk/sessions/session_marketplace_data.rb +11 -0
- data/lib/checkout_sdk/sessions/session_request.rb +68 -0
- data/lib/checkout_sdk/sessions/session_secret_credentials.rb +28 -0
- data/lib/checkout_sdk/sessions/session_source_type.rb +12 -0
- data/lib/checkout_sdk/sessions/sessions.rb +47 -0
- data/lib/checkout_sdk/sessions/sessions_billing_descriptor.rb +11 -0
- data/lib/checkout_sdk/sessions/sessions_client.rb +64 -0
- data/lib/checkout_sdk/sessions/shipping_indicator.rb +9 -0
- data/lib/checkout_sdk/sessions/source/card_source.rb +30 -0
- data/lib/checkout_sdk/sessions/source/id_source.rb +15 -0
- data/lib/checkout_sdk/sessions/source/network_token_source.rb +27 -0
- data/lib/checkout_sdk/sessions/source/session_scheme.rb +14 -0
- data/lib/checkout_sdk/sessions/source/session_source.rb +37 -0
- data/lib/checkout_sdk/sessions/source/token_source.rb +18 -0
- data/lib/checkout_sdk/sessions/three_ds_method_completion_request.rb +11 -0
- data/lib/checkout_sdk/sessions/transaction_type.rb +13 -0
- data/lib/checkout_sdk/static_keys_builder.rb +35 -0
- data/lib/checkout_sdk/static_keys_sdk_credentials.rb +35 -0
- data/lib/checkout_sdk/tokens/apple_pay_token_data.rb +20 -0
- data/lib/checkout_sdk/tokens/apple_pay_token_request.rb +15 -0
- data/lib/checkout_sdk/tokens/card_token_request.rb +36 -0
- data/lib/checkout_sdk/tokens/google_pay_token_data.rb +17 -0
- data/lib/checkout_sdk/tokens/google_pay_token_request.rb +15 -0
- data/lib/checkout_sdk/tokens/token_type.rb +11 -0
- data/lib/checkout_sdk/tokens/tokens.rb +10 -0
- data/lib/checkout_sdk/tokens/tokens_client.rb +21 -0
- data/lib/checkout_sdk/tokens/wallet_token_request.rb +19 -0
- data/lib/checkout_sdk/version.rb +3 -1
- data/lib/checkout_sdk.rb +59 -21
- data/sig/checkout_sdk.rbs +4 -0
- metadata +254 -81
- data/.gitignore +0 -11
- data/.travis.yml +0 -7
- data/Gemfile.lock +0 -45
- data/LICENSE +0 -21
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/checkout_sdk.gemspec +0 -24
- data/documentation/.gitignore +0 -20
- data/documentation/docs/environment.md +0 -26
- data/documentation/docs/getting_started.md +0 -48
- data/documentation/docs/initialize.md +0 -19
- data/documentation/docs/install.md +0 -21
- data/documentation/docs/payments.md +0 -200
- data/documentation/docs/sources.md +0 -53
- data/documentation/docs/tokens.md +0 -88
- data/documentation/docusaurus.config.js +0 -60
- data/documentation/package-lock.json +0 -13511
- data/documentation/package.json +0 -32
- data/documentation/sidebars.js +0 -10
- data/documentation/src/css/custom.css +0 -103
- data/documentation/src/pages/index.js +0 -10
- data/documentation/src/pages/styles.module.css +0 -37
- data/documentation/static/img/favicon.png +0 -0
- data/documentation/static/img/logo.png +0 -0
- data/documentation/static/img/undraw_docusaurus_mountain.svg +0 -170
- data/documentation/static/img/undraw_docusaurus_react.svg +0 -169
- data/documentation/static/img/undraw_docusaurus_tree.svg +0 -1
- data/documentation/yarn.lock +0 -9369
- data/lib/checkout_sdk/api_resource.rb +0 -77
- data/lib/checkout_sdk/configuration.rb +0 -10
- data/lib/checkout_sdk/data/capture_payment.rb +0 -11
- data/lib/checkout_sdk/data/payment_request_source.rb +0 -145
- data/lib/checkout_sdk/data/payment_source.rb +0 -40
- data/lib/checkout_sdk/data/refund_payment.rb +0 -11
- data/lib/checkout_sdk/data/request_token.rb +0 -67
- data/lib/checkout_sdk/data/void_payment.rb +0 -10
- data/spec/checkout_sdk/api_resource_spec.rb +0 -126
- data/spec/checkout_sdk/data/payment_request_source_spec.rb +0 -126
- data/spec/checkout_sdk/data/request_token_spec.rb +0 -107
- data/spec/checkout_sdk_spec.rb +0 -21
- data/spec/spec_helper.rb +0 -32
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute callback_url
|
6
|
+
# @return [String]
|
7
|
+
class NonHostedCompletionInfo < CompletionInfo
|
8
|
+
attr_accessor :callback_url
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
super CompletionInfoType::NON_HOSTED
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute number_of_payments
|
6
|
+
# @return [Integer]
|
7
|
+
# @!attribute days_between_payments
|
8
|
+
# @return [Integer]
|
9
|
+
# @!attribute expiry
|
10
|
+
# @return [String]
|
11
|
+
class Installment
|
12
|
+
attr_accessor :number_of_payments,
|
13
|
+
:days_between_payments,
|
14
|
+
:expiry
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute delivery_email
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute delivery_timeframe
|
8
|
+
# @return [String] {DeliveryTimeframe}
|
9
|
+
# @!attribute is_preorder
|
10
|
+
# @return [TrueClass, FalseClass]
|
11
|
+
# @!attribute is_reorder
|
12
|
+
# @return [TrueClass, FalseClass]
|
13
|
+
# @!attribute shipping_indicator
|
14
|
+
# @return [String] {ShippingIndicator}
|
15
|
+
class MerchantRiskInfo
|
16
|
+
attr_accessor :delivery_email,
|
17
|
+
:delivery_timeframe,
|
18
|
+
:is_preorder,
|
19
|
+
:is_reorder,
|
20
|
+
:shipping_indicator
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute days_between_payments
|
6
|
+
# @return [Integer]
|
7
|
+
# @!attribute expiry
|
8
|
+
# @return [String]
|
9
|
+
class Recurring
|
10
|
+
attr_accessor :days_between_payments,
|
11
|
+
:expiry
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute source
|
6
|
+
# @return [SessionSource]
|
7
|
+
# @!attribute amount
|
8
|
+
# @return [Integer]
|
9
|
+
# @!attribute currency
|
10
|
+
# @return [String] {CheckoutSdk::Common::Currency}
|
11
|
+
# @!attribute processing_channel_id
|
12
|
+
# @return [String]
|
13
|
+
# @!attribute marketplace
|
14
|
+
# @return [SessionMarketplaceData]
|
15
|
+
# @!attribute authentication_type
|
16
|
+
# @return [String] {AuthenticationType}
|
17
|
+
# @!attribute authentication_category
|
18
|
+
# @return [String] {Category}
|
19
|
+
# @!attribute account_info
|
20
|
+
# @return [CardHolderAccountInfo]
|
21
|
+
# @!attribute challenge_indicator
|
22
|
+
# @return [String] {CheckoutSdk::Common::ChallengeIndicator}
|
23
|
+
# @!attribute billing_descriptor
|
24
|
+
# @return [SessionsBillingDescriptor]
|
25
|
+
# @!attribute reference
|
26
|
+
# @return [String]
|
27
|
+
# @!attribute merchant_risk_info
|
28
|
+
# @return [MerchantRiskInfo]
|
29
|
+
# @!attribute prior_transaction_reference
|
30
|
+
# @return [String]
|
31
|
+
# @!attribute transaction_type
|
32
|
+
# @return [String] {TransactionType}
|
33
|
+
# @!attribute shipping_address
|
34
|
+
# @return [SessionAddress]
|
35
|
+
# @!attribute shipping_address_matches_billing
|
36
|
+
# @return [TrueClass, FalseClass]
|
37
|
+
# @!attribute completion
|
38
|
+
# @return [CompletionInfo]
|
39
|
+
# @!attribute channel_data
|
40
|
+
# @return [ChannelData]
|
41
|
+
# @!attribute recurring
|
42
|
+
# @return [Recurring]
|
43
|
+
# @!attribute installment
|
44
|
+
# @return [Installment]
|
45
|
+
class SessionRequest
|
46
|
+
attr_accessor :source,
|
47
|
+
:amount,
|
48
|
+
:currency,
|
49
|
+
:processing_channel_id,
|
50
|
+
:marketplace,
|
51
|
+
:authentication_type,
|
52
|
+
:authentication_category,
|
53
|
+
:account_info,
|
54
|
+
:challenge_indicator,
|
55
|
+
:billing_descriptor,
|
56
|
+
:reference,
|
57
|
+
:merchant_risk_info,
|
58
|
+
:prior_transaction_reference,
|
59
|
+
:transaction_type,
|
60
|
+
:shipping_address,
|
61
|
+
:shipping_address_matches_billing,
|
62
|
+
:completion,
|
63
|
+
:channel_data,
|
64
|
+
:recurring,
|
65
|
+
:installment
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute session_secret
|
6
|
+
# @return [String]
|
7
|
+
class SessionSecretCredentials < SdkCredentials
|
8
|
+
attr_accessor :session_secret
|
9
|
+
|
10
|
+
# @param [String] session_secret
|
11
|
+
# @return [SessionSecretCredentials]
|
12
|
+
def initialize(session_secret)
|
13
|
+
@session_secret = session_secret
|
14
|
+
end
|
15
|
+
|
16
|
+
# @param [String] authorization_type
|
17
|
+
# @return [CheckoutSdk::SdkAuthorization]
|
18
|
+
def get_authorization(authorization_type)
|
19
|
+
if authorization_type != AuthorizationType::CUSTOM
|
20
|
+
raise CheckoutAuthorizationException.invalid_authorization AuthorizationType::CUSTOM
|
21
|
+
end
|
22
|
+
raise CheckoutAuthorizationException.invalid_key AuthorizationType::CUSTOM if @session_secret.nil?
|
23
|
+
|
24
|
+
SdkAuthorization.new PlatformType::CUSTOM, @session_secret
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'checkout_sdk/sessions/authentication_method'
|
4
|
+
require 'checkout_sdk/sessions/authentication_type'
|
5
|
+
require 'checkout_sdk/sessions/card_holder_account_info'
|
6
|
+
require 'checkout_sdk/sessions/category'
|
7
|
+
require 'checkout_sdk/sessions/delivery_timeframe'
|
8
|
+
require 'checkout_sdk/sessions/installment'
|
9
|
+
require 'checkout_sdk/sessions/merchant_risk_info'
|
10
|
+
require 'checkout_sdk/sessions/recurring'
|
11
|
+
require 'checkout_sdk/sessions/session_address'
|
12
|
+
require 'checkout_sdk/sessions/session_marketplace_data'
|
13
|
+
require 'checkout_sdk/sessions/session_request'
|
14
|
+
require 'checkout_sdk/sessions/session_source_type'
|
15
|
+
require 'checkout_sdk/sessions/sessions_billing_descriptor'
|
16
|
+
require 'checkout_sdk/sessions/shipping_indicator'
|
17
|
+
require 'checkout_sdk/sessions/transaction_type'
|
18
|
+
require 'checkout_sdk/sessions/three_ds_method_completion_request'
|
19
|
+
|
20
|
+
# channel
|
21
|
+
require 'checkout_sdk/sessions/channel/channel_data'
|
22
|
+
require 'checkout_sdk/sessions/channel/channel_data_type'
|
23
|
+
require 'checkout_sdk/sessions/channel/sdk_ephemeral_public_key'
|
24
|
+
require 'checkout_sdk/sessions/channel/sdk_interface_type'
|
25
|
+
require 'checkout_sdk/sessions/channel/three_ds_method_completion'
|
26
|
+
require 'checkout_sdk/sessions/channel/uie_elements'
|
27
|
+
require 'checkout_sdk/sessions/channel/app_session'
|
28
|
+
require 'checkout_sdk/sessions/channel/browser_session'
|
29
|
+
|
30
|
+
# completion
|
31
|
+
require 'checkout_sdk/sessions/completion/completion_info'
|
32
|
+
require 'checkout_sdk/sessions/completion/completion_info_type'
|
33
|
+
require 'checkout_sdk/sessions/completion/hosted_completion_info'
|
34
|
+
require 'checkout_sdk/sessions/completion/non_hosted_completion_info'
|
35
|
+
|
36
|
+
# sources
|
37
|
+
require 'checkout_sdk/sessions/source/session_scheme'
|
38
|
+
require 'checkout_sdk/sessions/source/session_source'
|
39
|
+
require 'checkout_sdk/sessions/source/card_source'
|
40
|
+
require 'checkout_sdk/sessions/source/id_source'
|
41
|
+
require 'checkout_sdk/sessions/source/network_token_source'
|
42
|
+
require 'checkout_sdk/sessions/source/token_source'
|
43
|
+
|
44
|
+
# credentials
|
45
|
+
require 'checkout_sdk/sessions/session_secret_credentials'
|
46
|
+
|
47
|
+
require 'checkout_sdk/sessions/sessions_client'
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
class SessionsClient < Client
|
6
|
+
SESSIONS = 'sessions'
|
7
|
+
COLLECT_DATA = 'collect-data'
|
8
|
+
COMPLETE = 'complete'
|
9
|
+
ISSUER_FINGERPRINT = 'issuer-fingerprint'
|
10
|
+
private_constant :SESSIONS, :COLLECT_DATA, :COMPLETE, :ISSUER_FINGERPRINT
|
11
|
+
|
12
|
+
# @param [ApiClient] api_client
|
13
|
+
# @param [CheckoutConfiguration] configuration
|
14
|
+
def initialize(api_client, configuration)
|
15
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::OAUTH
|
16
|
+
end
|
17
|
+
|
18
|
+
# @param [SessionRequest] session_request
|
19
|
+
def request_session(session_request)
|
20
|
+
api_client.invoke_post(SESSIONS, sdk_authorization, session_request)
|
21
|
+
end
|
22
|
+
|
23
|
+
# @param [String] session_id
|
24
|
+
# @param [String, nil] session_secret
|
25
|
+
def get_session_details(session_id, session_secret = nil)
|
26
|
+
api_client.invoke_get(build_path(SESSIONS, session_id), custom_sdk_authorization(session_secret))
|
27
|
+
end
|
28
|
+
|
29
|
+
# @param [String] session_id
|
30
|
+
# @param [ChannelData] channel_data
|
31
|
+
# @param [String, nil] session_secret
|
32
|
+
def update_session(session_id, channel_data, session_secret = nil)
|
33
|
+
api_client.invoke_put(build_path(SESSIONS, session_id, COLLECT_DATA),
|
34
|
+
custom_sdk_authorization(session_secret),
|
35
|
+
channel_data)
|
36
|
+
end
|
37
|
+
|
38
|
+
# @param [String] session_id
|
39
|
+
# @param [String, nil] session_secret
|
40
|
+
def complete_session(session_id, session_secret = nil)
|
41
|
+
api_client.invoke_post(build_path(SESSIONS, session_id, COMPLETE), custom_sdk_authorization(session_secret))
|
42
|
+
end
|
43
|
+
|
44
|
+
# @param [String] session_id
|
45
|
+
# @param [ThreeDsMethodCompletionRequest] three_ds_method_completion_request
|
46
|
+
# @param [String, nil] session_secret
|
47
|
+
def update_3ds_method_completion(session_id, three_ds_method_completion_request, session_secret = nil)
|
48
|
+
api_client.invoke_put(build_path(SESSIONS, session_id, ISSUER_FINGERPRINT),
|
49
|
+
custom_sdk_authorization(session_secret),
|
50
|
+
three_ds_method_completion_request)
|
51
|
+
end
|
52
|
+
|
53
|
+
# @param [String, nil] session_secret
|
54
|
+
def custom_sdk_authorization(session_secret = nil)
|
55
|
+
if session_secret.nil?
|
56
|
+
sdk_authorization
|
57
|
+
else
|
58
|
+
SessionSecretCredentials.new(session_secret) \
|
59
|
+
.get_authorization(AuthorizationType::CUSTOM)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute number
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute expiry_month
|
8
|
+
# @return [Integer]
|
9
|
+
# @!attribute expiry_year
|
10
|
+
# @return [Integer]
|
11
|
+
# @!attribute name
|
12
|
+
# @return [String]
|
13
|
+
# @!attribute stored
|
14
|
+
# @return [TrueClass, FalseClass]
|
15
|
+
# @!attribute store_for_future_use
|
16
|
+
# @return [TrueClass, FalseClass]
|
17
|
+
class CardSource < SessionSource
|
18
|
+
attr_accessor :number,
|
19
|
+
:expiry_month,
|
20
|
+
:expiry_year,
|
21
|
+
:name,
|
22
|
+
:stored,
|
23
|
+
:store_for_future_use
|
24
|
+
|
25
|
+
def initialize
|
26
|
+
super SessionSourceType::CARD
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute token
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute expiry_month
|
8
|
+
# @return [Integer]
|
9
|
+
# @!attribute expiry_year
|
10
|
+
# @return [Integer]
|
11
|
+
# @!attribute name
|
12
|
+
# @return [String]
|
13
|
+
# @!attribute stored
|
14
|
+
# @return [TrueClass, FalseClass]
|
15
|
+
class NetworkTokenSource < SessionSource
|
16
|
+
attr_accessor :token,
|
17
|
+
:expiry_month,
|
18
|
+
:expiry_year,
|
19
|
+
:name,
|
20
|
+
:stored
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
super SessionSourceType::NETWORK_TOKEN
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute type
|
6
|
+
# @return [String] {SessionSourceType}
|
7
|
+
# @!attribute scheme
|
8
|
+
# @return [String] {SessionScheme}
|
9
|
+
# @!attribute billing_address
|
10
|
+
# @return [SessionAddress]
|
11
|
+
# @!attribute home_phone
|
12
|
+
# @return [CheckoutSdk::Common::Phone]
|
13
|
+
# @!attribute mobile_phone
|
14
|
+
# @return [CheckoutSdk::Common::Phone]
|
15
|
+
# @!attribute work_phone
|
16
|
+
# @return [CheckoutSdk::Common::Phone]
|
17
|
+
# @!attribute email
|
18
|
+
# @return [String]
|
19
|
+
class SessionSource
|
20
|
+
attr_reader :type
|
21
|
+
attr_accessor :scheme,
|
22
|
+
:billing_address,
|
23
|
+
:home_phone,
|
24
|
+
:mobile_phone,
|
25
|
+
:work_phone,
|
26
|
+
:email
|
27
|
+
|
28
|
+
protected
|
29
|
+
|
30
|
+
# @abstract
|
31
|
+
# @param [String] type {SessionSourceType}
|
32
|
+
def initialize(type)
|
33
|
+
@type = type
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute token
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute store_for_future_use
|
8
|
+
# @return [TrueClass, FalseClass]
|
9
|
+
class TokenSource < SessionSource
|
10
|
+
attr_accessor :token,
|
11
|
+
:store_for_future_use
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
super SessionSourceType::TOKEN
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
# @!attribute three_ds_method_completion
|
6
|
+
# @return [String] {ThreeDsMethodCompletion}
|
7
|
+
class ThreeDsMethodCompletionRequest
|
8
|
+
attr_accessor :three_ds_method_completion
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Sessions
|
5
|
+
module TransactionType
|
6
|
+
GOODS_SERVICE = 'goods_service'
|
7
|
+
CHECK_ACCEPTANCE = 'check_acceptance'
|
8
|
+
ACCOUNT_FUNDING = 'account_funding'
|
9
|
+
QUASHI_CARD_TRANSACTION = 'quashi_card_transaction'
|
10
|
+
PREPAID_ACTIVATION_AND_LOAD = 'prepaid_activation_and_load'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
class StaticKeysBuilder < AbstractCheckoutSdkBuilder
|
5
|
+
attr_accessor :secret_key, :public_key
|
6
|
+
|
7
|
+
# @param [String] secret_key
|
8
|
+
def with_secret_key(secret_key)
|
9
|
+
@secret_key = secret_key
|
10
|
+
self
|
11
|
+
end
|
12
|
+
|
13
|
+
# @param [String] public_key
|
14
|
+
def with_public_key(public_key)
|
15
|
+
@public_key = public_key
|
16
|
+
self
|
17
|
+
end
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
def build
|
22
|
+
super
|
23
|
+
validate_secret_key(@secret_key_pattern)
|
24
|
+
validate_public_key(@public_key_pattern)
|
25
|
+
end
|
26
|
+
|
27
|
+
def validate_public_key(pattern)
|
28
|
+
raise CheckoutArgumentException, 'Invalid public key' if !public_key.nil? && !public_key.match(pattern)
|
29
|
+
end
|
30
|
+
|
31
|
+
def validate_secret_key(pattern)
|
32
|
+
raise CheckoutArgumentException, 'Invalid secret key' if secret_key.nil? || !secret_key.match(pattern)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
# @!attribute secret_key
|
5
|
+
# @return [String]
|
6
|
+
# @!attribute public_key
|
7
|
+
# @return [String]
|
8
|
+
class StaticKeysSdkCredentials < SdkCredentials
|
9
|
+
attr_reader :secret_key, :public_key
|
10
|
+
|
11
|
+
# @param [String] secret_key
|
12
|
+
# @param [String] public_key
|
13
|
+
def initialize(secret_key, public_key)
|
14
|
+
@secret_key = secret_key
|
15
|
+
@public_key = public_key
|
16
|
+
end
|
17
|
+
|
18
|
+
# @param [String] authorization_type
|
19
|
+
# @return [CheckoutSdk::SdkAuthorization]
|
20
|
+
def get_authorization(authorization_type)
|
21
|
+
case authorization_type
|
22
|
+
when AuthorizationType::SECRET_KEY, AuthorizationType::SECRET_KEY_OR_OAUTH
|
23
|
+
raise CheckoutAuthorizationException.invalid_key AuthorizationType::SECRET_KEY if secret_key.nil?
|
24
|
+
|
25
|
+
SdkAuthorization.new(PlatformType::DEFAULT, @secret_key)
|
26
|
+
when AuthorizationType::PUBLIC_KEY, AuthorizationType::PUBLIC_KEY_OR_OAUTH
|
27
|
+
raise CheckoutAuthorizationException.invalid_key AuthorizationType::PUBLIC_KEY if public_key.nil?
|
28
|
+
|
29
|
+
SdkAuthorization.new(PlatformType::DEFAULT, @public_key)
|
30
|
+
else
|
31
|
+
raise CheckoutAuthorizationException.invalid_authorization authorization_type
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Tokens
|
5
|
+
# @!attribute version
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute data
|
8
|
+
# @return [String]
|
9
|
+
# @!attribute signature
|
10
|
+
# @return [String]
|
11
|
+
# @!attribute header
|
12
|
+
# @return [Hash{String => Object]
|
13
|
+
class ApplePayTokenData
|
14
|
+
attr_accessor :version,
|
15
|
+
:data,
|
16
|
+
:signature,
|
17
|
+
:header
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Tokens
|
5
|
+
# @!attribute token_data
|
6
|
+
# @return [ApplePayTokenData]
|
7
|
+
class ApplePayTokenRequest < WalletTokenRequest
|
8
|
+
attr_accessor :token_data
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
super CheckoutSdk::Tokens::TokenType::APPLE_PAY
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|