├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── build-master.yml │ ├── build-pull-request.yml │ ├── build-release.yml │ └── codeql-analysis.yml ├── .gitignore ├── .rspec ├── .rubocop.yml ├── CODE_OF_CONDUCT.md ├── Gemfile ├── LICENSE.md ├── README.md ├── Rakefile ├── bin ├── console └── setup ├── checkout_sdk.gemspec ├── lib ├── checkout_sdk.rb └── checkout_sdk │ ├── abstract_checkout_sdk_builder.rb │ ├── accounts │ ├── account_holder.rb │ ├── account_holder_corporate.rb │ ├── account_holder_individual.rb │ ├── accounts.rb │ ├── accounts_client.rb │ ├── additional_document.rb │ ├── additional_info.rb │ ├── articles_of_association_type.rb │ ├── bank_verification.rb │ ├── bank_verification_type.rb │ ├── business_type.rb │ ├── company.rb │ ├── company_verification.rb │ ├── company_verification_type.rb │ ├── contact_details.rb │ ├── date_of_birth.rb │ ├── date_of_incorporation.rb │ ├── document.rb │ ├── document_type.rb │ ├── entity_document.rb │ ├── entity_email_addresses.rb │ ├── entity_financial_details.rb │ ├── entity_financial_documents.rb │ ├── file_request.rb │ ├── financial_verification.rb │ ├── financial_verification_type.rb │ ├── headers.rb │ ├── identification.rb │ ├── individual.rb │ ├── instrument_details.rb │ ├── instrument_details_card_token.rb │ ├── instrument_details_faster_payments.rb │ ├── instrument_details_sepa.rb │ ├── instrument_document.rb │ ├── invitee.rb │ ├── onboard_entity.rb │ ├── onboard_sub_entity_documents.rb │ ├── payment_instrument.rb │ ├── payment_instrument_request.rb │ ├── payment_instruments_query.rb │ ├── phone.rb │ ├── place_of_birth.rb │ ├── processing_details.rb │ ├── profile.rb │ ├── proof_of_legality.rb │ ├── proof_of_legality_type.rb │ ├── proof_of_principal_address.rb │ ├── proof_of_principal_address_type.rb │ ├── representative.rb │ ├── schedule_frequency_daily.rb │ ├── schedule_frequency_monthly.rb │ ├── schedule_frequency_type.rb │ ├── schedule_frequency_weekly.rb │ ├── schedule_request.rb │ ├── shareholder_structure.rb │ ├── shareholder_structure_type.rb │ ├── tax_verification.rb │ ├── tax_verification_type.rb │ ├── update_payment_instrument_request.rb │ └── update_schedule.rb │ ├── api_client.rb │ ├── apm │ ├── apm.rb │ ├── ideal │ │ └── ideal_client.rb │ └── previous │ │ ├── klarna │ │ ├── credit_session_request.rb │ │ ├── klarna.rb │ │ ├── klarna_client.rb │ │ ├── klarna_product.rb │ │ └── order_capture_request.rb │ │ └── sepa │ │ └── sepa_client.rb │ ├── authorization_type.rb │ ├── balances │ ├── balances.rb │ └── balances_client.rb │ ├── checkout_api.rb │ ├── checkout_configuration.rb │ ├── checkout_oauth_sdk_builder.rb │ ├── checkout_sdk_builder.rb │ ├── checkout_static_keys_sdk_builder.rb │ ├── checkout_utils.rb │ ├── client.rb │ ├── common │ ├── account_change_indicator_type.rb │ ├── account_holder.rb │ ├── account_holder_identification.rb │ ├── account_holder_identification_type.rb │ ├── account_holder_type.rb │ ├── account_password_change_indicator_type.rb │ ├── account_type.rb │ ├── account_type_card_product_type.rb │ ├── address.rb │ ├── amount_allocations.rb │ ├── bank_details.rb │ ├── cardholder_account_age_indicator_type.rb │ ├── challenge_indicator.rb │ ├── commission.rb │ ├── common.rb │ ├── country.rb │ ├── currency.rb │ ├── customer_request.rb │ ├── customer_retry.rb │ ├── date_range_query_filter.rb │ ├── destination.rb │ ├── file_purpose.rb │ ├── file_request.rb │ ├── instrument_type.rb │ ├── marketplace_data.rb │ ├── payment_source_type.rb │ ├── phone.rb │ ├── product.rb │ ├── shipping_info.rb │ └── update_customer_request.rb │ ├── customers │ ├── customer_request.rb │ ├── customers.rb │ └── customers_client.rb │ ├── disputes │ ├── dispute_evidence_request.rb │ ├── dispute_status.rb │ ├── disputes.rb │ ├── disputes_client.rb │ └── disputes_query_filter.rb │ ├── environment.rb │ ├── environment_subdomain.rb │ ├── error.rb │ ├── events │ ├── events.rb │ ├── events_client.rb │ └── events_query_filter.rb │ ├── financial │ ├── financial.rb │ ├── financial_actions_query.rb │ └── financial_client.rb │ ├── forex │ ├── forex.rb │ ├── forex_client.rb │ ├── forex_source.rb │ ├── quote_request.rb │ └── rates_query_filter.rb │ ├── forward │ ├── forward.rb │ └── forward_client.rb │ ├── http_metadata.rb │ ├── instruments │ ├── base_instruments_client.rb │ ├── create │ │ ├── instrument.rb │ │ ├── instrument_bank_account.rb │ │ ├── instrument_data.rb │ │ ├── instrument_sepa.rb │ │ └── instrument_token.rb │ ├── get │ │ ├── bank_account_field_query.rb │ │ └── payment_network.rb │ ├── instruments.rb │ ├── instruments_client.rb │ ├── previous │ │ ├── create │ │ │ └── instrument.rb │ │ ├── instruments_client.rb │ │ └── update │ │ │ └── update_instrument.rb │ └── update │ │ ├── update_instrument.rb │ │ ├── update_instrument_bank_account.rb │ │ ├── update_instrument_card.rb │ │ └── update_instrument_token.rb │ ├── issuing │ ├── issuing.rb │ └── issuing_client.rb │ ├── json_serializer.rb │ ├── metadata │ ├── metadata.rb │ ├── metadata_client.rb │ ├── metadata_format.rb │ ├── metadata_request.rb │ └── source │ │ ├── bin_metadata_source.rb │ │ ├── card_metadata_source.rb │ │ ├── id_metadata_source.rb │ │ ├── metadata_source.rb │ │ ├── metadata_source_type.rb │ │ └── token_metadata_source.rb │ ├── oauth_access_token.rb │ ├── oauth_scopes.rb │ ├── oauth_sdk_credentials.rb │ ├── payments │ ├── airline_data.rb │ ├── applepay.rb │ ├── authorization_request.rb │ ├── authorization_type.rb │ ├── base_payments_client.rb │ ├── billing_descriptor.rb │ ├── billing_information.rb │ ├── billing_plan.rb │ ├── billing_plan_type.rb │ ├── capture_request.rb │ ├── capture_type.rb │ ├── card.rb │ ├── charge_bearer.rb │ ├── contexts │ │ └── payment_contexts_client.rb │ ├── d_local_installments.rb │ ├── d_local_processing_settings.rb │ ├── destination │ │ ├── bank_account_destination.rb │ │ ├── card_destination.rb │ │ ├── destination.rb │ │ ├── destination_type.rb │ │ ├── id_destination.rb │ │ └── token_destination.rb │ ├── exemption.rb │ ├── flight_leg_details.rb │ ├── googlepay.rb │ ├── hosted │ │ ├── hosted_payment_instruction.rb │ │ ├── hosted_payments_client.rb │ │ ├── hosted_payments_session.rb │ │ └── payment_purpose_type.rb │ ├── instruction_scheme.rb │ ├── links │ │ ├── payment_link.rb │ │ └── payments_links_client.rb │ ├── locale_type.rb │ ├── merchant_initiated_reason.rb │ ├── network_token_type.rb │ ├── os_type.rb │ ├── partial_authorization.rb │ ├── passenger.rb │ ├── passenger_name.rb │ ├── payer.rb │ ├── payment_instruction.rb │ ├── payment_method_configuration.rb │ ├── payment_method_details.rb │ ├── payment_recipient.rb │ ├── payment_request.rb │ ├── payment_retry_request.rb │ ├── payment_segment.rb │ ├── payment_type.rb │ ├── payments.rb │ ├── payments_client.rb │ ├── payments_query_filter.rb │ ├── payout_billing_descriptor.rb │ ├── payout_request.rb │ ├── preferred_schema.rb │ ├── previous │ │ ├── capture_request.rb │ │ ├── destination │ │ │ ├── card_destination.rb │ │ │ ├── destination.rb │ │ │ ├── id_destination.rb │ │ │ └── token_destination.rb │ │ ├── fund_transfer_type.rb │ │ ├── payment_request.rb │ │ ├── payments_client.rb │ │ ├── payout_request.rb │ │ └── source │ │ │ ├── apm │ │ │ ├── alipay_source.rb │ │ │ ├── alma_source.rb │ │ │ ├── bancontact_source.rb │ │ │ ├── benefit_pay_source.rb │ │ │ ├── boleto_source.rb │ │ │ ├── eps_source.rb │ │ │ ├── fawry_source.rb │ │ │ ├── giropay_source.rb │ │ │ ├── ideal_source.rb │ │ │ ├── integration_type.rb │ │ │ ├── klarna_source.rb │ │ │ ├── knet_source.rb │ │ │ ├── multi_banco_source.rb │ │ │ ├── oxxo_source.rb │ │ │ ├── p24_source.rb │ │ │ ├── pago_facil_source.rb │ │ │ ├── paypal_source.rb │ │ │ ├── poli_source.rb │ │ │ ├── qpay_source.rb │ │ │ ├── rapi_pago_source.rb │ │ │ └── sofort_source.rb │ │ │ ├── card_source.rb │ │ │ ├── customer_source.rb │ │ │ ├── d_local_source.rb │ │ │ ├── id_source.rb │ │ │ ├── network_token_source.rb │ │ │ ├── payment_source.rb │ │ │ └── token_source.rb │ ├── processing_settings.rb │ ├── product.rb │ ├── product_type.rb │ ├── refund_order.rb │ ├── refund_request.rb │ ├── reverse_request.rb │ ├── risk_request.rb │ ├── sender │ │ ├── corporate_sender.rb │ │ ├── government_sender.rb │ │ ├── individual_sender.rb │ │ ├── instrument_sender.rb │ │ ├── sender.rb │ │ ├── sender_information.rb │ │ ├── sender_type.rb │ │ ├── source_of_funds.rb │ │ └── ticket.rb │ ├── sessions │ │ ├── payment_methods_type.rb │ │ ├── payment_sessions_client.rb │ │ ├── payment_sessions_request.rb │ │ └── store_payment_details_type.rb │ ├── shipping_details.rb │ ├── shipping_preference.rb │ ├── source │ │ ├── apm │ │ │ ├── ach_source.rb │ │ │ ├── after_pay_source.rb │ │ │ ├── alipay_plus_source.rb │ │ │ ├── alma_source.rb │ │ │ ├── bancontact_source.rb │ │ │ ├── benefit_source.rb │ │ │ ├── bizum_source.rb │ │ │ ├── cv_connect_source.rb │ │ │ ├── eps_source.rb │ │ │ ├── fawry_product.rb │ │ │ ├── fawry_source.rb │ │ │ ├── giropay_source.rb │ │ │ ├── ideal_source.rb │ │ │ ├── illicado_source.rb │ │ │ ├── klarna_source.rb │ │ │ ├── knet_source.rb │ │ │ ├── mbway_source.rb │ │ │ ├── multi_banco_source.rb │ │ │ ├── octopus_source.rb │ │ │ ├── p24_source.rb │ │ │ ├── paypal_source.rb │ │ │ ├── plaid_source.rb │ │ │ ├── post_finance_source.rb │ │ │ ├── qpay_source.rb │ │ │ ├── sepa_source.rb │ │ │ ├── sequra_source.rb │ │ │ ├── sofort_source.rb │ │ │ ├── stcpay_source.rb │ │ │ ├── tamara_source.rb │ │ │ ├── trustly_source.rb │ │ │ └── we_chat_pay_source.rb │ │ ├── bank_account_source.rb │ │ ├── card_source.rb │ │ ├── currency_account_source.rb │ │ ├── customer_source.rb │ │ ├── entity_source.rb │ │ ├── id_source.rb │ │ ├── network_token_source.rb │ │ ├── payment_source.rb │ │ ├── payout_source.rb │ │ ├── payout_source_type.rb │ │ ├── provider_token_source.rb │ │ └── token_source.rb │ ├── terminal_type.rb │ ├── three_ds_flow_type.rb │ ├── three_ds_request.rb │ ├── user_action.rb │ └── void_request.rb │ ├── platform_type.rb │ ├── previous │ ├── checkout_api.rb │ ├── checkout_previous_sdk_builder.rb │ ├── checkout_previous_static_keys_sdk_builder.rb │ └── previous_static_keys_sdk_credentials.rb │ ├── reconciliation │ ├── reconciliation.rb │ ├── reconciliation_client.rb │ └── reconciliation_query_payments_filter.rb │ ├── reports │ ├── reports.rb │ ├── reports_client.rb │ └── reports_query.rb │ ├── risk │ ├── authentication_result.rb │ ├── authorization_result.rb │ ├── device.rb │ ├── location.rb │ ├── pre_authentication_assessment.rb │ ├── pre_capture_assessment.rb │ ├── risk.rb │ ├── risk_client.rb │ ├── risk_payment.rb │ ├── risk_shipping_details.rb │ └── source │ │ ├── card_source.rb │ │ ├── customer_source.rb │ │ ├── id_source.rb │ │ ├── risk_payment_source.rb │ │ └── token_source.rb │ ├── sdk_authorization.rb │ ├── sdk_credentials.rb │ ├── sessions │ ├── authentication_method.rb │ ├── authentication_type.rb │ ├── card_holder_account_info.rb │ ├── category.rb │ ├── channel │ │ ├── app_session.rb │ │ ├── browser_session.rb │ │ ├── channel_data.rb │ │ ├── channel_data_type.rb │ │ ├── merchant_initiated_session.rb │ │ ├── request_type.rb │ │ ├── sdk_ephemeral_public_key.rb │ │ ├── sdk_interface_type.rb │ │ ├── three_ds_method_completion.rb │ │ └── uie_elements.rb │ ├── completion │ │ ├── completion_info.rb │ │ ├── completion_info_type.rb │ │ ├── hosted_completion_info.rb │ │ └── non_hosted_completion_info.rb │ ├── delivery_timeframe.rb │ ├── initial_transaction.rb │ ├── installment.rb │ ├── merchant_risk_info.rb │ ├── optimization.rb │ ├── optimized_properties.rb │ ├── pre_order_purchase_indicator_type.rb │ ├── recurring.rb │ ├── reorder_items_indicator_type.rb │ ├── session_address.rb │ ├── session_marketplace_data.rb │ ├── session_request.rb │ ├── session_secret_credentials.rb │ ├── session_source_type.rb │ ├── sessions.rb │ ├── sessions_billing_descriptor.rb │ ├── sessions_client.rb │ ├── shipping_indicator.rb │ ├── source │ │ ├── card_source.rb │ │ ├── id_source.rb │ │ ├── network_token_source.rb │ │ ├── session_scheme.rb │ │ ├── session_source.rb │ │ └── token_source.rb │ ├── three_ds_method_completion_request.rb │ ├── three_ds_req_auth_method.rb │ ├── three_ds_requestor_authentication_info.rb │ └── transaction_type.rb │ ├── simple_logger.rb │ ├── sources │ ├── mandate_type.rb │ ├── sepa_source_request.rb │ ├── source_data.rb │ ├── source_request.rb │ ├── source_type.rb │ ├── sources.rb │ └── sources_client.rb │ ├── static_keys_builder.rb │ ├── static_keys_sdk_credentials.rb │ ├── tokens │ ├── apple_pay_token_data.rb │ ├── apple_pay_token_request.rb │ ├── card_token_request.rb │ ├── google_pay_token_data.rb │ ├── google_pay_token_request.rb │ ├── token_type.rb │ ├── tokens.rb │ ├── tokens_client.rb │ └── wallet_token_request.rb │ ├── transfers │ ├── create_transfer.rb │ ├── transfer_destination.rb │ ├── transfer_source.rb │ ├── transfer_type.rb │ ├── transfers.rb │ └── transfers_client.rb │ ├── version.rb │ ├── webhooks │ ├── webhook_request.rb │ ├── webhooks.rb │ └── webhooks_client.rb │ └── workflows │ ├── create_workflow.rb │ ├── entity_workflow_condition.rb │ ├── event_workflow_condition.rb │ ├── patch_workflow.rb │ ├── processing_channel_workflow_condition.rb │ ├── reflow.rb │ ├── reflow_by_events.rb │ ├── reflow_by_subjects.rb │ ├── webhook_signature.rb │ ├── webhook_workflow_action.rb │ ├── workflow_action.rb │ ├── workflow_action_type.rb │ ├── workflow_condition.rb │ ├── workflow_condition_type.rb │ ├── workflows.rb │ └── workflows_client.rb ├── sig └── checkout_sdk.rbs └── spec ├── checkout_sdk ├── accounts │ └── accounts_integration_spec.rb ├── api_client_spec.rb ├── apm │ ├── ideal │ │ └── ideal_client_spec.rb │ └── previous │ │ ├── klarna │ │ ├── klarna_client_integration_spec.rb │ │ └── klarna_client_spec.rb │ │ └── sepa │ │ └── sepa_client_spec.rb ├── balances │ └── balances_integration_spec.rb ├── configuration │ ├── configuration_spec.rb │ └── static_keys_sdk_credentials_spec.rb ├── customers │ ├── customers_integration_spec.rb │ └── previous │ │ └── customers_integration_spec.rb ├── disputes │ ├── disputes_integration_spec.rb │ └── previous │ │ └── disputes_integration_spec.rb ├── events │ └── events_integration_spec.rb ├── financial │ └── financial_integration_spec.rb ├── forex │ └── forex_integration_spec.rb ├── forward │ └── forward_integration_spec.rb ├── instruments │ ├── instruments_integration_spec.rb │ └── previous │ │ └── instruments_integration_spec.rb ├── issuing │ ├── card_issuing_integration_spec.rb │ ├── cardholders_issuing_integration_spec.rb │ ├── controls_issuing_integration_spec.rb │ ├── issuing_helper.rb │ └── testing_issuing_integration_spec.rb ├── json_serializer_spec.rb ├── metadata │ └── metadata_integration_spec.rb ├── oauth_sdk_spec.rb ├── payments │ ├── capture_payments_integration_spec.rb │ ├── contexts │ │ ├── contexts_helper.rb │ │ └── contexts_integration_spec.rb │ ├── get_payment_details_integration_spec.rb │ ├── get_payments_list_integration_spec.rb │ ├── hosted │ │ ├── hosted_payments_integration_spec.rb │ │ └── previous │ │ │ └── hosted_payments_integration_spec.rb │ ├── increment_payment_authorizations_integration_spec.rb │ ├── links │ │ ├── payment_links_integration_spec.rb │ │ └── previous │ │ │ └── payment_links_integrattion_spec.rb │ ├── payment_actions_integration_spec.rb │ ├── payments_helper.rb │ ├── previous │ │ ├── capture_payments_integration_spec.rb │ │ ├── get_payment_details_integration_spec.rb │ │ ├── get_payments_list_integration_spec.rb │ │ ├── payment_actions_integration_spec.rb │ │ ├── payments_helper.rb │ │ ├── refund_payments_integration_spec.rb │ │ ├── request_apm_payments_integration_spec.rb │ │ ├── request_payments_integration_spec.rb │ │ ├── request_payouts_integration_spec.rb │ │ └── void_payments_integration_spec.rb │ ├── refund_payments_integration_spec.rb │ ├── request_apm_payments_integration_spec.rb │ ├── request_payments_integration_spec.rb │ ├── reverse_payments_integration_spec.rb │ ├── sessions │ │ ├── sessions_helper.rb │ │ └── sessions_integration_spec.rb │ └── void_payments_integration_spec.rb ├── reconciliation │ └── reconciliation_integration_spec.rb ├── reports │ └── reports_integration_spec.rb ├── risk │ ├── previous │ │ └── risk_integration_spec.rb │ └── risk_integration_spec.rb ├── sessions │ ├── sessions_helper.rb │ └── sessions_integration_spec.rb ├── sources │ └── previous │ │ └── sources_integration_spec.rb ├── tokens │ ├── previous │ │ └── tokens_integration_spec.rb │ └── tokens_integration_spec.rb ├── transfers │ └── transfers_integration_spec.rb ├── webhooks │ ├── webhooks_helper.rb │ └── webhooks_integration_spec.rb └── workflows │ ├── workflows_actions_integration_spec.rb │ ├── workflows_events_integration_spec.rb │ ├── workflows_helper.rb │ ├── workflows_integration_spec.rb │ └── workflows_reflow_integration_spec.rb ├── checkout_sdk_spec.rb ├── resources ├── checkout.jpeg └── checkout.pdf ├── spec_helper.rb └── support ├── data_factory.rb └── sandbox_test_fixture.rb /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Feature request" 3 | about: Request a new future or an improvement to an existing feature 4 | --- 5 | 6 | 7 | 8 | 9 | ### Environment 10 | 11 | * Checkout SDK version: 12 | * Platform and version: 13 | * Operating System and version: 14 | 15 | 16 | ### Description 17 | 18 | 19 | 20 | ## Proposed Solution 21 | 22 | 23 | 24 | 25 | - [ ] I may be able to implement this feature 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *.lock 3 | 4 | /vendor/ 5 | /.bundle/ 6 | /.yardoc 7 | /_yardoc/ 8 | /coverage/ 9 | /doc/ 10 | /pkg/ 11 | /spec/reports/ 12 | /tmp/ 13 | 14 | # rspec failure tracking 15 | .rspec_status 16 | .idea 17 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | --require spec_helper 4 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | NewCops: enable 3 | 4 | Metrics/AbcSize: 5 | Enabled: false 6 | 7 | Lint/MissingSuper: 8 | Enabled: false 9 | 10 | Lint/EmptyClass: 11 | Enabled: false 12 | 13 | Layout/LineLength: 14 | Max: 120 15 | 16 | Metrics/ModuleLength: 17 | Max: 260 18 | 19 | Metrics/MethodLength: 20 | Max: 25 21 | 22 | Metrics/ParameterLists: 23 | Max: 10 24 | 25 | Metrics/ClassLength: 26 | Max: 120 27 | 28 | Metrics/CyclomaticComplexity: 29 | Max: 10 30 | 31 | Metrics/PerceivedComplexity: 32 | Max: 9 33 | 34 | Style/Documentation: 35 | Enabled: false 36 | 37 | Style/OpenStructUse: 38 | Enabled: false 39 | 40 | Naming/MethodName: 41 | Exclude: 42 | - "**/google_pay_token_data*" 43 | - "**/sofort_source*" 44 | - "**/processing_settings*" -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | # Specify your gem's dependencies in checkout_sdk.gemspec 6 | gemspec -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "bundler/gem_tasks" 4 | require "rspec/core/rake_task" 5 | 6 | RSpec::Core::RakeTask.new(:spec) 7 | 8 | task default: :spec 9 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require "bundler/setup" 5 | require "checkout_sdk" 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require "irb" 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | # Do any other automated setup that you need to do here 9 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/account_holder_corporate.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute company_name 6 | # @return [String] 7 | class AccountHolderCorporate < AccountHolder 8 | attr_accessor :company_name 9 | 10 | def initialize 11 | super AccountHolderType::CORPORATE 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/account_holder_individual.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute first_name 6 | # @return [String] 7 | # @!attribute last_name 8 | # @return [String] 9 | class AccountHolderIndividual < AccountHolder 10 | attr_accessor :first_name, 11 | :last_name 12 | 13 | def initialize 14 | super AccountHolderType::INDIVIDUAL 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/additional_document.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute front 6 | # @return [String] 7 | class AdditionalDocument 8 | attr_accessor :front 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/additional_info.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute field1 6 | # @return [String] 7 | # @!attribute field2 8 | # @return [String] 9 | # @!attribute field3 10 | # @return [String] 11 | class AdditionalInfo 12 | attr_accessor :field1, 13 | :field2, 14 | :field3 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/articles_of_association_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module ArticlesOfAssociationType 6 | MEMORANDUM_OF_ASSOCIATION = 'memorandum_of_association' 7 | ARTICLES_OF_ASSOCIATION = 'articles_of_association' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/bank_verification.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [BankVerificationType] 7 | # @!attribute front 8 | # @return [String] 9 | class BankVerification 10 | attr_accessor :type, 11 | :front 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/bank_verification_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module BankVerificationType 6 | BANK_STATEMENT = 'bank_statement' 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/business_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module BusinessType 6 | GENERAL_PARTNERSHIP = 'general_partnership' 7 | LIMITED_PARTNERSHIP = 'limited_partnership' 8 | PUBLIC_LIMITED_COMPANY = 'public_limited_company' 9 | LIMITED_COMPANY = 'limited_company' 10 | PROFESSIONAL_ASSOCIATION = 'professional_association' 11 | UNINCORPORATED_ASSOCIATION = 'unincorporated_association' 12 | AUTO_ENTREPRENEUR = 'auto_entrepreneur' 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/company_verification.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [String] {CompanyVerificationType} 7 | # @!attribute front 8 | # @return [String] 9 | class CompanyVerification 10 | attr_accessor :type, 11 | :front 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/company_verification_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module CompanyVerificationType 6 | INCORPORATION_DOCUMENT = 'incorporation_document' 7 | ARTICLES_OF_ASSOCIATION = 'articles_of_association' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/contact_details.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute phone 6 | # @return [Phone] 7 | # @!attribute email_addresses 8 | # @return [EntityEmailAddresses] 9 | # @!attribute invitee 10 | # @return [Invitee] 11 | class ContactDetails 12 | attr_accessor :phone, 13 | :email_addresses, 14 | :invitee 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/date_of_birth.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute day 6 | # @return [Integer] 7 | # @!attribute month 8 | # @return [Integer] 9 | # @!attribute year 10 | # @return [Integer] 11 | class DateOfBirth 12 | attr_accessor :day, 13 | :month, 14 | :year 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/date_of_incorporation.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute month 6 | # @return [Integer] 7 | # @!attribute year 8 | # @return [Integer] 9 | class DateOfIncorporation 10 | attr_reader :month, 11 | :year 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/document.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [String] {DocumentType} 7 | # @!attribute front 8 | # @return [String] 9 | # @!attribute back 10 | # @return [String] 11 | class Document 12 | attr_accessor :type, 13 | :front, 14 | :back 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/document_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module DocumentType 6 | PASSPORT = 'passport' 7 | NATIONAL_IDENTITY_CARD = 'national_identity_card' 8 | DRIVING_LICENSE = 'driving_license' 9 | CITIZEN_CARD = 'citizen_card' 10 | RESIDENCE_PERMIT = 'residence_permit' 11 | ELECTORAL_ID = 'electoral_id' 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/entity_document.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [String] 7 | # @!attribute file_id 8 | # @return [String] 9 | class EntityDocument 10 | attr_accessor :type, 11 | :file_id 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/entity_email_addresses.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute primary 6 | # @return [String] 7 | class EntityEmailAddresses 8 | attr_accessor :primary 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/entity_financial_details.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute annual_processing_volume 6 | # @return [Integer] 7 | # @!attribute average_transaction_value 8 | # @return [Integer] 9 | # @!attribute highest_transaction_value 10 | # @return [Integer] 11 | # @!attribute documents 12 | # @return [EntityFinancialDocuments] 13 | # @!attribute currency 14 | # @return [String] {CheckoutSdk::Common::Currency} 15 | class EntityFinancialDetails 16 | attr_accessor :annual_processing_volume, 17 | :average_transaction_value, 18 | :highest_transaction_value, 19 | :documents, 20 | :currency 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/entity_financial_documents.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute bank_statement 6 | # @return [EntityDocument] 7 | # @!attribute financial_statement 8 | # @return [EntityDocument] 9 | class EntityFinancialDocuments 10 | attr_accessor :bank_statement, 11 | :financial_statement 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/file_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | class FileRequest < CheckoutSdk::Common::FileRequest 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/financial_verification.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [FinancialVerificationType] 7 | # @!attribute front 8 | # @return [String] 9 | class FinancialVerification 10 | attr_reader :type, 11 | :front 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/financial_verification_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module FinancialVerificationType 6 | FINANCIAL_STATEMENT = 'financial_statement' 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/headers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute if_match 6 | # @return [String] 7 | class Headers 8 | attr_accessor :if_match 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/identification.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute national_id_number 6 | # @return [String] 7 | # @!attribute document 8 | # @return [Document] 9 | class Identification 10 | attr_accessor :national_id_number, 11 | :document 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/instrument_details.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @abstract 6 | class InstrumentDetails 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/instrument_details_card_token.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute token 6 | # @return [String] 7 | class InstrumentDetailsCardToken < InstrumentDetails 8 | attr_accessor :token 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/instrument_details_faster_payments.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute account_number 6 | # @return [String] 7 | # @!attribute bank_code 8 | # @return [String] 9 | class InstrumentDetailsFasterPayments < InstrumentDetails 10 | attr_accessor :account_number, 11 | :bank_code 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/instrument_details_sepa.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute iban 6 | # @return [String] 7 | # @!attribute swift_bic 8 | # @return [String] 9 | class InstrumentDetailsSepa < InstrumentDetails 10 | attr_accessor :iban, 11 | :swift_bic 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/instrument_document.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [String] 7 | # @!attribute file_id 8 | # @return [String] 9 | class InstrumentDocument 10 | attr_accessor :type, 11 | :file_id 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/invitee.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute email 6 | # @return [String] 7 | class Invitee 8 | attr_accessor :email 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/payment_instruments_query.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute status 6 | # @return [String] 7 | class PaymentInstrumentsQuery 8 | attr_accessor :status 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/phone.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute number 6 | # @return [String] 7 | class Phone 8 | attr_accessor :number 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/place_of_birth.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute country 6 | # @return [String] {CheckoutSdk::Common::Country} 7 | class PlaceOfBirth 8 | attr_accessor :country 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/processing_details.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute settlement_country 6 | # @return [String] 7 | # @!attribute target_countries 8 | # @return [Array(String)] 9 | # @!attribute annual_processing_volume 10 | # @return [Integer] 11 | # @!attribute average_transaction_value 12 | # @return [Integer] 13 | # @!attribute highest_transaction_value 14 | # @return [Integer] 15 | # @!attribute currency 16 | # @return [CheckoutSdk::Common::Currency] 17 | class ProcessingDetails 18 | attr_accessor :settlement_country, 19 | :target_countries, 20 | :annual_processing_volume, 21 | :average_transaction_value, 22 | :highest_transaction_value, 23 | :currency 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/profile.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute urls 6 | # @return [Array(String)] 7 | # @!attribute mccs 8 | # @return [Array(String)] 9 | # @!attribute default_holding_currency 10 | # @return [String] {CheckoutSdk::Common::Currency} 11 | # @!attribute holding_currencies 12 | # @return [Array(CheckoutSdk::Common::Currency)] 13 | class Profile 14 | attr_accessor :urls, 15 | :mccs, 16 | :default_holding_currency, 17 | :holding_currencies 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/proof_of_legality.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [ProofOfLegalityType] 7 | # @!attribute front 8 | # @return [String] 9 | class ProofOfLegality 10 | attr_accessor :type, 11 | :front 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/proof_of_legality_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module ProofOfLegalityType 6 | PROOF_OF_LEGALITY = 'proof_of_legality' 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/proof_of_principal_address.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [ProofOfPrincipalAddressType] 7 | # @!attribute front 8 | # @return [String] 9 | class ProofOfPrincipalAddress 10 | attr_reader :type, 11 | :front 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/proof_of_principal_address_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module ProofOfPrincipalAddressType 6 | PROOF_OF_ADDRESS = 'proof_of_address' 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/schedule_frequency_daily.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | class ScheduleFrequencyDaily < ScheduleRequest 6 | def initialize 7 | super ScheduleFrequencyType::DAILY 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/schedule_frequency_monthly.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute by_month_day 6 | # @return [Array(Integer)] 7 | class ScheduleFrequencyMonthly < ScheduleRequest 8 | attr_accessor :by_month_day 9 | 10 | def initialize 11 | super ScheduleFrequencyType::MONTHLY 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/schedule_frequency_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module ScheduleFrequencyType 6 | WEEKLY = 'Weekly' 7 | DAILY = 'Daily' 8 | MONTHLY = 'Monthly' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/schedule_frequency_weekly.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute by_day 6 | # @return [Array(String)] 7 | class ScheduleFrequencyWeekly < ScheduleRequest 8 | attr_accessor :by_day 9 | 10 | def initialize 11 | super ScheduleFrequencyType::WEEKLY 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/schedule_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute frequency 6 | # @return [String] {ScheduleFrequencyType} 7 | class ScheduleRequest 8 | attr_reader :frequency 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] frequency {ScheduleFrequencyType} 14 | def initialize(frequency) 15 | @frequency = frequency 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/shareholder_structure.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [ShareholderStructureType] 7 | # @!attribute front 8 | # @return [String] 9 | class ShareholderStructure 10 | attr_accessor :type, 11 | :front 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/shareholder_structure_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module ShareholderStructureType 6 | CERTIFIED_SHAREHOLDER_STRUCTURE = 'certified_shareholder_structure' 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/tax_verification.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute type 6 | # @return [String] {TaxVerificationType} 7 | # @!attribute front 8 | # @return [String] 9 | class TaxVerification 10 | attr_accessor :type, 11 | :front 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/tax_verification_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | module TaxVerificationType 6 | EIN_LETTER = 'ein_letter' 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/update_payment_instrument_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute label 6 | # @return [String] 7 | # @!attribute default 8 | # @return [TrueClass, FalseClass] 9 | # @!attribute headers 10 | # @return [Headers] 11 | class UpdatePaymentInstrumentRequest 12 | attr_accessor :label, 13 | :default, 14 | :headers 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/accounts/update_schedule.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute enabled 6 | # @return [TrueClass, FalseClass] 7 | # @!attribute threshold 8 | # @return [TrueClass, FalseClass] 9 | # @!attribute recurrence 10 | # @return [ScheduleRequest] 11 | class UpdateSchedule 12 | attr_accessor :enabled, 13 | :threshold, 14 | :recurrence 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/apm/apm.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Klarna 4 | require 'checkout_sdk/apm/previous/klarna/credit_session_request' 5 | require 'checkout_sdk/apm/previous/klarna/klarna' 6 | require 'checkout_sdk/apm/previous/klarna/klarna_product' 7 | require 'checkout_sdk/apm/previous/klarna/order_capture_request' 8 | 9 | require 'checkout_sdk/apm/previous/klarna/klarna_client' 10 | require 'checkout_sdk/apm/previous/sepa/sepa_client' 11 | require 'checkout_sdk/apm/ideal/ideal_client' 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/apm/ideal/ideal_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Apm 5 | class IdealClient < Client 6 | IDEAL_EXTERNAL = 'ideal-external' 7 | ISSUERS = 'issuers' 8 | private_constant :IDEAL_EXTERNAL, :ISSUERS 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 14 | end 15 | 16 | def info 17 | api_client.invoke_get(IDEAL_EXTERNAL, sdk_authorization) 18 | end 19 | 20 | def issuers 21 | api_client.invoke_get(build_path(IDEAL_EXTERNAL, ISSUERS), sdk_authorization) 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/checkout_sdk/apm/previous/klarna/credit_session_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Apm 6 | # @!attribute purchase_country 7 | # @return [String] {CheckoutSdk::Common::Country} 8 | # @!attribute currency 9 | # @return [String] {CheckoutSdk::Common::Currency} 10 | # @!attribute locale 11 | # @return [String] 12 | # @!attribute amount 13 | # @return [Integer] 14 | # @!attribute tax_amount 15 | # @return [Integer] 16 | # @!attribute products 17 | # @return [Array(KlarnaProduct)] 18 | class CreditSessionRequest 19 | attr_accessor :purchase_country, 20 | :currency, 21 | :locale, 22 | :amount, 23 | :tax_amount, 24 | :products 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/checkout_sdk/apm/previous/klarna/klarna.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Apm 6 | # @!attribute description 7 | # @return [String] 8 | # @!attribute products 9 | # @return [Array(KlarnaProduct)] 10 | # @!attribute shipping_info 11 | # @return [CheckoutSdk::Common::ShippingInfo] 12 | # @!attribute shipping_delay 13 | # @return [Integer] 14 | class Klarna 15 | attr_accessor :description, 16 | :products, 17 | :shipping_info, 18 | :shipping_delay 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/checkout_sdk/apm/previous/klarna/klarna_product.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Apm 6 | # @!attribute name 7 | # @return [String] 8 | # @!attribute quantity 9 | # @return [Integer] 10 | # @!attribute unit_price 11 | # @return [Integer] 12 | # @!attribute tax_rate 13 | # @return [Integer] 14 | # @!attribute total_amount 15 | # @return [Integer] 16 | # @!attribute total_tax_amount 17 | # @return [Integer] 18 | class KlarnaProduct 19 | attr_accessor :name, 20 | :quantity, 21 | :unit_price, 22 | :tax_rate, 23 | :total_amount, 24 | :total_tax_amount 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/checkout_sdk/authorization_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module AuthorizationType 5 | PUBLIC_KEY = 'PUBLIC_KEY' 6 | SECRET_KEY = 'SECRET_KEY' 7 | PUBLIC_KEY_OR_OAUTH = 'PUBLIC_KEY_OR_OAUTH' 8 | SECRET_KEY_OR_OAUTH = 'SECRET_KEY_OR_OAUTH' 9 | OAUTH = 'OAUTH' 10 | CUSTOM = 'CUSTOM' 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/balances/balances.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/balances/balances_client' 4 | -------------------------------------------------------------------------------- /lib/checkout_sdk/balances/balances_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Balances 5 | class BalancesClient < Client 6 | BALANCES = 'balances' 7 | private_constant :BALANCES 8 | 9 | # @param [ApiClient] api_client 10 | # @param [CheckoutConfiguration] configuration 11 | def initialize(api_client, configuration) 12 | super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH) 13 | end 14 | 15 | # @param [String] entity_id 16 | # @param [String] balances_query 17 | def retrieve_entity_balances(entity_id, balances_query) 18 | api_client.invoke_get(build_path(BALANCES, entity_id), sdk_authorization, balances_query) 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/checkout_sdk/checkout_sdk_builder.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | class CheckoutSdkBuilder 5 | # @return [CheckoutSdk::CheckoutStaticKeysSdkBuilder] 6 | def static_keys 7 | CheckoutSdk::CheckoutStaticKeysSdkBuilder.new 8 | end 9 | 10 | # @return [CheckoutSdk::CheckoutOAuthSdkBuilder] 11 | def oauth 12 | CheckoutSdk::CheckoutOAuthSdkBuilder.new 13 | end 14 | 15 | # @return [CheckoutSdk::Previous::CheckoutPreviousSdkBuilder] 16 | def previous 17 | CheckoutSdk::Previous::CheckoutPreviousSdkBuilder.new 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/checkout_static_keys_sdk_builder.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | class CheckoutStaticKeysSdkBuilder < StaticKeysBuilder 5 | SECRET_KEY_PATTERN = '^sk_(sbox_)?[a-z2-7]{26}[a-z2-7*#$=]$' 6 | PUBLIC_KEY_PATTERN = '^pk_(sbox_)?[a-z2-7]{26}[a-z2-7*#$=]$' 7 | private_constant :SECRET_KEY_PATTERN, :PUBLIC_KEY_PATTERN 8 | 9 | # @return [CheckoutSdk::CheckoutApi] 10 | def build 11 | @secret_key_pattern = SECRET_KEY_PATTERN 12 | @public_key_pattern = PUBLIC_KEY_PATTERN 13 | super 14 | configuration = CheckoutConfiguration.new( 15 | StaticKeysSdkCredentials.new(secret_key, public_key), 16 | environment, 17 | http_client, 18 | multipart_http_client, 19 | logger 20 | ) 21 | 22 | configuration.environment_subdomain = environment_subdomain if environment_subdomain 23 | 24 | CheckoutApi.new(configuration) 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/account_change_indicator_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | class AccountChangeIndicatorType 6 | THIS_TRANSACTION = 'this_transaction' 7 | LESS_THAN_THIRTY_DAYS = 'less_than_thirty_days' 8 | THIRTY_TO_SIXTY_DAYS = 'thirty_to_sixty_days' 9 | MORE_THAN_SIXTY_DAYS = 'more_than_sixty_days' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/account_holder_identification.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute type 6 | # @return [String] {AccountHolderIdentificationType} 7 | # @!attribute number 8 | # @return [String] 9 | # @!attribute issuing_country 10 | # @return [String] {Country} 11 | # @!attribute date_of_expiry 12 | # @return [String] 13 | class AccountHolderIdentification 14 | attr_accessor :type, 15 | :number, 16 | :issuing_country, 17 | :date_of_expiry 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/account_holder_identification_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | module AccountHolderIdentificationType 6 | PASSPORT = 'passport' 7 | DRIVING_LICENSE = 'driving_licence' 8 | NATIONAL_ID = 'national_id' 9 | COMPANY_REGISTRATION = 'company_registration' 10 | TAX_ID = 'tax_id' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/account_holder_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | module AccountHolderType 6 | INDIVIDUAL = 'individual' 7 | CORPORATE = 'corporate' 8 | INSTRUMENT = 'instrument' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/account_password_change_indicator_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | class AccountPasswordChangeIndicatorType 6 | NO_CHANGE = 'no_change' 7 | THIS_TRANSACTION = 'this_transaction' 8 | LESS_THAN_THIRTY_DAYS = 'less_than_thirty_days' 9 | THIRTY_TO_SIXTY_DAYS = 'thirty_to_sixty_days' 10 | MORE_THAN_SIXTY_DAYS = 'more_than_sixty_days' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/account_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | module AccountType 6 | SAVINGS = 'savings' 7 | CURRENT = 'current' 8 | CASH = 'cash' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/account_type_card_product_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | class AccountTypeCardProductType 6 | CREDIT = 'credit' 7 | DEBIT = 'debit' 8 | NOT_APPLICABLE = 'not_applicable' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/address.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute address_line1 6 | # @return [String] 7 | # @!attribute address_line2 8 | # @return [String] 9 | # @!attribute city 10 | # @return [String] 11 | # @!attribute state 12 | # @return [String] 13 | # @!attribute zip 14 | # @return [String] 15 | # @!attribute country 16 | # @return [String] 17 | class Address 18 | attr_accessor :address_line1, 19 | :address_line2, 20 | :city, 21 | :state, 22 | :zip, 23 | :country 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/amount_allocations.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute id 6 | # @return [String] 7 | # @!attribute amount 8 | # @return [Integer] 9 | # @!attribute reference 10 | # @return [String] 11 | # @!attribute commission 12 | # @return [Commission] 13 | class AmountAllocations 14 | attr_accessor :id, 15 | :amount, 16 | :reference, 17 | :commission 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/bank_details.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute name 6 | # @return [String] 7 | # @!attribute branch 8 | # @return [String] 9 | # @!attribute address 10 | # @return [Address] 11 | class BankDetails 12 | attr_accessor :name, 13 | :branch, 14 | :address 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/cardholder_account_age_indicator_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | class CardholderAccountAgeIndicatorType 6 | LESS_THAN_THIRTY_DAYS = 'less_than_thirty_days' 7 | MORE_THAN_SIXTY_DAYS = 'more_than_sixty_days' 8 | NO_ACCOUNT = 'no_account' 9 | THIRTY_TO_SIXTY_DAYS = 'thirty_to_sixty_days' 10 | THIS_TRANSACTION = 'this_transaction' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/challenge_indicator.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | module ChallengeIndicator 6 | NO_PREFERENCE = 'no_preference' 7 | NO_CHALLENGE_REQUESTED = 'no_challenge_requested' 8 | CHALLENGE_REQUESTED = 'challenge_requested' 9 | CHALLENGE_REQUESTED_MANDATE = 'challenge_requested_mandate' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/commission.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute amount 6 | # @return [Integer] 7 | # @!attribute percentage 8 | # @return [Integer] 9 | class Commission 10 | attr_accessor :amount, 11 | :percentage 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/customer_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute id 6 | # @return [String] 7 | # @!attribute email 8 | # @return [String] 9 | # @!attribute name 10 | # @return [String] 11 | # @!attribute tax_number 12 | # @return [String] 13 | # @!attribute phone 14 | # @return [Phone] 15 | # @!attribute default 16 | # @return [TrueClass, FalseClass] 17 | class CustomerRequest 18 | attr_accessor :id, 19 | :email, 20 | :name, 21 | :tax_number, 22 | :phone, 23 | :default 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/customer_retry.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Accounts 5 | # @!attribute max_attempts 6 | # @return [Integer] 7 | class CustomerRetry 8 | attr_accessor :max_attempts 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/date_range_query_filter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute from 6 | # @return [DateTime] 7 | # @!attribute to 8 | # @return [DateTime] 9 | class DateRangeQueryFilter 10 | attr_accessor :from, 11 | :to 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/file_purpose.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | module FilePurpose 6 | DISPUTE_EVIDENCE = 'dispute_evidence' 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/file_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute purpose 6 | # @return [FilePurpose] 7 | # @!attribute file 8 | # @return [String] 9 | class FileRequest 10 | attr_accessor :purpose, 11 | :file 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/instrument_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | module InstrumentType 6 | BANK_ACCOUNT = 'bank_account' 7 | TOKEN = 'token' 8 | CARD = 'card' 9 | SEPA = 'sepa' 10 | CARD_TOKEN = 'card_token' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/marketplace_data.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute sub_entity_id 6 | # @return [String] 7 | # @!attribute sub_entities 8 | # @return [Array(AmountAllocations)] 9 | class MarketplaceData 10 | attr_accessor :sub_entity_id, 11 | :sub_entities 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/phone.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute country_code 6 | # @return [String] 7 | # @!attribute number 8 | # @return [String] 9 | class Phone 10 | attr_accessor :country_code, 11 | :number 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/product.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute name 6 | # @return [String] 7 | # @!attribute quantity 8 | # @return [Integer] 9 | # @!attribute price 10 | # @return [Integer] 11 | # @!attribute reference 12 | # @return [String] 13 | class Product 14 | attr_accessor :name, 15 | :quantity, 16 | :price, 17 | :reference 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/shipping_info.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute shipping_company 6 | # @return [String] 7 | # @!attribute shipping_method 8 | # @return [String] 9 | # @!attribute tracking_number 10 | # @return [String] 11 | # @!attribute tracking_uri 12 | # @return [String] 13 | # @!attribute return_shipping_company 14 | # @return [String] 15 | # @!attribute return_tracking_number 16 | # @return [String] 17 | # @!attribute return_tracking_uri 18 | # @return [String] 19 | class ShippingInfo 20 | attr_accessor :shipping_company, 21 | :shipping_method, 22 | :tracking_number, 23 | :tracking_uri, 24 | :return_shipping_company, 25 | :return_tracking_number, 26 | :return_tracking_uri 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/checkout_sdk/common/update_customer_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Common 5 | # @!attribute id 6 | # @return [String] 7 | # @!attribute default 8 | # @return [TrueClass, FalseClass] 9 | class UpdateCustomerRequest 10 | attr_accessor :id, 11 | :default 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/customers/customer_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Customers 5 | # @!attribute email 6 | # @return [String] 7 | # @!attribute name 8 | # @return [String] 9 | # @!attribute phone 10 | # @return [CheckoutSdk::Common::Phone] 11 | # @!attribute metadata 12 | # @return [Hash{String => Object}] 13 | # @!attribute default 14 | # @return [String] - Not available on previous 15 | # @!attribute instruments 16 | # @return [Array(String)] - Not available on previous 17 | class CustomerRequest 18 | attr_accessor :email, 19 | :name, 20 | :phone, 21 | :metadata, 22 | :default, 23 | :instruments 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/customers/customers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/customers/customer_request' 4 | require 'checkout_sdk/customers/customers_client' 5 | -------------------------------------------------------------------------------- /lib/checkout_sdk/disputes/dispute_status.rb: -------------------------------------------------------------------------------- 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 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/disputes/disputes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/disputes/dispute_evidence_request' 4 | require 'checkout_sdk/disputes/dispute_status' 5 | require 'checkout_sdk/disputes/disputes_client' 6 | require 'checkout_sdk/disputes/disputes_query_filter' 7 | -------------------------------------------------------------------------------- /lib/checkout_sdk/events/events.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/events/events_query_filter' 4 | require 'checkout_sdk/events/events_client' 5 | -------------------------------------------------------------------------------- /lib/checkout_sdk/events/events_query_filter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Events 6 | # @!attribute payment_id 7 | # @return [String] 8 | # @!attribute charge_id 9 | # @return [String] 10 | # @!attribute track_id 11 | # @return [String] 12 | # @!attribute reference 13 | # @return [String] 14 | # @!attribute skip 15 | # @return [Integer] 16 | # @!attribute limit 17 | # @return [Integer] 18 | class EventsQueryFilter 19 | attr_accessor :payment_id, 20 | :charge_id, 21 | :track_id, 22 | :reference, 23 | :skip, 24 | :limit 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/checkout_sdk/financial/financial.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/financial/financial_client' 4 | require 'checkout_sdk/financial/financial_actions_query' 5 | -------------------------------------------------------------------------------- /lib/checkout_sdk/financial/financial_actions_query.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Financial 5 | # @!attribute payment_id 6 | # @return [String] 7 | # @!attribute action_id 8 | # @return [String] 9 | # @!attribute reference 10 | # @return [String] 11 | # @!attribute limit 12 | # @return [Integer] 13 | # @!attribute pagination_token 14 | # @return [String] 15 | class FinancialActionsQuery 16 | attr_accessor :payment_id, 17 | :action_id, 18 | :reference, 19 | :limit, 20 | :pagination_token 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/financial/financial_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Financial 5 | class FinancialClient < Client 6 | FINANCIAL_ACTIONS = 'financial-actions' 7 | private_constant :FINANCIAL_ACTIONS 8 | 9 | # @param [ApiClient] api_client 10 | # @param [CheckoutConfiguration] configuration 11 | def initialize(api_client, configuration) 12 | super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH 13 | end 14 | 15 | # @param [Hash, FinancialActionsQuery] query_filter 16 | def query(query_filter) 17 | api_client.invoke_get(FINANCIAL_ACTIONS, sdk_authorization, query_filter) 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/forex/forex.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/forex/quote_request' 4 | require 'checkout_sdk/forex/forex_source' 5 | require 'checkout_sdk/forex/rates_query_filter' 6 | require 'checkout_sdk/forex/forex_client' 7 | -------------------------------------------------------------------------------- /lib/checkout_sdk/forex/forex_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Forex 5 | module ForexSource 6 | VISA = 'visa' 7 | MASTERCARD = 'mastercard' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/forex/quote_request.rb: -------------------------------------------------------------------------------- 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 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/forex/rates_query_filter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Forex 5 | # @!attribute product 6 | # @return [String] 7 | # @!attribute source 8 | # @return [String] {ForexSource} 9 | # @!attribute currency_pairs 10 | # @return [String] 11 | # @!attribute process_channel_id 12 | # @return [String] 13 | class RatesQueryFilter 14 | attr_accessor :product, 15 | :source, 16 | :currency_pairs, 17 | :process_channel_id 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/forward/forward.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/forward/forward_client' 4 | -------------------------------------------------------------------------------- /lib/checkout_sdk/forward/forward_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Forward 5 | class ForwardClient < Client 6 | FORWARD = 'forward' 7 | private_constant :FORWARD 8 | 9 | # @param [ApiClient] api_client 10 | # @param [CheckoutConfiguration] configuration 11 | def initialize(api_client, configuration) 12 | super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH) 13 | end 14 | 15 | # @param [Hash] forward_request 16 | def forward_request(forward_request) 17 | api_client.invoke_post(build_path(FORWARD), sdk_authorization, forward_request) 18 | end 19 | 20 | # @param [String] forward_id 21 | def get(forward_id) 22 | api_client.invoke_get(build_path(FORWARD, forward_id), sdk_authorization) 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/http_metadata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | class HttpMetadata 5 | attr_accessor :body, 6 | :status_code, 7 | :headers 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/base_instruments_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Instruments 5 | class BaseInstrumentsClient < Client 6 | INSTRUMENTS = 'instruments' 7 | private_constant :INSTRUMENTS 8 | 9 | # @param [String] instrument_id 10 | def get(instrument_id) 11 | api_client.invoke_get(build_path(INSTRUMENTS, instrument_id), sdk_authorization) 12 | end 13 | 14 | # @param [String] instrument_id 15 | def delete(instrument_id) 16 | api_client.invoke_delete(build_path(INSTRUMENTS, instrument_id), sdk_authorization) 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/create/instrument.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Instruments 5 | # @!attribute type 6 | # @return [String] {CheckoutSdk::Common::InstrumentType} 7 | class Instrument 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] {CheckoutSdk::Common::InstrumentType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/create/instrument_data.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Instruments 5 | # @!attribute account_number 6 | # @return [String] 7 | # @!attribute country 8 | # @return [String] {CheckoutSdk::Common::Country} 9 | # @!attribute currency 10 | # @return [String] {CheckoutSdk::Common::Currency} 11 | # @!attribute payment_type 12 | # @return [String] {CheckoutSdk::Payments::PaymentType} 13 | # @!attribute mandate_id 14 | # @return [String] 15 | # @!attribute date_of_signature 16 | # @return [DateTime] 17 | class InstrumentData 18 | attr_accessor :account_number, 19 | :country, 20 | :currency, 21 | :payment_type, 22 | :mandate_id, 23 | :date_of_signature 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/create/instrument_sepa.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Instruments 5 | # @!attribute instrument_data 6 | # @return [InstrumentData] 7 | # @!attribute account_holder 8 | # @return [CheckoutSdk::Common::AccountHolder] 9 | class InstrumentSepa < Instrument 10 | attr_accessor :instrument_data, 11 | :account_holder 12 | 13 | def initialize 14 | super CheckoutSdk::Common::InstrumentType::SEPA 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/create/instrument_token.rb: -------------------------------------------------------------------------------- 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 InstrumentToken < Instrument 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 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/get/bank_account_field_query.rb: -------------------------------------------------------------------------------- 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 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/get/payment_network.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Instruments 5 | module PaymentNetwork 6 | LOCAL = 'local' 7 | SEPA = 'sepa' 8 | FPS = 'Fps' 9 | ACH = 'Ach' 10 | FEDWIRE = 'Fedwire' 11 | SWIFT = 'Swift' 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/previous/create/instrument.rb: -------------------------------------------------------------------------------- 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 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/previous/update/update_instrument.rb: -------------------------------------------------------------------------------- 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 26 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/update/update_instrument.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Instruments 5 | # @!attribute type 6 | # @return [String] {CheckoutSdk::Common::InstrumentType} 7 | class UpdateInstrument 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] {CheckoutSdk::Common::InstrumentType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/update/update_instrument_card.rb: -------------------------------------------------------------------------------- 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 UpdateInstrumentCard < UpdateInstrument 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 28 | -------------------------------------------------------------------------------- /lib/checkout_sdk/instruments/update/update_instrument_token.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Instruments 5 | # @!attribute token 6 | # @return [String] 7 | class UpdateInstrumentToken < UpdateInstrument 8 | attr_accessor :token 9 | 10 | def initialize 11 | super CheckoutSdk::Common::InstrumentType::TOKEN 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/issuing/issuing.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/issuing/issuing_client' 4 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/metadata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/metadata/metadata_client' 4 | require 'checkout_sdk/metadata/metadata_format' 5 | require 'checkout_sdk/metadata/metadata_request' 6 | require 'checkout_sdk/metadata/source/metadata_source' 7 | require 'checkout_sdk/metadata/source/bin_metadata_source' 8 | require 'checkout_sdk/metadata/source/card_metadata_source' 9 | require 'checkout_sdk/metadata/source/id_metadata_source' 10 | require 'checkout_sdk/metadata/source/metadata_source_type' 11 | require 'checkout_sdk/metadata/source/token_metadata_source' 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/metadata_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Metadata 5 | class MetadataClient < Client 6 | METADATA = 'metadata' 7 | CARD = 'card' 8 | private_constant :METADATA, :CARD 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 [Hash, MetadataRequest] metadata_request 17 | def request_card_metadata(metadata_request) 18 | api_client.invoke_post(build_path(METADATA, CARD), sdk_authorization, metadata_request) 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/metadata_format.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Metadata 5 | module Format 6 | BASIC = 'basic' 7 | CARD_PAYOUTS = 'card_payouts' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/metadata_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Metadata 5 | # @!attribute source 6 | # @return [MetadataSource] 7 | # @!attribute format 8 | # @return [String] {Format} 9 | class MetadataRequest 10 | attr_accessor :source, 11 | :format 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/source/bin_metadata_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Metadata 5 | # @!attribute bin 6 | # @return [String] 7 | class BinMetadataSource < MetadataSource 8 | attr_accessor :bin 9 | 10 | def initialize 11 | super MetadataSourceType::BIN 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/source/card_metadata_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Metadata 5 | # @!attribute number 6 | # @return [String] 7 | class CardMetadataSource < MetadataSource 8 | attr_accessor :number 9 | 10 | def initialize 11 | super MetadataSourceType::CARD 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/source/id_metadata_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Metadata 5 | # @!attribute id 6 | # @return [String] 7 | class IdMetadataSource < MetadataSource 8 | attr_accessor :id 9 | 10 | def initialize 11 | super MetadataSourceType::ID 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/source/metadata_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Metadata 5 | # @!attribute type 6 | # @return [String] {MetadataSourceType} 7 | class MetadataSource 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] type {MetadataSourceType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/source/metadata_source_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Metadata 5 | module MetadataSourceType 6 | BIN = 'bin' 7 | CARD = 'card' 8 | ID = 'id' 9 | TOKEN = 'token' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/metadata/source/token_metadata_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Metadata 5 | # @!attribute token 6 | # @return [String] 7 | class TokenMetadataSource < MetadataSource 8 | attr_accessor :token 9 | 10 | def initialize 11 | super MetadataSourceType::TOKEN 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/oauth_access_token.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | # @!attribute token 5 | # @return [String] 6 | # @!attribute token_type 7 | # @return [String] 8 | # @!attribute expiration_date 9 | # @return [Time] 10 | class OAuthAccessToken 11 | attr_accessor :token, 12 | :token_type, 13 | :expiration_date 14 | 15 | # @param [String] token 16 | # @param [String] token_type 17 | # @param [Time] expiration_date 18 | # @return [OAuthAccessToken] 19 | def initialize(token, token_type, expiration_date) 20 | @token = token 21 | @token_type = token_type 22 | @expiration_date = expiration_date 23 | end 24 | 25 | # @return [TrueClass, FalseClass] 26 | def valid? 27 | return false if @token.nil? 28 | 29 | @expiration_date > Time.now 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/airline_data.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute ticket 6 | # @return [Ticket] 7 | # @!attribute passenger 8 | # @return [Passenger] 9 | # @!attribute flight_leg_details 10 | # @return [Array(FlightLegDetails)] 11 | class AirlineData 12 | attr_accessor :ticket, 13 | :passenger, 14 | :flight_leg_details 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/applepay.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute account_holder 6 | # @return [CheckoutSdk::Common::AccountHolder] 7 | # @!attribute store_payment_details 8 | # @return [String] {StorePaymentDetailsType} 9 | class Applepay 10 | attr_accessor :account_holder, 11 | :store_payment_details 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/authorization_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute amount 6 | # @return [Integer] 7 | # @!attribute reference 8 | # @return [String] 9 | # @!attribute metadata 10 | # @return [Hash{String => Object}] 11 | class AuthorizationRequest 12 | attr_accessor :amount, 13 | :reference, 14 | :metadata 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/authorization_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class AuthorizationType 6 | FINAL = 'Final' 7 | ESTIMATED = 'Estimated' 8 | INCREMENTAL = 'Incremental' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/billing_descriptor.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute name 6 | # @return [String] 7 | # @!attribute city 8 | # @return [String] 9 | # @!attribute reference 10 | # @return [String] 11 | class BillingDescriptor 12 | attr_accessor :name, 13 | :city, 14 | :reference 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/billing_information.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute address 6 | # @return [CheckoutSdk::Common::Address] 7 | # @!attribute phone 8 | # @return [CheckoutSdk::Common::Phone] 9 | class BillingInformation 10 | attr_accessor :address, 11 | :phone 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/billing_plan.rb: -------------------------------------------------------------------------------- 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 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/billing_plan_type.rb: -------------------------------------------------------------------------------- 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 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/capture_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module CaptureType 6 | NON_FINAL = 'NonFinal' 7 | FINAL = 'Final' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/card.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute account_holder 6 | # @return [CheckoutSdk::Common::AccountHolder] 7 | # @!attribute store_payment_details 8 | # @return [String] {StorePaymentDetailsType} 9 | class Card 10 | attr_accessor :account_holder, 11 | :store_payment_details 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/charge_bearer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module ChargeBearer 6 | OUR = 'OUR' 7 | SHA = 'SHA' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/contexts/payment_contexts_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class PaymentContextsClient < Client 6 | PAYMENT_CONTEXTS = 'payment-contexts' 7 | 8 | # @param [ApiClient] api_client 9 | # @param [CheckoutConfiguration] configuration 10 | def initialize(api_client, configuration) 11 | super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH 12 | end 13 | 14 | # @param [Hash] payment_contexts 15 | def create_payment_contexts(payment_contexts) 16 | api_client.invoke_post(PAYMENT_CONTEXTS, sdk_authorization, payment_contexts) 17 | end 18 | 19 | # @param [String] payment_context_id 20 | def get_payment_context_details(payment_context_id) 21 | api_client.invoke_get(build_path(PAYMENT_CONTEXTS, payment_context_id), sdk_authorization) 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/d_local_installments.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute count 6 | # @return [String] 7 | class DLocalInstallments 8 | attr_accessor :count 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/d_local_processing_settings.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute country 6 | # @return [String] {CheckoutSdk::Common::Country} 7 | # @!attribute payer 8 | # @return [Payer] 9 | # @!attribute installments 10 | # @return [DLocalInstallments] 11 | class DLocalProcessingSettings 12 | attr_accessor :country, 13 | :payer, 14 | :installments 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/destination/card_destination.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute number 6 | # @return [String] 7 | # @!attribute expiry_month 8 | # @return [Integer] 9 | # @!attribute expiry_year 10 | # @return [Integer] 11 | # @!attribute account_holder 12 | # @return [CheckoutSdk::Common::AccountHolder] 13 | class CardDestination < Destination 14 | attr_accessor :number, 15 | :expiry_month, 16 | :expiry_year, 17 | :account_holder 18 | 19 | def initialize 20 | super CheckoutSdk::Payments::DestinationType::CARD 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/destination/destination.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute type 6 | # @return [String] {DestinationType} 7 | class Destination 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] type {DestinationType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/destination/destination_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module DestinationType 6 | CARD = 'card' 7 | ID = 'id' 8 | TOKEN = 'token' 9 | BANK_ACCOUNT = 'bank_account' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/destination/id_destination.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute id 6 | # @return [String] 7 | # @!attribute account_holder 8 | # @return [CheckoutSdk::Common::AccountHolder] 9 | class IdDestination < Destination 10 | attr_accessor :id, 11 | :account_holder 12 | 13 | def initialize 14 | super CheckoutSdk::Payments::DestinationType::ID 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/destination/token_destination.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute token 6 | # @return [String] 7 | # @!attribute account_holder 8 | # @return [CheckoutSdk::Common::AccountHolder] 9 | class TokenDestination < Destination 10 | attr_accessor :token, 11 | :account_holder 12 | 13 | def initialize 14 | super CheckoutSdk::Payments::DestinationType::TOKEN 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/exemption.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module Exemption 6 | LOW_VALUE = 'low_value' 7 | SECURE_CORPORATE_PAYMENT = 'secure_corporate_payment' 8 | TRUSTED_LISTING = 'trusted_listing' 9 | TRANSACTION_RISK_ASSESSMENT = 'transaction_risk_assessment' 10 | THREE_DS_OUTAGE = '3ds_outage' 11 | SCA_DELEGATION = 'sca_delegation' 12 | OUT_OF_SCA_SCOPE = 'out_of_sca_scope' 13 | OTHER = 'other' 14 | LOW_RISK_PROGRAM = 'low_risk_program' 15 | DATA_SHARE = 'data_share' 16 | RECURRING_OPERATION = 'recurring_operation' 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/googlepay.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute account_holder 6 | # @return [CheckoutSdk::Common::AccountHolder] 7 | # @!attribute store_payment_details 8 | # @return [String] {StorePaymentDetailsType} 9 | class Googlepay 10 | attr_accessor :account_holder, 11 | :store_payment_details 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/hosted/hosted_payment_instruction.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute purpose 6 | # @return [String] {PaymentPurposeType} 7 | class HostedPaymentInstruction 8 | attr_accessor :purpose 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/hosted/payment_purpose_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class PaymentPurposeType 6 | DONATIONS = 'donations' 7 | EDUCATION = 'education' 8 | EMERGENCY_NEED = 'emergency_need' 9 | EXPATRIATION = 'expatriation' 10 | FAMILY_SUPPORT = 'family_support' 11 | FINANCIAL_SERVICES = 'financial_services' 12 | GIFTS = 'gifts' 13 | INCOME = 'income' 14 | INSURANCE = 'insurance' 15 | INVESTMENT = 'investment' 16 | IT_SERVICES = 'it_services' 17 | LEISURE = 'leisure' 18 | LOAN_PAYMENT = 'loan_payment' 19 | MEDICAL_TREATMENT = 'medical_treatment' 20 | OTHER = 'other' 21 | PENSION = 'pension' 22 | ROYALTIES = 'royalties' 23 | SAVINGS = 'savings' 24 | TRAVEL_AND_TOURISM = 'travel_and_tourism' 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/instruction_scheme.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class InstructionScheme 6 | SWIFT = 'swift' 7 | LOCAL = 'local' 8 | INSTANT = 'instant' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/links/payments_links_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class PaymentsLinksClient < Client 6 | PAYMENT_LINKS = 'payment-links' 7 | 8 | # @param [ApiClient] api_client 9 | # @param [CheckoutConfiguration] configuration 10 | def initialize(api_client, configuration) 11 | super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY 12 | end 13 | 14 | # @param [Hash, PaymentLink] payment_link 15 | def create_payment_link(payment_link) 16 | api_client.invoke_post(PAYMENT_LINKS, sdk_authorization, payment_link) 17 | end 18 | 19 | # @param [String] payment_link_id 20 | def get_payment_link(payment_link_id) 21 | api_client.invoke_get(build_path(PAYMENT_LINKS, payment_link_id), sdk_authorization) 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/locale_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module LocaleType 6 | AR = 'ar' 7 | DA_DK = 'da-DK' 8 | DE_DE = 'de-DE' 9 | EL = 'el' 10 | EN_GB = 'en-GB' 11 | ES_ES = 'es-ES' 12 | FI_FI = 'fi-FI' 13 | FIL_PH = 'fil-PH' 14 | FR_FR = 'fr-FR' 15 | HI_IN = 'hi-IN' 16 | ID_ID = 'id-ID' 17 | IT_IT = 'it-IT' 18 | JA_JP = 'ja-JP' 19 | MS_MY = 'ms-MY' 20 | NB_NO = 'nb-NO' 21 | NL_NL = 'nl-NL' 22 | PT_PT = 'pt-PT' 23 | SV_SE = 'sv-SE' 24 | TH_TH = 'th-TH' 25 | VI_VN = 'vi-VN' 26 | ZH_CN = 'zh-CN' 27 | ZH_HK = 'zh-HK' 28 | ZH_TW = 'zh-TW' 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/merchant_initiated_reason.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module MerchantInitiatedReason 6 | DELAYED_CHARGE = 'Delayed_charge' 7 | RESUBMISSION = 'Resubmission' 8 | NO_SHOW = 'No_show' 9 | REAUTHORIZATION = 'Reauthorization' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/network_token_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class NetworkTokenType 6 | VTS = 'vts' 7 | MDES = 'mdes' 8 | APPLEPAY = 'applepay' 9 | GOOGLEPAY = 'googlepay' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/os_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module OsType 6 | ANDROID = 'ANDROID' 7 | IOS = 'IOS' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/partial_authorization.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute enabled 6 | # @return [TrueClass, FalseClass] 7 | class PartialAuthorization 8 | attr_accessor :enabled 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/passenger.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute name 6 | # @return [String] 7 | # @!attribute date_of_birth 8 | # @return [String] 9 | # @!attribute country_code 10 | # @return [String] {CheckoutSdk::Common::Country} 11 | class Passenger 12 | attr_accessor :name, 13 | :date_of_birth, 14 | :country_code 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/passenger_name.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute full_name 6 | # @return [String] 7 | class PassengerName 8 | attr_accessor :full_name 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/payer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute name 6 | # @return [String] 7 | # @!attribute email 8 | # @return [String] 9 | # @!attribute document 10 | # @return [String] 11 | class Payer 12 | attr_accessor :name, 13 | :email, 14 | :document 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/payment_method_configuration.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute applepay 6 | # @return [Applepay] 7 | # @!attribute card 8 | # @return [Card] 9 | # @!attribute googlepay 10 | # @return [Googlepay] 11 | class PaymentMethodConfiguration 12 | attr_accessor :applepay, 13 | :card, 14 | :googlepay 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/payment_method_details.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute display_name 6 | # @return [String] 7 | # @!attribute type 8 | # @return [String] 9 | # @!attribute network 10 | # @return [String] 11 | class PaymentMethodDetails 12 | attr_accessor :display_name, 13 | :type, 14 | :network 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/payment_retry_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute enabled 6 | # @return [TrueClass, FalseClass] 7 | # @!attribute max_attempts 8 | # @return [Integer] 9 | # @!attribute end_after_days 10 | # @return [Integer] 11 | class PaymentRetryRequest 12 | attr_accessor :enabled, 13 | :max_attempts, 14 | :end_after_day 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/payment_segment.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute brand 6 | # @return [String] 7 | # @!attribute business_category 8 | # @return [String] 9 | # @!attribute market 10 | # @return [String] 11 | class PaymentSegment 12 | attr_accessor :brand, 13 | :business_category, 14 | :market 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/payment_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module PaymentType 6 | REGULAR = 'Regular' 7 | RECURRING = 'Recurring' 8 | MOTO = 'Moto' 9 | INSTALLMENT = 'Installment' 10 | UNSCHEDULED = 'Unscheduled' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/payments_query_filter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute limit 6 | # @return [Integer] 7 | # @!attribute skip 8 | # @return [Integer] 9 | # @!attribute reference 10 | # @return [String] 11 | class PaymentsQueryFilter 12 | attr_accessor :limit, 13 | :skip, 14 | :reference 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/payout_billing_descriptor.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute reference 6 | # @return [String] 7 | class PayoutBillingDescriptor 8 | attr_accessor :reference 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/preferred_schema.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module PreferredSchema 6 | VISA = 'visa' 7 | MASTERCARD = 'mastercard' 8 | CARTES_BANCAIRES = 'cartes_bancaires' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/capture_request.rb: -------------------------------------------------------------------------------- 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 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/destination/destination.rb: -------------------------------------------------------------------------------- 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 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/destination/id_destination.rb: -------------------------------------------------------------------------------- 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 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/destination/token_destination.rb: -------------------------------------------------------------------------------- 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 30 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/fund_transfer_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | module FundTransferType 7 | AA = 'AA' 8 | PP = 'PP' 9 | FT = 'FT' 10 | FD = 'FD' 11 | PD = 'PD' 12 | LO = 'LO' 13 | OG = 'OG' 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/alipay_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | class AlipaySource < PaymentSource 7 | def initialize 8 | super CheckoutSdk::Common::PaymentSourceType::ALIPAY 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/alma_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute billing_address 7 | # @return [CheckoutSdk::Common::Address] 8 | # @!attribute account_holder_name 9 | # @return [String] 10 | # @!attribute billing_descriptor 11 | # @return [String] 12 | # @!attribute language 13 | # @return [String] 14 | class AlmaSource < PaymentSource 15 | attr_accessor :billing_address 16 | 17 | def initialize 18 | super CheckoutSdk::Common::PaymentSourceType::ALMA 19 | end 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/bancontact_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute payment_country 7 | # @return [String] {CheckoutSdk::Common::Country} 8 | # @!attribute account_holder_name 9 | # @return [String] 10 | # @!attribute billing_descriptor 11 | # @return [String] 12 | # @!attribute language 13 | # @return [String] 14 | class BancontactSource < PaymentSource 15 | attr_accessor :payment_country, 16 | :account_holder_name, 17 | :billing_descriptor, 18 | :language 19 | 20 | def initialize 21 | super CheckoutSdk::Common::PaymentSourceType::BANCONTACT 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/benefit_pay_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute integration_type 7 | # @return [String] {IntegrationType} 8 | class BenefitPaySource < PaymentSource 9 | attr_accessor :integration_type 10 | 11 | def initialize 12 | super CheckoutSdk::Common::PaymentSourceType::BENEFITPAY 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/boleto_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute integration_type 7 | # @return [String] {IntegrationType} 8 | # @!attribute country 9 | # @return [String] {CheckoutSdk::Common::Country} 10 | # @!attribute description 11 | # @return [String] 12 | # @!attribute payer 13 | # @return [CheckoutSdk::Payments::Payer] 14 | class BoletoSource < PaymentSource 15 | attr_accessor :integration_type, 16 | :country, 17 | :description, 18 | :payer 19 | 20 | def initialize 21 | super CheckoutSdk::Common::PaymentSourceType::BOLETO 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/eps_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute purpose 7 | # @return [String] 8 | # @!attribute bic 9 | # @return [String] 10 | class EPSSource < PaymentSource 11 | attr_accessor :purpose, 12 | :bic 13 | 14 | def initialize 15 | super CheckoutSdk::Common::PaymentSourceType::EPS 16 | end 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/giropay_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute purpose 7 | # @return [String] 8 | # @!attribute bic 9 | # @return [String] 10 | # @!attribute info_fieldss 11 | # @return [InfoFields] 12 | class GiropaySource < PaymentSource 13 | attr_accessor :purpose, 14 | :bic, 15 | :info_fields 16 | 17 | def initialize 18 | super CheckoutSdk::Common::PaymentSourceType::GIROPAY 19 | end 20 | end 21 | 22 | # @!attribute label 23 | # @return [String] 24 | # @!attribute text 25 | # @return [String] 26 | class InfoFields 27 | attr_accessor :label, 28 | :text 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/ideal_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute bic 7 | # @return [String] 8 | # @!attribute description 9 | # @return [String] 10 | # @!attribute language 11 | # @return [String] 12 | class IdealSource < PaymentSource 13 | attr_accessor :bic, 14 | :description, 15 | :language 16 | 17 | def initialize 18 | super CheckoutSdk::Common::PaymentSourceType::IDEAL 19 | end 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/integration_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | module IntegrationType 7 | DIRECT = 'direct' 8 | REDIRECT = 'redirect' 9 | end 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/multi_banco_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute payment_country 7 | # @return [String] {CheckoutSdk::Common::Country} 8 | # @!attribute account_holder_name 9 | # @return [String] 10 | # @!attribute billing_descriptor 11 | # @return [String] 12 | class MultiBancoSource < PaymentSource 13 | attr_accessor :payment_country, 14 | :account_holder_name, 15 | :billing_descriptor 16 | 17 | def initialize 18 | super CheckoutSdk::Common::PaymentSourceType::MULTIBANCO 19 | end 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/oxxo_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute integration_type 7 | # @return [String] {IntegrationType} 8 | # @!attribute country 9 | # @return [String] {CheckoutSdk::Common::Country} 10 | # @!attribute description 11 | # @return [String] 12 | # @!attribute payer 13 | # @return [CheckoutSdk::Payments::Payer] 14 | class OxxoSource < PaymentSource 15 | attr_accessor :integration_type, 16 | :country, 17 | :description, 18 | :payer 19 | 20 | def initialize 21 | super CheckoutSdk::Common::PaymentSourceType::OXXO 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/p24_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute payment_country 7 | # @return [String] {CheckoutSdk::Common::Country} 8 | # @!attribute account_holder_name 9 | # @return [String] 10 | # @!attribute account_holder_email 11 | # @return [String] 12 | # @!attribute billing_descriptor 13 | # @return [String] 14 | class P24Source < PaymentSource 15 | attr_accessor :payment_country, 16 | :account_holder_name, 17 | :account_holder_email, 18 | :billing_descriptor 19 | 20 | def initialize 21 | super CheckoutSdk::Common::PaymentSourceType::P24 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/pago_facil_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute integration_type 7 | # @return [String] {IntegrationType} 8 | # @!attribute country 9 | # @return [String] {CheckoutSdk::Common::Country} 10 | # @!attribute description 11 | # @return [String] 12 | # @!attribute payer 13 | # @return [CheckoutSdk::Payments::Payer] 14 | class PagoFacilSource < PaymentSource 15 | attr_accessor :integration_type, 16 | :country, 17 | :description, 18 | :payer 19 | 20 | def initialize 21 | super CheckoutSdk::Common::PaymentSourceType::PAGOFACIL 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/paypal_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute invoice_number 7 | # @return [String] 8 | # @!attribute recipient_name 9 | # @return [String] 10 | # @!attribute logo_url 11 | # @return [String] 12 | # @!attribute stc 13 | # @return [Hash(String=>String)] 14 | class PayPalSource < PaymentSource 15 | attr_accessor :invoice_number, 16 | :recipient_name, 17 | :logo_url, 18 | :stc 19 | 20 | def initialize 21 | super CheckoutSdk::Common::PaymentSourceType::PAYPAL 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/poli_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | class PoliSource < PaymentSource 7 | def initialize 8 | super CheckoutSdk::Common::PaymentSourceType::POLI 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/qpay_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute quantity 7 | # @return [Integer] 8 | # @!attribute description 9 | # @return [String] 10 | # @!attribute language 11 | # @return [String] 12 | # @!attribute national_id 13 | # @return [String] 14 | class QPaySource < PaymentSource 15 | attr_accessor :quantity, 16 | :description, 17 | :language, 18 | :national_id 19 | 20 | def initialize 21 | super CheckoutSdk::Common::PaymentSourceType::QPAY 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/rapi_pago_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute integration_type 7 | # @return [String] {IntegrationType} 8 | # @!attribute country 9 | # @return [String] {CheckoutSdk::Common::Country} 10 | # @!attribute description 11 | # @return [String] 12 | # @!attribute payer 13 | # @return [CheckoutSdk::Payments::Payer] 14 | class RapiPagoSource < PaymentSource 15 | attr_accessor :integration_type, 16 | :country, 17 | :description, 18 | :payer 19 | 20 | def initialize 21 | super CheckoutSdk::Common::PaymentSourceType::RAPIPAGO 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/apm/sofort_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute countryCode 7 | # @return [String] {CheckoutSdk::Common::Country} 8 | # @!attribute languageCode 9 | # @return [String] 10 | class SofortSource < PaymentSource 11 | attr_accessor :countryCode, 12 | :languageCode 13 | 14 | def initialize 15 | super CheckoutSdk::Common::PaymentSourceType::SOFORT 16 | end 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/customer_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute id 7 | # @return [String] 8 | class CustomerSource < PaymentSource 9 | attr_accessor :id 10 | 11 | def initialize 12 | super CheckoutSdk::Common::PaymentSourceType::CUSTOMER 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/id_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute id 7 | # @return [String] 8 | # @!attribute cvv 9 | # @return [String] 10 | # @!attribute stored 11 | # @return [TrueClass, FalseClass] 12 | # @!attribute store_for_future_use 13 | # @return [TrueClass, FalseClass] 14 | class IdSource < PaymentSource 15 | attr_accessor :id, 16 | :cvv, 17 | :stored, 18 | :store_for_future_use 19 | 20 | def initialize 21 | super CheckoutSdk::Common::PaymentSourceType::ID 22 | end 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/payment_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute type 7 | # @return [String] {CheckoutSdk::Common::PaymentSourceType} 8 | class PaymentSource 9 | attr_reader :type 10 | 11 | protected 12 | 13 | # @abstract 14 | # @param [String] type {CheckoutSdk::Common::PaymentSourceType} 15 | def initialize(type) 16 | @type = type 17 | end 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/previous/source/token_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Payments 6 | # @!attribute token 7 | # @return [String] 8 | # @!attribute billing_address 9 | # @return [CheckoutSdk::Common::Address] 10 | # @!attribute phone 11 | # @return [CheckoutSdk::Common::Phone] 12 | # @!attribute stored 13 | # @return [TrueClass, FalseClass] 14 | # @!attribute store_for_future_use 15 | # @return [TrueClass, FalseClass] 16 | class TokenSource < PaymentSource 17 | attr_accessor :token, 18 | :billing_address, 19 | :phone, 20 | :stored, 21 | :store_for_future_use 22 | 23 | def initialize 24 | super CheckoutSdk::Common::PaymentSourceType::TOKEN 25 | end 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/product_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module ProductType 6 | QR_CODE = 'QR Code' 7 | IN_APP = 'In-App' 8 | OFFICIAL_ACCOUNT = 'Official Account' 9 | MINI_PROGRAM = 'Mini Program' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/reverse_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute reference 6 | # @return [String] 7 | # @!attribute metadata 8 | # @return [Hash{String => Object}] 9 | class ReverseRequest 10 | attr_accessor :reference, 11 | :metadata 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/risk_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute enabled 6 | # @return [TrueClass, FalseClass] 7 | # @!attribute device_session_id 8 | # @return [String] 9 | class RiskRequest 10 | attr_accessor :enabled, 11 | :device_session_id 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/sender/corporate_sender.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute company_name 6 | # @return [String] 7 | # @!attribute address 8 | # @return [CheckoutSdk::Common::Address] 9 | # @!attribute reference_type 10 | # @return [String] 11 | # @!attribute source_of_funds 12 | # @return [String] {SourceOfFunds} 13 | # @!attribute identification 14 | # @return [CheckoutSdk::Common::AccountHolderIdentification] 15 | class CorporateSender < Sender 16 | attr_accessor :company_name, 17 | :address, 18 | :reference_type, 19 | :source_of_funds, 20 | :identification 21 | 22 | def initialize 23 | super CheckoutSdk::Payments::SenderType::CORPORATE 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/sender/instrument_sender.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class InstrumentSender < Sender 6 | def initialize 7 | super CheckoutSdk::Payments::SenderType::INSTRUMENT 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/sender/sender.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute type 6 | # @return [String] {SenderType} 7 | # @!attribute reference 8 | # @return [String] 9 | class Sender 10 | attr_reader :type 11 | attr_accessor :reference 12 | 13 | protected 14 | 15 | # @abstract 16 | # @param [String] type {SenderType} 17 | def initialize(type) 18 | @type = type 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/sender/sender_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module SenderType 6 | INDIVIDUAL = 'individual' 7 | CORPORATE = 'corporate' 8 | INSTRUMENT = 'instrument' 9 | GOVERNMENT = 'government' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/sender/source_of_funds.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module SourceOfFunds 6 | CREDIT = 'credit' 7 | DEBIT = 'debit' 8 | PREPAID = 'prepaid' 9 | DEPOSIT_ACCOUNT = 'deposit_account' 10 | MOBILE_MONEY_ACCOUNT = 'mobile_money_account' 11 | CASH = 'cash' 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/sender/ticket.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute number 6 | # @return [String] 7 | # @!attribute issue_date 8 | # @return [String] 9 | # @!attribute issuing_carrier_code 10 | # @return [String] 11 | # @!attribute travel_agency_name 12 | # @return [String] 13 | # @!attribute travel_agency_code 14 | # @return [String] 15 | class Ticket 16 | attr_accessor :number, 17 | :issue_date, 18 | :issuing_carrier_code, 19 | :travel_agency_name, 20 | :travel_agency_code 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/sessions/payment_methods_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module PaymentMethodsType 6 | APPLEPAY = 'applepay' 7 | BANCONTACT = 'bancontact' 8 | CARD = 'card' 9 | EPS = 'eps' 10 | GIROPAY = 'giropay' 11 | GOOGLEPAY = 'googlepay' 12 | IDEAL = 'ideal' 13 | KNET = 'knet' 14 | MULTIBANCO = 'multibanco' 15 | PRZELEWY24 = 'p24' 16 | PAYPAL = 'paypal' 17 | SOFORT = 'sofort' 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/sessions/payment_sessions_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class PaymentSessionsClient < Client 6 | PAYMENT_SESSIONS = 'payment-sessions' 7 | 8 | # @param [ApiClient] api_client 9 | # @param [CheckoutConfiguration] configuration 10 | def initialize(api_client, configuration) 11 | super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY 12 | end 13 | 14 | # @param [Hash, PaymentSessionsRequest] payment_sessions 15 | def create_payment_sessions(payment_sessions) 16 | api_client.invoke_post(PAYMENT_SESSIONS, sdk_authorization, payment_sessions) 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/sessions/store_payment_details_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module StorePaymentDetailsType 6 | DISABLED = 'disabled' 7 | ENABLED = 'enabled' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/shipping_details.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute address 6 | # @return [CheckoutSdk::Common::Address] 7 | # @!attribute phone 8 | # @return [CheckoutSdk::Common::Phone] 9 | # @!attribute from_address_zip 10 | # @return [String] 11 | class ShippingDetails 12 | attr_accessor :address, 13 | :phone, 14 | :from_address_zip 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/shipping_preference.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module ShippingPreference 6 | NO_SHIPPING = 'NO_SHIPPING' 7 | SET_PROVIDED_ADDRESS = 'SET_PROVIDED_ADDRESS' 8 | GET_FROM_FILE = 'GET_FROM_FILE' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/ach_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute account_type 6 | # @return [CheckoutSdk::Common::AccountType] 7 | # @!attribute country 8 | # @return [CheckoutSdk::Common::Country] 9 | # @!attribute account_number 10 | # @return [String] 11 | # @!attribute bank_code 12 | # @return [String] 13 | # @!attribute account_holder 14 | # @return [CheckoutSdk::Common::AccountHolder] 15 | class AchSource < PaymentSource 16 | attr_accessor :account_type, 17 | :country, 18 | :account_number, 19 | :bank_code, 20 | :account_holder 21 | 22 | def initialize 23 | super CheckoutSdk::Common::PaymentSourceType::ACH 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/after_pay_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute account_holder 6 | # @return [CheckoutSdk::Common::AccountHolder] 7 | class AfterPaySource < PaymentSource 8 | attr_accessor :account_holder 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::AFTERPAY 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/alma_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute billing_address 6 | # @return [CheckoutSdk::Common::Address] 7 | class AlmaSource < PaymentSource 8 | attr_accessor :billing_address 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::ALMA 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/bancontact_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute payment_country 6 | # @return [String] {CheckoutSdk::Common::Country} 7 | # @!attribute account_holder_name 8 | # @return [String] 9 | # @!attribute billing_descriptor 10 | # @return [String] 11 | # @!attribute language 12 | # @return [String] 13 | class BancontactSource < PaymentSource 14 | attr_accessor :payment_country, 15 | :account_holder_name, 16 | :billing_descriptor, 17 | :language 18 | 19 | def initialize 20 | super CheckoutSdk::Common::PaymentSourceType::BANCONTACT 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/benefit_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class BenefitSource < PaymentSource 6 | def initialize 7 | super CheckoutSdk::Common::PaymentSourceType::BENEFIT 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/bizum_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute mobile_number 6 | # @return [String] 7 | class BizumSource < PaymentSource 8 | attr_accessor :mobile_number 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::BIZUM 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/cv_connect_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute billing_address 6 | # @return [CheckoutSdk::Common::Address] 7 | class CvConnectSource < PaymentSource 8 | attr_accessor :billing_address 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::CV_CONNECT 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/eps_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute purpose 6 | # @return [String] 7 | class EPSSource < PaymentSource 8 | attr_accessor :purpose 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::EPS 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/fawry_product.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute product_id 6 | # @return [String] 7 | # @!attribute quantity 8 | # @return [Integer] 9 | # @!attribute price 10 | # @return [Integer] 11 | # @!attribute description 12 | # @return [String] 13 | class FawryProduct 14 | attr_accessor :product_id, 15 | :quantity, 16 | :price, 17 | :description 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/fawry_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute description 6 | # @return [String] 7 | # @!attribute customer_profile_id 8 | # @return [String] 9 | # @!attribute customer_email 10 | # @return [String] 11 | # @!attribute customer_mobile 12 | # @return [String] 13 | # @!attribute expires_on 14 | # @return [Time] 15 | # @!attribute products 16 | # @return [Array(FawryProduct)] 17 | class FawrySource < PaymentSource 18 | attr_accessor :description, 19 | :customer_profile_id, 20 | :customer_email, 21 | :customer_mobile, 22 | :expires_on, 23 | :products 24 | 25 | def initialize 26 | super CheckoutSdk::Common::PaymentSourceType::FAWRY 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/giropay_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute account_holder 6 | # @return [CheckoutSdk::Common::AccountHolder] 7 | class GiropaySource < PaymentSource 8 | attr_accessor :account_holder 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::GIROPAY 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/ideal_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute description 6 | # @return [String] 7 | # @!attribute language 8 | # @return [String] 9 | class IdealSource < PaymentSource 10 | attr_accessor :description, 11 | :language 12 | 13 | def initialize 14 | super CheckoutSdk::Common::PaymentSourceType::IDEAL 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/illicado_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute billing_address 6 | # @return [CheckoutSdk::Common::Address] 7 | class IllicadoSource < PaymentSource 8 | attr_accessor :billing_address 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::ILLICADO 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/klarna_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute account_holder 6 | # @return [CheckoutSdk::Common::AccountHolder] 7 | class KlarnaSource < PaymentSource 8 | attr_accessor :account_holder 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::KLARNA 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/mbway_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class MbwaySource < PaymentSource 6 | def initialize 7 | super CheckoutSdk::Common::PaymentSourceType::MBWAY 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/multi_banco_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute payment_country 6 | # @return [String] {CheckoutSdk::Common::Country} 7 | # @!attribute account_holder_name 8 | # @return [String] 9 | # @!attribute billing_descriptor 10 | # @return [String] 11 | class MultiBancoSource < PaymentSource 12 | attr_accessor :payment_country, 13 | :account_holder_name, 14 | :billing_descriptor 15 | 16 | def initialize 17 | super CheckoutSdk::Common::PaymentSourceType::MULTIBANCO 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/octopus_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class OctopusSource < PaymentSource 6 | def initialize 7 | super CheckoutSdk::Common::PaymentSourceType::OCTOPUS 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/p24_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute payment_country 6 | # @return [String] {CheckoutSdk::Common::Country} 7 | # @!attribute account_holder_name 8 | # @return [String] 9 | # @!attribute account_holder_email 10 | # @return [String] 11 | # @!attribute billing_descriptor 12 | # @return [String] 13 | class P24Source < PaymentSource 14 | attr_accessor :payment_country, 15 | :account_holder_name, 16 | :account_holder_email, 17 | :billing_descriptor 18 | 19 | def initialize 20 | super CheckoutSdk::Common::PaymentSourceType::P24 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/paypal_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute plan 6 | # @return [BillingPlan] 7 | class PayPalSource < PaymentSource 8 | attr_accessor :plan 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::PAYPAL 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/plaid_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute token 6 | # @return [String] 7 | # @!attribute account_holder 8 | # @return [CheckoutSdk::Common::AccountHolder] 9 | class PlaidSource < PaymentSource 10 | attr_accessor :token, :account_holder 11 | 12 | def initialize 13 | super CheckoutSdk::Common::PaymentSourceType::PLAID 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/post_finance_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute payment_country 6 | # @return [String] {CheckoutSdk::Common::Country} 7 | # @!attribute account_holder_name 8 | # @return [String] 9 | # @!attribute billing_descriptor 10 | # @return [String] 11 | class PostFinanceSource < PaymentSource 12 | attr_accessor :payment_country, 13 | :account_holder_name, 14 | :billing_descriptor 15 | 16 | def initialize 17 | super CheckoutSdk::Common::PaymentSourceType::POSTFINANCE 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/qpay_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute quantity 6 | # @return [Integer] 7 | # @!attribute description 8 | # @return [String] 9 | # @!attribute language 10 | # @return [String] 11 | # @!attribute national_id 12 | # @return [String] 13 | class QPaySource < PaymentSource 14 | attr_accessor :quantity, 15 | :description, 16 | :language, 17 | :national_id 18 | 19 | def initialize 20 | super CheckoutSdk::Common::PaymentSourceType::QPAY 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/sequra_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute billing_address 6 | # @return [CheckoutSdk::Common::Address] 7 | class SequraSource < PaymentSource 8 | attr_accessor :billing_address 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::SEQURA 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/sofort_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute countryCode 6 | # @return [String] {CheckoutSdk::Common::Country} 7 | # @!attribute languageCode 8 | # @return [String] 9 | class SofortSource < PaymentSource 10 | attr_accessor :countryCode, 11 | :languageCode 12 | 13 | def initialize 14 | super CheckoutSdk::Common::PaymentSourceType::SOFORT 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/stcpay_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class StcPaySource < PaymentSource 6 | def initialize 7 | super CheckoutSdk::Common::PaymentSourceType::STCPAY 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/tamara_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute billing_address 6 | # @return [CheckoutSdk::Common::Address] 7 | class TamaraSource < PaymentSource 8 | attr_accessor :billing_address 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::TAMARA 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/trustly_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute billing_address 6 | # @return [CheckoutSdk::Common::Address] 7 | class TrustlySource < PaymentSource 8 | attr_accessor :billing_address 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::TRUSTLY 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/apm/we_chat_pay_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute billing_address 6 | # @return [CheckoutSdk::Common::Address] 7 | class WeChatPaySource < PaymentSource 8 | attr_accessor :billing_address 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::WECHATPAY 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/currency_account_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class CurrencyAccountSource < PayoutSource 6 | def initialize 7 | super PayoutSourceType::CURRENCY_ACCOUNT 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/customer_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute id 6 | # @return [String] 7 | # @!attribute account_holder 8 | # @return [CheckoutSdk::Common::AccountHolder] 9 | class CustomerSource < PaymentSource 10 | attr_accessor :id, 11 | :account_holder 12 | 13 | def initialize 14 | super CheckoutSdk::Common::PaymentSourceType::CUSTOMER 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/entity_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | class EntitySource < PayoutSource 6 | def initialize 7 | super PayoutSourceType::ENTITY 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/id_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute id 6 | # @return [String] 7 | # @!attribute cvv 8 | # @return [String] 9 | # @!attribute payment_method 10 | # @return [String] 11 | # @!attribute stored 12 | # @return [TrueClass, FalseClass] 13 | # @!attribute store_for_future_use 14 | # @return [TrueClass, FalseClass] 15 | # @!attribute account_holder 16 | # @return [CheckoutSdk::Common::AccountHolder] 17 | class IdSource < PaymentSource 18 | attr_accessor :id, 19 | :cvv, 20 | :payment_method, 21 | :stored, 22 | :store_for_future_use, 23 | :account_holder 24 | 25 | def initialize 26 | super CheckoutSdk::Common::PaymentSourceType::ID 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/payment_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute type 6 | # @return [String] {CheckoutSdk::Common::PaymentSourceType} 7 | class PaymentSource 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] type {CheckoutSdk::Common::PaymentSourceType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/payout_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute type 6 | # @return [String] {PayoutSourceType} 7 | # @!attribute id 8 | # @return [String] 9 | # @!attribute amount 10 | # @return [String] 11 | class PayoutSource 12 | attr_reader :type 13 | attr_accessor :id, 14 | :amount 15 | 16 | protected 17 | 18 | # @abstract 19 | # @param [String] type {PayoutSourceType} 20 | def initialize(type) 21 | @type = type 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/payout_source_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module PayoutSourceType 6 | CURRENCY_ACCOUNT = 'currency_account' 7 | ENTITY = 'entity' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/source/provider_token_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute payment_method 6 | # @return [String] 7 | # @!attribute token 8 | # @return [String] 9 | # @!attribute account_holder 10 | # @return [CheckoutSdk::Common::AccountHolder] 11 | class ProviderTokenSource < PaymentSource 12 | attr_accessor :payment_method, 13 | :token, 14 | :account_holder 15 | 16 | def initialize 17 | super CheckoutSdk::Common::PaymentSourceType::PROVIDER_TOKEN 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/terminal_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module TerminalType 6 | APP = 'APP' 7 | WAP = 'WAP' 8 | WEB = 'WEB' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/three_ds_flow_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module ThreeDSFlowType 6 | CHALLENGED = 'challenged' 7 | FRICTIONLESS = 'frictionless' 8 | FRICTIONLESS_DELEGATED = 'frictionless_delegated' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/user_action.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | module UserAction 6 | PAY_NOW = 'PAY_NOW' 7 | CONTINUE = 'CONTINUE' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/payments/void_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Payments 5 | # @!attribute reference 6 | # @return [String] 7 | # @!attribute metadata 8 | # @return [Hash{String => Object}] 9 | class VoidRequest 10 | attr_accessor :reference, 11 | :metadata 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/platform_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module PlatformType 5 | PREVIOUS = 'PREVIOUS' 6 | DEFAULT = 'DEFAULT' 7 | OAUTH = 'OAUTH' 8 | CUSTOM = 'CUSTOM' 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/previous/checkout_previous_sdk_builder.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | class CheckoutPreviousSdkBuilder 6 | def static_keys 7 | CheckoutPreviousStaticKeysSdkBuilder.new 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/reconciliation/reconciliation.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/reconciliation/reconciliation_client' 4 | require 'checkout_sdk/reconciliation/reconciliation_query_payments_filter' 5 | -------------------------------------------------------------------------------- /lib/checkout_sdk/reconciliation/reconciliation_query_payments_filter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Reconciliation 6 | # @!attribute reference 7 | # @return [String] 8 | # @!attribute limit 9 | # @return [Integer] 10 | class ReconciliationQueryPaymentsFilter < CheckoutSdk::Common::DateRangeQueryFilter 11 | attr_accessor :reference, 12 | :limit 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/checkout_sdk/reports/reports.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/reports/reports_query' 4 | require 'checkout_sdk/reports/reports_client' 5 | -------------------------------------------------------------------------------- /lib/checkout_sdk/reports/reports_query.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Reports 5 | # @!attribute created_after 6 | # @return [DateTime] 7 | # @!attribute created_before 8 | # @return [DateTime] 9 | # @!attribute entity_id 10 | # @return [String] 11 | # @!attribute limit 12 | # @return [Integer] 13 | # @!attribute pagination_token 14 | # @return [String] 15 | class ReportsQuery 16 | attr_accessor :created_after, 17 | :created_before, 18 | :entity_id, 19 | :limit, 20 | :pagination_token 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/authentication_result.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute attempted 6 | # @return [TrueClass, FalseClass] 7 | # @!attribute challenged 8 | # @return [TrueClass, FalseClass] 9 | # @!attribute succeeded 10 | # @return [TrueClass, FalseClass] 11 | # @!attribute liability_shifted 12 | # @return [TrueClass, FalseClass] 13 | # @!attribute method 14 | # @return [String] 15 | # @!attribute version 16 | # @return [String] 17 | class AuthenticationResult 18 | attr_accessor :attempted, 19 | :challenged, 20 | :succeeded, 21 | :liability_shifted, 22 | :method, 23 | :version 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/authorization_result.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute avs_code 6 | # @return [String] 7 | # @!attribute cvv_result 8 | # @return [String] 9 | class AuthorizationResult 10 | attr_accessor :avs_code, 11 | :cvv_result 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/device.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute ip 6 | # @return [String] 7 | # @!attribute location 8 | # @return [Location] 9 | # @!attribute os 10 | # @return [String] 11 | # @!attribute type 12 | # @return [String] 13 | # @!attribute model 14 | # @return [String] 15 | # @!attribute date 16 | # @return [DateTime] 17 | # @!attribute user_agent 18 | # @return [String] 19 | # @!attribute fingerprint 20 | # @return [String] 21 | class Device 22 | attr_accessor :ip, 23 | :location, 24 | :os, 25 | :type, 26 | :model, 27 | :date, 28 | :user_agent, 29 | :fingerprint 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/location.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute latitude 6 | # @return [Integer] 7 | # @!attribute longitude 8 | # @return [Integer] 9 | class Location 10 | attr_accessor :latitude, 11 | :longitude 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/risk.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/risk/authentication_result' 4 | require 'checkout_sdk/risk/risk_payment' 5 | require 'checkout_sdk/risk/authorization_result' 6 | require 'checkout_sdk/risk/pre_capture_assessment' 7 | require 'checkout_sdk/risk/risk_client' 8 | require 'checkout_sdk/risk/source/risk_payment_source' 9 | require 'checkout_sdk/risk/source/customer_source' 10 | require 'checkout_sdk/risk/source/token_source' 11 | require 'checkout_sdk/risk/source/id_source' 12 | require 'checkout_sdk/risk/source/card_source' 13 | require 'checkout_sdk/risk/risk' 14 | require 'checkout_sdk/risk/location' 15 | require 'checkout_sdk/risk/risk_shipping_details' 16 | require 'checkout_sdk/risk/device' 17 | require 'checkout_sdk/risk/pre_authentication_assessment' 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/risk_payment.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute psp 6 | # @return [String] 7 | # @!attribute id 8 | # @return [String] 9 | class RiskPayment 10 | attr_accessor :psp, 11 | :id 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/risk_shipping_details.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute address 6 | # @return [CheckoutSdk::Common::Address] 7 | class RiskShippingDetails 8 | attr_accessor :address 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/source/card_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 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 billing_address 14 | # @return [CheckoutSdk::Common::Address] 15 | # @!attribute phone 16 | # @return [CheckoutSdk::Common::Phone] 17 | class CardSource < RiskPaymentSource 18 | attr_accessor :number, 19 | :expiry_month, 20 | :expiry_year, 21 | :name, 22 | :billing_address, 23 | :phone 24 | 25 | def initialize 26 | super CheckoutSdk::Common::PaymentSourceType::CARD 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/source/customer_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute id 6 | # @return [String] 7 | class CustomerSource < RiskPaymentSource 8 | attr_accessor :id 9 | 10 | def initialize 11 | super CheckoutSdk::Common::PaymentSourceType::CUSTOMER 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/source/id_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute id 6 | # @return [String] 7 | # @!attribute cvv 8 | # @return [String] 9 | class IdSource < RiskPaymentSource 10 | attr_accessor :id, 11 | :cvv 12 | 13 | def initialize 14 | super CheckoutSdk::Common::PaymentSourceType::ID 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/source/risk_payment_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute type 6 | # @return [String] {CheckoutSdk::Common::PaymentSourceType} 7 | class RiskPaymentSource 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] {CheckoutSdk::Common::PaymentSourceType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/risk/source/token_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Risk 5 | # @!attribute token 6 | # @return [String] 7 | # @!attribute billing_address 8 | # @return [CheckoutSdk::Common::Address] 9 | # @!attribute phone 10 | # @return [CheckoutSdk::Common::Phone] 11 | # @!attribute store_for_future_use 12 | # @return [TrueClass, FalseClass] 13 | class TokenSource < RiskPaymentSource 14 | attr_accessor :token, 15 | :billing_address, 16 | :phone, 17 | :store_for_future_use 18 | 19 | def initialize 20 | super CheckoutSdk::Common::PaymentSourceType::TOKEN 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sdk_authorization.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | class SdkAuthorization 5 | attr_accessor :platform_type, :credential 6 | 7 | # @param [String] platform_type {PlatformType} 8 | # @param [String] credential 9 | def initialize(platform_type, credential) 10 | @platform_type = platform_type 11 | @credential = credential 12 | end 13 | 14 | def authorization_header 15 | case @platform_type 16 | when PlatformType::PREVIOUS, PlatformType::CUSTOM 17 | @credential 18 | when PlatformType::DEFAULT, PlatformType::OAUTH 19 | "Bearer #{@credential}" 20 | else 21 | raise CheckoutAuthorizationException, 'Invalid platform type' 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sdk_credentials.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | class SdkCredentials 5 | protected 6 | 7 | # @abstract 8 | def get_authorization(authorization_type) 9 | raise NotImplementedError, 'Implement this method in a child class' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/authentication_method.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module AuthenticationMethod 6 | FEDERATED_ID = 'federated_id' 7 | FIDO = 'fido' 8 | ISSUER_CREDENTIALS = 'issuer_credentials' 9 | NO_AUTHENTICATION = 'no_authentication' 10 | OWN_CREDENTIALS = 'own_credentials' 11 | THIRD_PARTY_AUTHENTICATION = 'third_party_authentication' 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/authentication_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module AuthenticationType 6 | ADD_CARD = 'add_card' 7 | INSTALLMENT = 'installment' 8 | MAINTAIN_CARD = 'maintain_card' 9 | RECURRING = 'recurring' 10 | REGULAR = 'regular' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/category.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module Category 6 | PAYMENT = 'payment' 7 | NON_PAYMENT = 'nonPayment' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/channel/channel_data.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute channel 6 | # @return [String] {ChannelDataType} 7 | class ChannelData 8 | attr_reader :channel 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] channel {ChannelDataType} 14 | def initialize(channel) 15 | @channel = channel 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/channel/channel_data_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module ChannelDataType 6 | APP = 'app' 7 | BROWSER = 'browser' 8 | MERCHANT_INITIATED = 'merchant_initiated' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/channel/merchant_initiated_session.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute request_type 6 | # @return [RequestType] 7 | class MerchantInitiatedSession < ChannelData 8 | attr_accessor :request_type 9 | 10 | def initialize 11 | super ChannelDataType::MERCHANT_INITIATED 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/channel/request_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module RequestType 6 | ACCOUNT_VERIFICATION = 'account_verification' 7 | ADD_CARD = 'add_card' 8 | INSTALLMENT_TRANSACTION = 'installment_transaction' 9 | MAIL_ORDER = 'mail_order' 10 | MAINTAIN_CARD_INFORMATION = 'maintain_card_information' 11 | OTHER_PAYMENT = 'other_payment' 12 | RECURRING_TRANSACTION = 'recurring_transaction' 13 | SPLIT_OR_DELAYED_SHIPMENT = 'split_or_delayed_shipment' 14 | TELEPHONE_ORDER = 'telephone_order' 15 | TOP_UP = 'top_up' 16 | WHITELIST_STATUS_CHECK = 'whitelist_status_check' 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/channel/sdk_ephemeral_public_key.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute kty 6 | # @return [String] 7 | # @!attribute crv 8 | # @return [String] 9 | # @!attribute x 10 | # @return [String] 11 | # @!attribute y 12 | class SdkEphemeralPublicKey 13 | attr_accessor :kty, 14 | :crv, 15 | :x, 16 | :y 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/channel/sdk_interface_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module SdkInterfaceType 6 | BOTH = 'both' 7 | HTML = 'html' 8 | NATIVE = 'native' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/channel/three_ds_method_completion.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module ThreeDsMethodCompletion 6 | Y = 'y' 7 | N = 'n' 8 | U = 'u' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/channel/uie_elements.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module UIElements 6 | TEXT = 'text' 7 | SINGLE_SELECT = 'single_select' 8 | MULTI_SELECT = 'multi_select' 9 | OOB = 'oob' 10 | HTML_OTHER = 'html_other' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/completion/completion_info.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute type 6 | # @return [String] {CompletionInfoType} 7 | class CompletionInfo 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] type {CompletionInfoType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/completion/completion_info_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module CompletionInfoType 6 | HOSTED = 'hosted' 7 | NON_HOSTED = 'non_hosted' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/completion/hosted_completion_info.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute callback_url 6 | # @return [String] 7 | # @!attribute success_url 8 | # @return [String] 9 | # @!attribute failure_url 10 | # @return [String] 11 | class HostedCompletionInfo < CompletionInfo 12 | attr_accessor :callback_url, 13 | :success_url, 14 | :failure_url 15 | 16 | def initialize 17 | super CompletionInfoType::HOSTED 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/completion/non_hosted_completion_info.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute callback_url 6 | # @return [String] 7 | # @!attribute challenge_notification_url 8 | # # @return [String] 9 | class NonHostedCompletionInfo < CompletionInfo 10 | attr_accessor :callback_url, 11 | :challenge_notification_url 12 | 13 | def initialize 14 | super CompletionInfoType::NON_HOSTED 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/delivery_timeframe.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module DeliveryTimeframe 6 | ELECTRONIC_DELIVERY = 'electronic_delivery' 7 | SAME_DAY = 'same_day' 8 | OVERNIGHT = 'overnight' 9 | TWO_DAY_OR_MORE = 'two_day_or_more' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/initial_transaction.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute acs_transaction_id 6 | # @return [String] 7 | # @!attribute authentication_method 8 | # @return [String] 9 | # @!attribute authentication_timestamp 10 | # @return [String] 11 | # @!attribute authentication_data 12 | # @return [String] 13 | # @!attribute initial_session_id 14 | # @return [String] 15 | class InitialTransaction 16 | attr_accessor :acs_transaction_id, 17 | :authentication_method, 18 | :authentication_timestamp, 19 | :authentication_data, 20 | :initial_session_id 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/installment.rb: -------------------------------------------------------------------------------- 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 | 16 | def initialize(days_between_payments: 1, expiry: '99991231') 17 | @days_between_payments = days_between_payments 18 | @expiry = expiry 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/optimization.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/sessions/optimized_properties' 4 | 5 | module CheckoutSdk 6 | module Sessions 7 | # @!attribute optimized 8 | # @return [TrueClass, FalseClass] 9 | # @!attribute framework 10 | # @return [String] 11 | # @!attribute optimized_properties 12 | # @return [Array(OptimizedProperties)] 13 | class Optimization 14 | attr_accessor :optimized, 15 | :framework, 16 | :optimized_properties 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/optimized_properties.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute field 6 | # @return [String] 7 | # @!attribute original_value 8 | # @return [String] 9 | # @!attribute optimized_value 10 | # @return [String] 11 | class OptimizedProperties 12 | attr_accessor :field, 13 | :original_value, 14 | :optimized_value 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/pre_order_purchase_indicator_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module PreOrderPurchaseIndicatorType 6 | FUTURE_AVAILABILITY = 'future_availability' 7 | MERCHANDISE_AVAILABLE = 'merchandise_available' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/recurring.rb: -------------------------------------------------------------------------------- 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 | 13 | def initialize(days_between_payments: 1, expiry: '99991231') 14 | @days_between_payments = days_between_payments 15 | @expiry = expiry 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/reorder_items_indicator_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module ReorderItemsIndicatorType 6 | FIRST_TIME_ORDERED = 'first_time_ordered' 7 | REORDERED = 'reordered' 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/session_address.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute address_line3 6 | # @return [String] 7 | class SessionAddress < CheckoutSdk::Common::Address 8 | attr_accessor :address_line3 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/session_marketplace_data.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute sub_entity_id 6 | # @return [String] 7 | class SessionMarketplaceData 8 | attr_accessor :sub_entity_id 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/session_source_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module SessionSourceType 6 | CARD = 'card' 7 | ID = 'id' 8 | TOKEN = 'token' 9 | NETWORK_TOKEN = 'network_token' 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/sessions_billing_descriptor.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute name 6 | # @return [String] 7 | class SessionsBillingDescriptor 8 | attr_accessor :name 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/shipping_indicator.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module ShippingIndicator 6 | VISA = 'visa' 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/source/card_source.rb: -------------------------------------------------------------------------------- 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(stored: false) 26 | super SessionSourceType::CARD 27 | @stored = stored 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/source/id_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute id 6 | # @return [String] 7 | class IdSource < SessionSource 8 | attr_accessor :id 9 | 10 | def initialize 11 | super SessionSourceType::ID 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/source/network_token_source.rb: -------------------------------------------------------------------------------- 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 28 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/source/session_scheme.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module SessionScheme 6 | VISA = 'visa' 7 | MASTERCARD = 'mastercard' 8 | JCB = 'jcb' 9 | AMEX = 'amex' 10 | DINERS = 'diners' 11 | CARTES_BANCAIRES = 'cartes_bancaires' 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/source/token_source.rb: -------------------------------------------------------------------------------- 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 19 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/three_ds_method_completion_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/sessions/channel/three_ds_method_completion' 4 | 5 | module CheckoutSdk 6 | module Sessions 7 | # @!attribute three_ds_method_completion 8 | # @return [String] {CheckoutSdk::Sessions::Channel::ThreeDsMethodCompletion} 9 | class ThreeDsMethodCompletionRequest 10 | attr_accessor :three_ds_method_completion 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/three_ds_req_auth_method.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module ThreeDsReqAuthMethod 6 | NO_THREEDS_REQUESTOR_AUTHENTICATION_OCCURRED = 'no_threeds_requestor_authentication_occurred' 7 | THREE3DS_REQUESTOR_OWN_CREDENTIALS = 'three3ds_requestor_own_credentials' 8 | FEDERATED_ID = 'federated_id' 9 | ISSUER_CREDENTIALS = 'issuer_credentials' 10 | THIRD_PARTY_AUTHENTICATION = 'third_party_authentication' 11 | FIDO_AUTHENTICATOR = 'fido_authenticator' 12 | FIDO_AUTHENTICATOR_FIDO_ASSURANCE_DATA_SIGNED = 'fido_authenticator_fido_assurance_data_signed' 13 | SRC_ASSURANCE_DATA = 'src_assurance_data' 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/three_ds_requestor_authentication_info.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | # @!attribute three_ds_req_auth_method 6 | # @return [String] {ThreeDsReqAuthMethod} 7 | # @!attribute three_ds_req_auth_timestamp 8 | # @return [Time] 9 | # @!attribute three_ds_req_auth_data 10 | # @return [String] 11 | class ThreeDsRequestorAuthenticationInfo 12 | attr_accessor :three_ds_req_auth_method, 13 | :three_ds_req_auth_timestamp, 14 | :three_ds_req_auth_data 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sessions/transaction_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Sessions 5 | module TransactionType 6 | ACCOUNT_FUNDING = 'account_funding' 7 | CHECK_ACCEPTANCE = 'check_acceptance' 8 | GOODS_SERVICE = 'goods_service' 9 | PREPAID_ACTIVATION_AND_LOAD = 'prepaid_activation_and_load' 10 | QUASHI_CARD_TRANSACTION = 'quashi_card_transaction' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/checkout_sdk/simple_logger.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | class SimpleLogger 5 | attr_reader :logger 6 | 7 | def initialize(min_level = Logger::INFO) 8 | @logger = Logger.new($stdout) 9 | @logger.level = min_level 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sources/mandate_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Sources 6 | module MandateType 7 | SINGLE = 'single' 8 | RECURRING = 'recurring' 9 | end 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sources/sepa_source_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Sources 6 | # @!attribute billing_address 7 | # @return [CheckoutSdk::Common::Address] 8 | # @!attribute source_data 9 | # @return [SourceData] 10 | class SepaSourceRequest < SourceRequest 11 | attr_accessor :billing_address, 12 | :source_data 13 | 14 | def initialize 15 | super CheckoutSdk::Previous::Sources::SourceType::SEPA 16 | end 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sources/source_data.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Sources 6 | # @!attribute first_name 7 | # @return [String] 8 | # @!attribute last_name 9 | # @return [String] 10 | # @!attribute account_iban 11 | # @return [String] 12 | # @!attribute bic 13 | # @return [String] 14 | # @!attribute billing_descriptor 15 | # @return [String] 16 | # @!attribute mandate_type 17 | # @return [SourceData] 18 | class SourceData 19 | attr_accessor :first_name, 20 | :last_name, 21 | :account_iban, 22 | :bic, 23 | :billing_descriptor, 24 | :mandate_type 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sources/source_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Sources 6 | # @!attribute type 7 | # @return [String] {SourceType} 8 | # @!attribute reference 9 | # @return [String] 10 | # @!attribute phone 11 | # @return [CheckoutSdk::Common::Phone] 12 | # @!attribute customer 13 | # @return [CheckoutSdk::Common::CustomerRequest] 14 | class SourceRequest 15 | attr_reader :type 16 | attr_accessor :reference, 17 | :phone, 18 | :customer 19 | 20 | protected 21 | 22 | # @abstract 23 | # @param [String] {SourceType} 24 | def initialize(type) 25 | @type = type 26 | end 27 | end 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sources/source_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Sources 6 | module SourceType 7 | SEPA = 'sepa' 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sources/sources.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/sources/source_type' 4 | require 'checkout_sdk/sources/mandate_type' 5 | require 'checkout_sdk/sources/source_data' 6 | require 'checkout_sdk/sources/source_request' 7 | require 'checkout_sdk/sources/sepa_source_request' 8 | 9 | require 'checkout_sdk/sources/sources_client' 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/sources/sources_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Sources 6 | class SourcesClient < Client 7 | SOURCES = 'sources' 8 | private_constant :SOURCES 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 14 | end 15 | 16 | # @param [Hash, SepaSourceRequest] sepa_source_request 17 | def create_sepa_source(sepa_source_request) 18 | api_client.invoke_post(SOURCES, sdk_authorization, sepa_source_request) 19 | end 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/checkout_sdk/tokens/apple_pay_token_data.rb: -------------------------------------------------------------------------------- 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 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/tokens/apple_pay_token_request.rb: -------------------------------------------------------------------------------- 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 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/tokens/google_pay_token_data.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Tokens 5 | # @!attribute signature 6 | # @return [String] 7 | # @!attribute protocolVersion 8 | # @return [String] 9 | # @!attribute signedMessage 10 | # @return [String] 11 | class GooglePayTokenData 12 | attr_accessor :signature, 13 | :protocolVersion, 14 | :signedMessage 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/tokens/google_pay_token_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Tokens 5 | # @!attribute token_data 6 | # @return [GooglePayTokenData] 7 | class GooglePayTokenRequest < WalletTokenRequest 8 | attr_accessor :token_data 9 | 10 | def initialize 11 | super CheckoutSdk::Tokens::TokenType::GOOGLE_PAY 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/tokens/token_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Tokens 5 | module TokenType 6 | CARD = 'card' 7 | APPLE_PAY = 'applepay' 8 | GOOGLE_PAY = 'googlepay' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/tokens/tokens.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/tokens/tokens_client' 4 | require 'checkout_sdk/tokens/token_type' 5 | require 'checkout_sdk/tokens/wallet_token_request' 6 | require 'checkout_sdk/tokens/google_pay_token_data' 7 | require 'checkout_sdk/tokens/apple_pay_token_request' 8 | require 'checkout_sdk/tokens/google_pay_token_request' 9 | require 'checkout_sdk/tokens/apple_pay_token_data' 10 | require 'checkout_sdk/tokens/card_token_request' 11 | -------------------------------------------------------------------------------- /lib/checkout_sdk/tokens/tokens_client.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Tokens 5 | class TokensClient < Client 6 | TOKENS = 'tokens' 7 | private_constant :TOKENS 8 | 9 | # @param [ApiClient] api_client 10 | # @param [CheckoutConfiguration] configuration 11 | def initialize(api_client, configuration) 12 | super(api_client, configuration, CheckoutSdk::AuthorizationType::PUBLIC_KEY) 13 | end 14 | 15 | # @param [Hash, CardTokenRequest, WalletTokenRequest] token_request 16 | def request_token(token_request) 17 | api_client.invoke_post(TOKENS, sdk_authorization, token_request) 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/tokens/wallet_token_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Tokens 5 | # @!attribute type 6 | # @return [String] {TokenType} 7 | class WalletTokenRequest 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] type {TokenType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/transfers/create_transfer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Transfers 5 | # @!attribute transfer_type 6 | # @return [String] {TransferType} 7 | # @!attribute source 8 | # @return [TransferSource] 9 | # @!attribute destination 10 | # @return [TransferDestination] 11 | # @!attribute reference 12 | # @return [String] 13 | class CreateTransfer 14 | attr_accessor :transfer_type, 15 | :source, 16 | :destination, 17 | :reference 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/transfers/transfer_destination.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Transfers 5 | # @!attribute id 6 | # @return [String] 7 | class TransferDestination 8 | attr_accessor :id 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/transfers/transfer_source.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Transfers 5 | # @!attribute id 6 | # @return [String] 7 | # @!attribute amount 8 | # @return [Integer] 9 | # @!attribute currency 10 | # @return [CheckoutSdk::Common::Currency] 11 | class TransferSource 12 | attr_accessor :id, 13 | :amount, 14 | :currency 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/checkout_sdk/transfers/transfer_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Transfers 5 | module TransferType 6 | COMMISSION = 'commission' 7 | PROMOTION = 'promotion' 8 | REFUND = 'refund' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/transfers/transfers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/transfers/create_transfer' 4 | require 'checkout_sdk/transfers/transfers_client' 5 | require 'checkout_sdk/transfers/transfer_type' 6 | require 'checkout_sdk/transfers/transfers' 7 | require 'checkout_sdk/transfers/transfer_source' 8 | require 'checkout_sdk/transfers/transfer_destination' 9 | -------------------------------------------------------------------------------- /lib/checkout_sdk/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | VERSION = '1.4.0' 5 | end 6 | -------------------------------------------------------------------------------- /lib/checkout_sdk/webhooks/webhook_request.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Previous 5 | module Webhooks 6 | # @!attribute url 7 | # @return [String] 8 | # @!attribute active 9 | # @return [TrueClass, FalseClass] 10 | # @!attribute headers 11 | # @return [Hash(String=>String)] 12 | # @!attribute content_type 13 | # @return [String] 14 | # @!attribute event_types 15 | # @return [Array(String)] 16 | class WebhookRequest 17 | attr_accessor :url, 18 | :active, 19 | :headers, 20 | :content_type, 21 | :event_types 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/checkout_sdk/webhooks/webhooks.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/webhooks/webhook_request' 4 | require 'checkout_sdk/webhooks/webhooks_client' 5 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/create_workflow.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute name 6 | # @return [String] 7 | # @!attribute active 8 | # @return [TrueClass, FalseClass] 9 | # @!attribute conditions 10 | # @return [Array(WorkflowCondition)] 11 | # @!attribute actions 12 | # @return [Array(WorkflowAction)] 13 | class CreateWorkflow 14 | attr_accessor :name, 15 | :active, 16 | :conditions, 17 | :actions 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/entity_workflow_condition.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute entities 6 | # @return [Array(String)] 7 | class EntityWorkflowCondition < WorkflowCondition 8 | attr_accessor :entities 9 | 10 | def initialize 11 | super CheckoutSdk::Workflows::WorkflowConditionType::ENTITY 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/event_workflow_condition.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute events 6 | # @return [Hash(String=>Array(String))] 7 | class EventWorkflowCondition < WorkflowCondition 8 | attr_accessor :events 9 | 10 | def initialize 11 | super CheckoutSdk::Workflows::WorkflowConditionType::EVENT 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/patch_workflow.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute name 6 | # @return [String] 7 | # @!attribute active 8 | # @return [TrueClass, FalseClass] 9 | # @!attribute conditions 10 | # @return [Array(WorkflowCondition)] 11 | # @!attribute actions 12 | # @return [Array(WorkflowAction)] 13 | class PatchWorkflow 14 | attr_accessor :name, 15 | :active, 16 | :conditions, 17 | :actions 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/processing_channel_workflow_condition.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute processing_channels 6 | # @return [Array(String)] 7 | class ProcessingChannelWorkflowCondition < WorkflowCondition 8 | attr_accessor :processing_channels 9 | 10 | def initialize 11 | super CheckoutSdk::Workflows::WorkflowConditionType::PROCESSING_CHANNEL 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/reflow.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute workflows 6 | # @return [Array(String)] 7 | class Reflow 8 | attr_accessor :workflows 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/reflow_by_events.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute events 6 | # @return [Array(String)] 7 | class ReflowByEvents < Reflow 8 | attr_accessor :events 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/reflow_by_subjects.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute subjects 6 | # @return [Array(String)] 7 | class ReflowBySubjects < Reflow 8 | attr_accessor :subjects 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/webhook_signature.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute method 6 | # @return [String] 7 | # @!attribute key 8 | # @return [String] 9 | class WebhookSignature 10 | attr_accessor :method, 11 | :key 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/webhook_workflow_action.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute url 6 | # @return [String] 7 | # @!attribute headers 8 | # @return [Hash{String => String}] 9 | # @!attribute signature 10 | # @return [WebhookSignature] 11 | class WebhookWorkflowAction < WorkflowAction 12 | attr_accessor :url, 13 | :headers, 14 | :signature 15 | 16 | def initialize 17 | super CheckoutSdk::Workflows::WorkflowActionType::WEBHOOK 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/workflow_action.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute type 6 | # @return [String] {WorkflowActionType} 7 | class WorkflowAction 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] {WorkflowActionType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/workflow_action_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | module WorkflowActionType 6 | WEBHOOK = 'webhook' 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/workflow_condition.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | # @!attribute type 6 | # @return [String] {WorkflowConditionType} 7 | class WorkflowCondition 8 | attr_reader :type 9 | 10 | protected 11 | 12 | # @abstract 13 | # @param [String] {WorkflowConditionType} 14 | def initialize(type) 15 | @type = type 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/workflow_condition_type.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CheckoutSdk 4 | module Workflows 5 | module WorkflowConditionType 6 | EVENT = 'event' 7 | ENTITY = 'entity' 8 | PROCESSING_CHANNEL = 'processing_channel' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/checkout_sdk/workflows/workflows.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'checkout_sdk/workflows/reflow' 4 | require 'checkout_sdk/workflows/workflow_condition' 5 | require 'checkout_sdk/workflows/workflow_condition_type' 6 | require 'checkout_sdk/workflows/event_workflow_condition' 7 | require 'checkout_sdk/workflows/workflow_action' 8 | require 'checkout_sdk/workflows/workflows' 9 | require 'checkout_sdk/workflows/workflows_client' 10 | require 'checkout_sdk/workflows/entity_workflow_condition' 11 | require 'checkout_sdk/workflows/create_workflow' 12 | require 'checkout_sdk/workflows/processing_channel_workflow_condition' 13 | require 'checkout_sdk/workflows/webhook_workflow_action' 14 | require 'checkout_sdk/workflows/reflow_by_events' 15 | require 'checkout_sdk/workflows/webhook_signature' 16 | require 'checkout_sdk/workflows/patch_workflow' 17 | require 'checkout_sdk/workflows/workflow_action_type' 18 | require 'checkout_sdk/workflows/reflow_by_subjects' 19 | -------------------------------------------------------------------------------- /sig/checkout_sdk.rbs: -------------------------------------------------------------------------------- 1 | module CheckoutSdk 2 | VERSION: String 3 | # See the writing guide of rbs: https://github.com/ruby/rbs#guides 4 | end 5 | -------------------------------------------------------------------------------- /spec/checkout_sdk/balances/balances_integration_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe CheckoutSdk::Balances do 2 | 3 | describe '.retrieve_entity_balances' do 4 | context 'when requesting balances for a entity' do 5 | it 'successfully retrieve entity balances' do 6 | query = "currency=#{CheckoutSdk::Common::Currency::GBP}" 7 | response = oauth_sdk.balances.retrieve_entity_balances('ent_kidtcgc3ge5unf4a5i6enhnr5m', query) 8 | 9 | expect(response).not_to be_nil 10 | response.data&.each do |balance| 11 | expect(balance.descriptor).not_to be_nil 12 | expect(balance.holding_currency).not_to be_nil 13 | expect(balance.balances).not_to be_nil 14 | end 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/checkout_sdk/configuration/static_keys_sdk_credentials_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe CheckoutSdk::StaticKeysSdkCredentials do 2 | context 'build correctly sdk credentials' do 3 | it 'should retrieve secret key authorization' do 4 | creds = CheckoutSdk::StaticKeysSdkCredentials.new('secret', 'public') 5 | expect(creds).not_to be nil 6 | expect(creds.class).to eq(CheckoutSdk::StaticKeysSdkCredentials) 7 | expect(creds.get_authorization(CheckoutSdk::AuthorizationType::SECRET_KEY)).not_to be nil 8 | end 9 | 10 | it 'should retrieve public key authorization' do 11 | creds = CheckoutSdk::StaticKeysSdkCredentials.new('secret', 'public') 12 | expect(creds).not_to be nil 13 | expect(creds.class).to eq(CheckoutSdk::StaticKeysSdkCredentials) 14 | expect(creds.get_authorization(CheckoutSdk::AuthorizationType::PUBLIC_KEY)).not_to be nil 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/checkout_sdk/events/events_integration_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe CheckoutSdk::Previous::Webhooks do 2 | 3 | describe '.retrieve_all_event_types' do 4 | context 'when fetching event types' do 5 | it 'should return even types for both versions', skip: 'unavailable' do 6 | response = previous_sdk.events.retrieve_all_event_types 7 | expect(response).not_to be_nil 8 | expect(response.items).not_to be_nil 9 | expect(response.items[0].version).to eq '1.0' 10 | expect(response.items[1].version).to eq '2.0' 11 | end 12 | 13 | it 'should return even types for version one', skip: 'unavailable' do 14 | response = previous_sdk.events.retrieve_all_event_types '1.0' 15 | expect(response).not_to be_nil 16 | expect(response.items).not_to be_nil 17 | expect(response.items.length).to be 1 18 | expect(response.items[0].version).to eq '1.0' 19 | end 20 | end 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /spec/checkout_sdk/payments/payment_actions_integration_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe CheckoutSdk::Payments do 2 | include PaymentsHelper 3 | 4 | describe '.get_payment_actions' do 5 | context 'when make a payment' do 6 | it 'get payment actions' do 7 | payment_response = make_card_payment(capture:true) 8 | 9 | proc = lambda { default_sdk.payments.get_payment_actions(payment_response.id) } 10 | predicate = lambda { |response| there_are_two_payment_actions(response) } 11 | 12 | response = retriable(proc, predicate) 13 | assert_response response 14 | expect(response.items.length).to eq(2) 15 | end 16 | end 17 | end 18 | end 19 | 20 | def there_are_two_payment_actions(response) 21 | response.items.length == 2 22 | end 23 | -------------------------------------------------------------------------------- /spec/checkout_sdk/payments/previous/payment_actions_integration_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe CheckoutSdk::Previous::Payments do 2 | include Previous::PaymentsHelper 3 | 4 | before(:all) do 5 | @api = previous_sdk 6 | end 7 | 8 | describe '.get_payment_actions', skip: 'unavailable' do 9 | context 'when make a payment' do 10 | it 'get payment actions' do 11 | payment_response = make_card_payment(capture: true) 12 | 13 | proc = -> { @api.payments.get_payment_actions(payment_response.id) } 14 | predicate = ->(response) { there_are_two_payment_actions(response) } 15 | 16 | response = retriable(proc, predicate) 17 | assert_response response 18 | expect(response.items.length).to eq(2) 19 | end 20 | end 21 | end 22 | end 23 | 24 | def there_are_two_payment_actions(response) 25 | response.items.length == 2 26 | end 27 | -------------------------------------------------------------------------------- /spec/checkout_sdk/payments/sessions/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaymentSessionsHelper 4 | 5 | def create_payment_sessions 6 | request = { 7 | 'amount' => 2000, 8 | 'currency' => CheckoutSdk::Common::Currency::GBP, 9 | 'reference' => 'ORD-123A', 10 | 'billing' => { 11 | 'address' => { 12 | 'country' => CheckoutSdk::Common::Country::GB 13 | } 14 | }, 15 | 'customer' => { 16 | 'name' => 'John Smith', 17 | 'email' => 'john.smith@example.com', 18 | }, 19 | 'success_url' => 'https://example.com/payments/success', 20 | 'failure_url' => 'https://example.com/payments/fail' 21 | } 22 | 23 | response = default_sdk.payment_sessions.create_payment_sessions(request) 24 | expect(response).not_to be nil 25 | 26 | response 27 | end 28 | 29 | end 30 | -------------------------------------------------------------------------------- /spec/checkout_sdk/payments/sessions/sessions_integration_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | RSpec.describe CheckoutSdk::Payments do 4 | include PaymentSessionsHelper 5 | 6 | before(:all) do 7 | @payment_sessions = create_payment_sessions 8 | end 9 | 10 | describe '.create_payment_sessions' do 11 | context 'when creating a payment sessions with valid data' do 12 | it { is_valid_payment_sessions @payment_sessions } 13 | end 14 | end 15 | end 16 | 17 | def is_valid_payment_sessions(payment_sessions) 18 | assert_response payment_sessions, %w[id 19 | payment_session_token 20 | _links 21 | _links.self] 22 | 23 | expect(payment_sessions.id).not_to be nil 24 | end 25 | -------------------------------------------------------------------------------- /spec/checkout_sdk/tokens/previous/tokens_integration_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe CheckoutSdk::Tokens do 2 | 3 | describe '.request_card_token', skip: 'unavailable' do 4 | context "when requesting a token with correct data" do 5 | it 'returns a valid card token' do 6 | request = CheckoutSdk::Tokens::CardTokenRequest.new 7 | request.number = visa_card.card_number 8 | request.expiry_month = visa_card.expiry_month 9 | request.expiry_year = visa_card.expiry_year 10 | 11 | response = previous_sdk.tokens.request_token(request) 12 | 13 | expect(default_sdk).not_to be nil 14 | expect(response).not_to be nil 15 | expect(response.token).not_to be nil 16 | end 17 | end 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /spec/checkout_sdk/tokens/tokens_integration_spec.rb: -------------------------------------------------------------------------------- 1 | RSpec.describe CheckoutSdk::Tokens do 2 | 3 | describe '.request_card_token' do 4 | context "when requesting a token with correct data" do 5 | it 'returns a valid card token' do 6 | request = CheckoutSdk::Tokens::CardTokenRequest.new 7 | request.number = visa_card.card_number 8 | request.expiry_month = visa_card.expiry_month 9 | request.expiry_year = visa_card.expiry_year 10 | 11 | response = default_sdk.tokens.request_token(request) 12 | 13 | expect(default_sdk).not_to be nil 14 | expect(response).not_to be nil 15 | expect(response.token).not_to be nil 16 | end 17 | end 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /spec/resources/checkout.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/checkout/checkout-sdk-ruby/12c6a6d7e2564fd5196feb2f925e1db00cffcfb5/spec/resources/checkout.jpeg -------------------------------------------------------------------------------- /spec/resources/checkout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/checkout/checkout-sdk-ruby/12c6a6d7e2564fd5196feb2f925e1db00cffcfb5/spec/resources/checkout.pdf --------------------------------------------------------------------------------