checkout_sdk 0.3.2 → 1.0.0.beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.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,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Disputes
|
5
|
+
# @!attribute proof_of_delivery_or_service_file
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute proof_of_delivery_or_service_text
|
8
|
+
# @return [String]
|
9
|
+
# @!attribute invoice_or_receipt_file
|
10
|
+
# @return [String]
|
11
|
+
# @!attribute invoice_or_receipt_text
|
12
|
+
# @return [String]
|
13
|
+
# @!attribute invoice_showing_distinct_transactions_file
|
14
|
+
# @return [String]
|
15
|
+
# @!attribute invoice_showing_distinct_transactions_text
|
16
|
+
# @return [String]
|
17
|
+
# @!attribute customer_communication_file
|
18
|
+
# @return [String]
|
19
|
+
# @!attribute customer_communication_text
|
20
|
+
# @return [String]
|
21
|
+
# @!attribute refund_or_cancellation_policy_file
|
22
|
+
# @return [String]
|
23
|
+
# @!attribute refund_or_cancellation_policy_text
|
24
|
+
# @return [String]
|
25
|
+
# @!attribute recurring_transaction_agreement_file
|
26
|
+
# @return [String]
|
27
|
+
# @!attribute recurring_transaction_agreement_text
|
28
|
+
# @return [String]
|
29
|
+
# @!attribute invoice_showing_distinct_transactions_file
|
30
|
+
# @return [String]
|
31
|
+
# @!attribute invoice_showing_distinct_transactions_text
|
32
|
+
# @return [String]
|
33
|
+
# @!attribute additional_evidence_file
|
34
|
+
# @return [String]
|
35
|
+
# @!attribute additional_evidence_text
|
36
|
+
# @return [String]
|
37
|
+
# @!attribute proof_of_delivery_or_service_date_file
|
38
|
+
# @return [String]
|
39
|
+
# @!attribute proof_of_delivery_or_service_date_text
|
40
|
+
# @return [String]
|
41
|
+
class DisputeEvidenceRequest
|
42
|
+
attr_accessor :proof_of_delivery_or_service_file,
|
43
|
+
:proof_of_delivery_or_service_text,
|
44
|
+
:invoice_or_receipt_file,
|
45
|
+
:invoice_or_receipt_text,
|
46
|
+
:invoice_showing_distinct_transactions_file,
|
47
|
+
:invoice_showing_distinct_transactions_text,
|
48
|
+
:customer_communication_file,
|
49
|
+
:customer_communication_text,
|
50
|
+
:refund_or_cancellation_policy_file,
|
51
|
+
:refund_or_cancellation_policy_text,
|
52
|
+
:recurring_transaction_agreement_file,
|
53
|
+
:recurring_transaction_agreement_text,
|
54
|
+
:additional_evidence_file,
|
55
|
+
:additional_evidence_text,
|
56
|
+
:proof_of_delivery_or_service_date_file,
|
57
|
+
:proof_of_delivery_or_service_date_text
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Disputes
|
5
|
+
module DisputeStatus
|
6
|
+
WON = 'won'
|
7
|
+
LOST = 'lost'
|
8
|
+
EXPIRED = 'expired'
|
9
|
+
ACCEPTED = 'accepted'
|
10
|
+
CANCELED = 'canceled'
|
11
|
+
RESOLVED = 'resolved'
|
12
|
+
ARBITRATION_WON = 'arbitration_won'
|
13
|
+
ARBITRATION_LOST = 'arbitration_lost'
|
14
|
+
EVIDENCE_REQUIRED = 'evidence_required'
|
15
|
+
EVIDENCE_UNDER_REVIEW = 'evidence_under_review'
|
16
|
+
ARBITRATION_UNDER_REVIEW = 'arbitration_under_review'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Disputes
|
5
|
+
class DisputesClient < Client
|
6
|
+
DISPUTES = 'disputes'
|
7
|
+
FILES = 'files'
|
8
|
+
ACCEPT = 'accept'
|
9
|
+
EVIDENCE = 'evidence'
|
10
|
+
private_constant :DISPUTES, :FILES, :ACCEPT, :EVIDENCE
|
11
|
+
|
12
|
+
# @param [ApiClient] api_client
|
13
|
+
# @param [CheckoutConfiguration] configuration
|
14
|
+
def initialize(api_client, configuration)
|
15
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
16
|
+
end
|
17
|
+
|
18
|
+
# @param [DisputesQueryFilter] disputes_query_filter
|
19
|
+
def query(disputes_query_filter)
|
20
|
+
api_client.invoke_get(DISPUTES, sdk_authorization, disputes_query_filter)
|
21
|
+
end
|
22
|
+
|
23
|
+
# @param [String] dispute_id
|
24
|
+
def get_dispute_details(dispute_id)
|
25
|
+
api_client.invoke_get(build_path(DISPUTES, dispute_id), sdk_authorization)
|
26
|
+
end
|
27
|
+
|
28
|
+
# @param [String] dispute_id
|
29
|
+
def accept(dispute_id)
|
30
|
+
api_client.invoke_post(build_path(DISPUTES, dispute_id, ACCEPT), sdk_authorization)
|
31
|
+
end
|
32
|
+
|
33
|
+
# @param [String] dispute_id
|
34
|
+
# @param [DisputeEvidence] dispute_evidence
|
35
|
+
def put_evidence(dispute_id, dispute_evidence)
|
36
|
+
api_client.invoke_put(build_path(DISPUTES, dispute_id, EVIDENCE), sdk_authorization, dispute_evidence)
|
37
|
+
end
|
38
|
+
|
39
|
+
# @param [String] dispute_id
|
40
|
+
def get_evidence(dispute_id)
|
41
|
+
api_client.invoke_get(build_path(DISPUTES, dispute_id, EVIDENCE), sdk_authorization)
|
42
|
+
end
|
43
|
+
|
44
|
+
# @param [String] dispute_id
|
45
|
+
def submit_evidence(dispute_id)
|
46
|
+
api_client.invoke_post(build_path(DISPUTES, dispute_id, EVIDENCE), sdk_authorization)
|
47
|
+
end
|
48
|
+
|
49
|
+
# @param [CheckoutSdk::Common::FileRequest] file_request
|
50
|
+
def upload_file(file_request)
|
51
|
+
api_client.submit_file(FILES, sdk_authorization, file_request)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Disputes
|
5
|
+
# @!attribute limit
|
6
|
+
# @return [Integer]
|
7
|
+
# @!attribute skip
|
8
|
+
# @return [Integer]
|
9
|
+
# @!attribute from
|
10
|
+
# @return [DateTime]
|
11
|
+
# @!attribute to
|
12
|
+
# @return [DateTime]
|
13
|
+
# @!attribute id
|
14
|
+
# @return [String]
|
15
|
+
# @!attribute statuses
|
16
|
+
# @return [String] {DisputeStatus}
|
17
|
+
# @!attribute payment_id
|
18
|
+
# @return [String]
|
19
|
+
# @!attribute payment_reference
|
20
|
+
# @return [String]
|
21
|
+
# @!attribute payment_arn
|
22
|
+
# @return [String]
|
23
|
+
# @!attribute this_channel_only
|
24
|
+
# @return [TrueClass, FalseClass]
|
25
|
+
# @!attribute entity_ids
|
26
|
+
# @return [String]
|
27
|
+
# @!attribute sub_entity_ids
|
28
|
+
# @return [String]
|
29
|
+
# @!attribute payment_mcc
|
30
|
+
# @return [String]
|
31
|
+
class DisputesQueryFilter
|
32
|
+
attr_accessor :limit,
|
33
|
+
:skip,
|
34
|
+
:from,
|
35
|
+
:to,
|
36
|
+
:id,
|
37
|
+
:statuses,
|
38
|
+
:payment_id,
|
39
|
+
:payment_reference,
|
40
|
+
:payment_arn,
|
41
|
+
:this_channel_only,
|
42
|
+
:entity_ids,
|
43
|
+
:sub_entity_ids,
|
44
|
+
:payment_mcc
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
# @!attribute base_uri
|
5
|
+
# @return [String]
|
6
|
+
# @!attribute authorization_uri
|
7
|
+
# @return [String]
|
8
|
+
# @!attribute files_uri
|
9
|
+
# @return [String]
|
10
|
+
# @!attribute transfers_uri
|
11
|
+
# @return [String]
|
12
|
+
# @!attribute balances_uri
|
13
|
+
# @return [String]
|
14
|
+
# @!attribute is_sandbox
|
15
|
+
# @return [String]
|
16
|
+
class Environment
|
17
|
+
attr_reader :base_uri,
|
18
|
+
:authorization_uri,
|
19
|
+
:files_uri,
|
20
|
+
:transfers_uri,
|
21
|
+
:balances_uri,
|
22
|
+
:is_sandbox
|
23
|
+
|
24
|
+
# @param [String] base_uri
|
25
|
+
# @param [String] authorization_uri
|
26
|
+
# @param [String] files_uri
|
27
|
+
# @param [String] transfers_uri
|
28
|
+
# @param [String] balances_uri
|
29
|
+
# @param [TrueClass, FalseClass] is_sandbox
|
30
|
+
def initialize(base_uri, authorization_uri, files_uri, transfers_uri, balances_uri, is_sandbox)
|
31
|
+
@base_uri = base_uri
|
32
|
+
@authorization_uri = authorization_uri
|
33
|
+
@files_uri = files_uri
|
34
|
+
@transfers_uri = transfers_uri
|
35
|
+
@balances_uri = balances_uri
|
36
|
+
@is_sandbox = is_sandbox
|
37
|
+
end
|
38
|
+
|
39
|
+
# @return [CheckoutSdk::Environment]
|
40
|
+
def self.sandbox
|
41
|
+
Environment.new('https://api.sandbox.checkout.com/',
|
42
|
+
'https://access.sandbox.checkout.com/connect/token',
|
43
|
+
'https://files.sandbox.checkout.com/',
|
44
|
+
'https://transfers.sandbox.checkout.com/',
|
45
|
+
'https://balances.sandbox.checkout.com/',
|
46
|
+
true)
|
47
|
+
end
|
48
|
+
|
49
|
+
# @return [CheckoutSdk::Environment]
|
50
|
+
def self.production
|
51
|
+
Environment.new('https://api.checkout.com/',
|
52
|
+
'https://access.checkout.com/connect/token',
|
53
|
+
'https://files.checkout.com/',
|
54
|
+
'https://transfers.checkout.com/',
|
55
|
+
'https://balances.checkout.com/',
|
56
|
+
false)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
class CheckoutException < StandardError
|
5
|
+
end
|
6
|
+
|
7
|
+
class CheckoutArgumentException < CheckoutException; end
|
8
|
+
|
9
|
+
class CheckoutAuthorizationException < CheckoutException
|
10
|
+
def self.invalid_authorization(authorization_type)
|
11
|
+
CheckoutAuthorizationException.new("Operation requires #{authorization_type} authorization type")
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.invalid_key(key_type)
|
15
|
+
CheckoutAuthorizationException.new("#{key_type} is required for this operation.")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class CheckoutApiException < CheckoutException
|
20
|
+
attr_reader :http_metadata, :error_details
|
21
|
+
|
22
|
+
def initialize(response)
|
23
|
+
@http_metadata = CheckoutUtils.map_to_http_metadata(response)
|
24
|
+
if !http_metadata.body.nil? && http_metadata.body != ''
|
25
|
+
@error_details = JSON.parse(http_metadata.body, object_class: OpenStruct)
|
26
|
+
end
|
27
|
+
super("The API response status code (#{http_metadata.status_code}) does not indicate success.")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Forex
|
5
|
+
class ForexClient < Client
|
6
|
+
FOREX = 'forex/quotes'
|
7
|
+
private_constant :FOREX
|
8
|
+
|
9
|
+
# @param [ApiClient] api_client
|
10
|
+
# @param [CheckoutConfiguration] configuration
|
11
|
+
def initialize(api_client, configuration)
|
12
|
+
super(api_client, configuration, CheckoutSdk::AuthorizationType::OAUTH)
|
13
|
+
end
|
14
|
+
|
15
|
+
# @param [QuoteRequest] quote_request
|
16
|
+
def request_quote(quote_request)
|
17
|
+
api_client.invoke_post(FOREX, sdk_authorization, quote_request)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Forex
|
5
|
+
# @!attribute source_currency
|
6
|
+
# @return [String] {CheckoutSdk::Common::Currency}
|
7
|
+
# @!attribute source_amount
|
8
|
+
# @return [Integer]
|
9
|
+
# @!attribute destination_currency
|
10
|
+
# @return [String] {CheckoutSdk::Common::Currency}
|
11
|
+
# @!attribute destination_amount
|
12
|
+
# @return [Integer]
|
13
|
+
# @!attribute process_channel_id
|
14
|
+
# @return [String]
|
15
|
+
class QuoteRequest
|
16
|
+
attr_accessor :source_currency,
|
17
|
+
:source_amount,
|
18
|
+
:destination_currency,
|
19
|
+
:destination_amount,
|
20
|
+
:process_channel_id
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
# @!attribute account_type
|
6
|
+
# @return [String] {CheckoutSdk::Common::AccountType}
|
7
|
+
# @!attribute account_number
|
8
|
+
# @return [String]
|
9
|
+
# @!attribute bank_code
|
10
|
+
# @return [String]
|
11
|
+
# @!attribute branch_code
|
12
|
+
# @return [String]
|
13
|
+
# @!attribute iban
|
14
|
+
# @return [String]
|
15
|
+
# @!attribute bban
|
16
|
+
# @return [String]
|
17
|
+
# @!attribute swift_bic
|
18
|
+
# @return [String]
|
19
|
+
# @!attribute currency
|
20
|
+
# @return [String] {CheckoutSdk::Common::Currency}
|
21
|
+
# @!attribute country
|
22
|
+
# @return [String] {CheckoutSdk::Common::Country}
|
23
|
+
# @!attribute processing_channel_id
|
24
|
+
# @return [String]
|
25
|
+
# @!attribute account_holder
|
26
|
+
# @return [CheckoutSdk::Common::AccountHolder]
|
27
|
+
# @!attribute bank
|
28
|
+
# @return [CheckoutSdk::Common::BankDetails]
|
29
|
+
# @!attribute customer
|
30
|
+
# @return [CheckoutSdk::Common::CustomerRequest]
|
31
|
+
class InstrumentBankAccountRequest < InstrumentRequest
|
32
|
+
attr_accessor :account_type,
|
33
|
+
:account_number,
|
34
|
+
:bank_code,
|
35
|
+
:branch_code,
|
36
|
+
:iban,
|
37
|
+
:bban,
|
38
|
+
:swift_bic,
|
39
|
+
:currency,
|
40
|
+
:country,
|
41
|
+
:processing_channel_id,
|
42
|
+
:account_holder,
|
43
|
+
:bank,
|
44
|
+
:customer
|
45
|
+
|
46
|
+
def initialize
|
47
|
+
super CheckoutSdk::Common::InstrumentType::BANK_ACCOUNT
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
# @!attribute type
|
6
|
+
# @return [String] {CheckoutSdk::Common::InstrumentType}
|
7
|
+
class InstrumentRequest
|
8
|
+
attr_reader :type
|
9
|
+
|
10
|
+
# @abstract
|
11
|
+
# @param [String] {CheckoutSdk::Common::InstrumentType}
|
12
|
+
def initialize(type)
|
13
|
+
@type = type
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
# @!attribute token
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute account_holder
|
8
|
+
# @return [CheckoutSdk::Common::AccountHolder]
|
9
|
+
# @!attribute customer
|
10
|
+
# @return [CheckoutSdk::Common::CustomerRequest]
|
11
|
+
class InstrumentTokenRequest < InstrumentRequest
|
12
|
+
attr_accessor :token,
|
13
|
+
:account_holder,
|
14
|
+
:customer
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
super CheckoutSdk::Common::InstrumentType::TOKEN
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
# @!attribute account_holder_type
|
6
|
+
# @return [String] {CheckoutSdk::Common::AccountHolderType}
|
7
|
+
# @!attribute payment_network
|
8
|
+
# @return [String] {PaymentNetwork}
|
9
|
+
class BankAccountFieldQuery
|
10
|
+
attr_accessor :account_holder_type,
|
11
|
+
:payment_network
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Update
|
4
|
+
require 'checkout_sdk/instruments/update/update_instrument_request'
|
5
|
+
require 'checkout_sdk/instruments/update/update_instrument_card_request'
|
6
|
+
require 'checkout_sdk/instruments/update/update_instrument_bank_account_request'
|
7
|
+
require 'checkout_sdk/instruments/update/update_instrument_token_request'
|
8
|
+
# Get
|
9
|
+
require 'checkout_sdk/instruments/get/payment_network'
|
10
|
+
require 'checkout_sdk/instruments/get/bank_account_field_query'
|
11
|
+
# Create
|
12
|
+
require 'checkout_sdk/instruments/create/instrument_request'
|
13
|
+
require 'checkout_sdk/instruments/create/instrument_token_request'
|
14
|
+
require 'checkout_sdk/instruments/create/instrument_bank_account_request'
|
15
|
+
require 'checkout_sdk/instruments/instruments_client'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
class InstrumentsClient < Client
|
6
|
+
INSTRUMENTS = 'instruments'
|
7
|
+
VALIDATION = 'validation/bank-accounts'
|
8
|
+
private_constant :INSTRUMENTS, :VALIDATION
|
9
|
+
|
10
|
+
# @param [ApiClient] api_client
|
11
|
+
# @param [CheckoutConfiguration] configuration
|
12
|
+
def initialize(api_client, configuration)
|
13
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
14
|
+
end
|
15
|
+
|
16
|
+
# @param [CustomerRequest] create_instrument_request
|
17
|
+
def create(create_instrument_request)
|
18
|
+
api_client.invoke_post(INSTRUMENTS, sdk_authorization, create_instrument_request)
|
19
|
+
end
|
20
|
+
|
21
|
+
# @param [String] instrument_id
|
22
|
+
def get(instrument_id)
|
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
|
28
|
+
def update(instrument_id, update_instrument_request)
|
29
|
+
api_client.invoke_patch(build_path(INSTRUMENTS, instrument_id),
|
30
|
+
sdk_authorization,
|
31
|
+
update_instrument_request)
|
32
|
+
end
|
33
|
+
|
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
|
+
# @param [String] country {CheckoutSdk::Common::Country}
|
40
|
+
# @param [String] currency {CheckoutSdk::Common::Currency}
|
41
|
+
# @param [BankAccountFieldQuery] bank_account_field_query
|
42
|
+
def get_bank_account_field_formatting(country, currency, bank_account_field_query)
|
43
|
+
api_client.invoke_get(build_path(VALIDATION, country, currency),
|
44
|
+
sdk_authorization(CheckoutSdk::AuthorizationType::OAUTH),
|
45
|
+
bank_account_field_query)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
# @!attribute account_type
|
6
|
+
# @return [String] {CheckoutSdk::Common::AccountType}
|
7
|
+
# @!attribute account_number
|
8
|
+
# @return [String]
|
9
|
+
# @!attribute bank_code
|
10
|
+
# @return [String]
|
11
|
+
# @!attribute branch_code
|
12
|
+
# @return [String]
|
13
|
+
# @!attribute iban
|
14
|
+
# @return [String]
|
15
|
+
# @!attribute bban
|
16
|
+
# @return [String]
|
17
|
+
# @!attribute swift_bic
|
18
|
+
# @return [String]
|
19
|
+
# @!attribute currency
|
20
|
+
# @return [String] {CheckoutSdk::Common::Currency}
|
21
|
+
# @!attribute country
|
22
|
+
# @return [String] {CheckoutSdk::Common::Country}
|
23
|
+
# @!attribute processing_channel_id
|
24
|
+
# @return [String]
|
25
|
+
# @!attribute account_holder
|
26
|
+
# @return [CheckoutSdk::Common::AccountHolder]
|
27
|
+
# @!attribute bank
|
28
|
+
# @return [CheckoutSdk::Common::BankDetails]
|
29
|
+
# @!attribute customer
|
30
|
+
# @return [CheckoutSdk::Common::CustomerRequest]
|
31
|
+
class UpdateInstrumentBankAccountRequest < UpdateInstrumentRequest
|
32
|
+
attr_accessor :account_type,
|
33
|
+
:account_number,
|
34
|
+
:bank_code,
|
35
|
+
:branch_code,
|
36
|
+
:iban,
|
37
|
+
:bban,
|
38
|
+
:swift_bic,
|
39
|
+
:currency,
|
40
|
+
:country,
|
41
|
+
:processing_channel_id,
|
42
|
+
:account_holder,
|
43
|
+
:bank,
|
44
|
+
:customer
|
45
|
+
|
46
|
+
def initialize
|
47
|
+
super CheckoutSdk::Common::InstrumentType::BANK_ACCOUNT
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
# @!attribute expiry_month
|
6
|
+
# @return [Integer]
|
7
|
+
# @!attribute expiry_year
|
8
|
+
# @return [Integer]
|
9
|
+
# @!attribute name
|
10
|
+
# @return [String]
|
11
|
+
# @!attribute account_holder
|
12
|
+
# @return [CheckoutSdk::Common::AccountHolder]
|
13
|
+
# @!attribute customer
|
14
|
+
# @return [CheckoutSdk::Common::UpdateCustomerRequest]
|
15
|
+
class UpdateInstrumentCardRequest < UpdateInstrumentRequest
|
16
|
+
attr_accessor :expiry_month,
|
17
|
+
:expiry_year,
|
18
|
+
:name,
|
19
|
+
:account_holder,
|
20
|
+
:customer
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
super CheckoutSdk::Common::InstrumentType::CARD
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
# @!attribute type
|
6
|
+
# @return [String] {CheckoutSdk::Common::InstrumentType}
|
7
|
+
class UpdateInstrumentRequest
|
8
|
+
attr_reader :type
|
9
|
+
|
10
|
+
# @abstract
|
11
|
+
# @param [String] {CheckoutSdk::Common::InstrumentType}
|
12
|
+
def initialize(type)
|
13
|
+
@type = type
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Instruments
|
5
|
+
# @!attribute token
|
6
|
+
# @return [String]
|
7
|
+
class UpdateInstrumentTokenRequest < UpdateInstrumentRequest
|
8
|
+
attr_accessor :token
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
super CheckoutSdk::Common::InstrumentType::TOKEN
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|