├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── PULL_REQUEST_TEMPLATE.md ├── release.yml └── workflows │ ├── codeql.yml │ ├── label_new_issues.yml │ ├── release.yml │ ├── ruby.yml │ ├── rubygems_release.yml │ └── stale.yml ├── .gitignore ├── .rubocop.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Gemfile ├── LICENSE ├── Makefile ├── README.md ├── Rakefile ├── VERSION ├── adyen-ruby-api-library.gemspec ├── bin ├── console └── setup ├── lib ├── adyen-ruby-api-library.rb └── adyen │ ├── client.rb │ ├── errors.rb │ ├── hash_with_accessors.rb │ ├── result.rb │ ├── services │ ├── balanceControlService.rb │ ├── balancePlatform.rb │ ├── balancePlatform │ │ ├── account_holders_api.rb │ │ ├── balance_accounts_api.rb │ │ ├── balances_api.rb │ │ ├── bank_account_validation_api.rb │ │ ├── card_orders_api.rb │ │ ├── grant_accounts_api.rb │ │ ├── grant_offers_api.rb │ │ ├── manage_card_pin_api.rb │ │ ├── manage_sca_devices_api.rb │ │ ├── network_tokens_api.rb │ │ ├── payment_instrument_groups_api.rb │ │ ├── payment_instruments_api.rb │ │ ├── platform_api.rb │ │ ├── transaction_rules_api.rb │ │ └── transfer_routes_api.rb │ ├── binLookup.rb │ ├── checkout.rb │ ├── checkout │ │ ├── donations_api.rb │ │ ├── modifications_api.rb │ │ ├── orders_api.rb │ │ ├── payment_links_api.rb │ │ ├── payments_api.rb │ │ ├── recurring_api.rb │ │ └── utility_api.rb │ ├── dataProtection.rb │ ├── disputes.rb │ ├── legalEntityManagement.rb │ ├── legalEntityManagement │ │ ├── business_lines_api.rb │ │ ├── documents_api.rb │ │ ├── hosted_onboarding_api.rb │ │ ├── legal_entities_api.rb │ │ ├── pci_questionnaires_api.rb │ │ ├── tax_e_delivery_consent_api.rb │ │ ├── terms_of_service_api.rb │ │ └── transfer_instruments_api.rb │ ├── management.rb │ ├── management │ │ ├── account_company_level_api.rb │ │ ├── account_merchant_level_api.rb │ │ ├── account_store_level_api.rb │ │ ├── allowed_origins_company_level_api.rb │ │ ├── allowed_origins_merchant_level_api.rb │ │ ├── android_files_company_level_api.rb │ │ ├── api_credentials_company_level_api.rb │ │ ├── api_credentials_merchant_level_api.rb │ │ ├── api_key_company_level_api.rb │ │ ├── api_key_merchant_level_api.rb │ │ ├── client_key_company_level_api.rb │ │ ├── client_key_merchant_level_api.rb │ │ ├── my_api_credential_api.rb │ │ ├── payment_methods_merchant_level_api.rb │ │ ├── payout_settings_merchant_level_api.rb │ │ ├── split_configuration_merchant_level_api.rb │ │ ├── terminal_actions_company_level_api.rb │ │ ├── terminal_actions_terminal_level_api.rb │ │ ├── terminal_orders_company_level_api.rb │ │ ├── terminal_orders_merchant_level_api.rb │ │ ├── terminal_settings_company_level_api.rb │ │ ├── terminal_settings_merchant_level_api.rb │ │ ├── terminal_settings_store_level_api.rb │ │ ├── terminal_settings_terminal_level_api.rb │ │ ├── terminals_terminal_level_api.rb │ │ ├── users_company_level_api.rb │ │ ├── users_merchant_level_api.rb │ │ ├── webhooks_company_level_api.rb │ │ └── webhooks_merchant_level_api.rb │ ├── marketpay.rb │ ├── payment.rb │ ├── paymentsApp.rb │ ├── payout.rb │ ├── payout │ │ ├── initialization_api.rb │ │ ├── instant_payouts_api.rb │ │ └── reviewing_api.rb │ ├── posMobile.rb │ ├── posTerminalManagement.rb │ ├── recurring.rb │ ├── service.rb │ ├── sessionAuthentication.rb │ ├── sessionAuthentication │ │ └── session_authentication_api.rb │ ├── storedValue.rb │ ├── terminalCloudAPI.rb │ ├── transfers.rb │ └── transfers │ │ ├── capital_api.rb │ │ ├── transactions_api.rb │ │ └── transfers_api.rb │ ├── utils │ └── hmac_validator.rb │ └── version.rb ├── renovate.json ├── spec ├── account_spec.rb ├── balance_control_spec.rb ├── balance_platform_spec.rb ├── bin_lookup_spec.rb ├── checkout-oauth_spec.rb ├── checkout_spec.rb ├── client_spec.rb ├── data_protection_spec.rb ├── disputes_spec.rb ├── errors_spec.rb ├── fund_spec.rb ├── hash_with_accessors_spec.rb ├── hop_spec.rb ├── lem_spec.rb ├── management-oauth_spec.rb ├── management_spec.rb ├── mocks │ ├── requests │ │ ├── Account │ │ │ ├── check_account_holder.json │ │ │ ├── close_account.json │ │ │ ├── close_account_holder.json │ │ │ ├── create_account.json │ │ │ ├── create_account_holder.json │ │ │ ├── delete_bank_accounts.json │ │ │ ├── delete_payout_methods.json │ │ │ ├── delete_shareholders.json │ │ │ ├── delete_signatories.json │ │ │ ├── get_account_holder.json │ │ │ ├── get_uploaded_documents.json │ │ │ ├── suspend_account_holder.json │ │ │ ├── un_suspend_account_holder.json │ │ │ ├── update_account.json │ │ │ ├── update_account_holder.json │ │ │ ├── update_account_holder_state.json │ │ │ └── upload_document.json │ │ ├── BalanceControl │ │ │ └── balance_transfer.json │ │ ├── BalancePlatform │ │ │ ├── create_account_holder.json │ │ │ └── update_account_holder.json │ │ ├── BinLookup │ │ │ ├── get_3ds_availability.json │ │ │ └── get_cost_estimate.json │ │ ├── Checkout │ │ │ ├── amount_updates.json │ │ │ ├── apple_pay_sessions.json │ │ │ ├── capture.json │ │ │ ├── generic_cancel.json │ │ │ ├── modifications_request.json │ │ │ ├── orders.json │ │ │ ├── orders_cancel.json │ │ │ ├── origin_keys.json │ │ │ ├── payment-details.json │ │ │ ├── payment-result.json │ │ │ ├── payment_links.json │ │ │ ├── payment_methods.json │ │ │ ├── payment_methods_balance.json │ │ │ ├── payment_session.json │ │ │ ├── payments.json │ │ │ ├── psp_cancel.json │ │ │ ├── refund.json │ │ │ ├── sessions.json │ │ │ └── verify.json │ │ ├── DataProtectionService │ │ │ └── request_subject_erasure.json │ │ ├── DisputesService │ │ │ └── retrieve_applicable_defense_reasons.json │ │ ├── Fund │ │ │ ├── account_holder_balance.json │ │ │ ├── account_holder_transaction_list.json │ │ │ ├── payout_account_holder.json │ │ │ ├── refund_funds_transfer.json │ │ │ ├── refund_not_paid_out_transfers.json │ │ │ ├── setup_beneficiary.json │ │ │ └── transfer_funds.json │ │ ├── Hop │ │ │ └── get_onboarding_url.json │ │ ├── LegalEntityManagement │ │ │ └── create_business_line.json │ │ ├── Management │ │ │ └── create_store.json │ │ ├── Notification │ │ │ ├── create_notification_configuration.json │ │ │ ├── delete_notification_configurations.json │ │ │ ├── get_notification_configuration.json │ │ │ ├── get_notification_configuration_list.json │ │ │ ├── test_notification_configuration.json │ │ │ └── update_notification_configuration.json │ │ ├── Payment │ │ │ ├── adjust_authorisation.json │ │ │ ├── authorise.json │ │ │ ├── authorise3d.json │ │ │ ├── authorise3ds2.json │ │ │ ├── cancel.json │ │ │ ├── cancel_or_refund.json │ │ │ ├── capture.json │ │ │ ├── donate.json │ │ │ ├── get_authentication_result.json │ │ │ ├── refund.json │ │ │ ├── retrieve_3ds2_result.json │ │ │ ├── technical_cancel.json │ │ │ └── void_pending_refund.json │ │ ├── Payout │ │ │ ├── confirm_third_party.json │ │ │ ├── decline_third_party.json │ │ │ ├── payout.json │ │ │ ├── store_detail.json │ │ │ ├── store_detail_and_submit_third_party.json │ │ │ └── submit_third_party.json │ │ ├── Recurring │ │ │ ├── create_permit.json │ │ │ ├── disable.json │ │ │ ├── list_recurring_details.json │ │ │ └── schedule_account_updater.json │ │ ├── StoredValue │ │ │ └── issue_giftcard.json │ │ ├── Terminal │ │ │ ├── assign_terminals.json │ │ │ ├── find_terminal.json │ │ │ └── get_terminals_under_account.json │ │ ├── TerminalCloudAPI │ │ │ ├── connected_terminals.json │ │ │ └── sync_payment.json │ │ └── Transfers │ │ │ ├── get_transactions.json │ │ │ └── make_transfer.json │ └── responses │ │ ├── Account │ │ ├── check_account_holder.json │ │ ├── close_account.json │ │ ├── close_account_holder.json │ │ ├── create_account.json │ │ ├── create_account_holder.json │ │ ├── delete_bank_accounts.json │ │ ├── delete_payout_methods.json │ │ ├── delete_shareholders.json │ │ ├── delete_signatories.json │ │ ├── get_account_holder.json │ │ ├── get_uploaded_documents.json │ │ ├── suspend_account_holder.json │ │ ├── un_suspend_account_holder.json │ │ ├── update_account.json │ │ ├── update_account_holder.json │ │ ├── update_account_holder_state.json │ │ └── upload_document.json │ │ ├── BalanceControl │ │ └── balance_transfer.json │ │ ├── BalancePlatform │ │ ├── create_account_holder.json │ │ ├── get_balance_account.json │ │ └── update_account_holder.json │ │ ├── BinLookup │ │ ├── get_3ds_availability.json │ │ └── get_cost_estimate.json │ │ ├── Checkout │ │ ├── amount_updates.json │ │ ├── apple_pay_sessions.json │ │ ├── capture.json │ │ ├── generic_cancel.json │ │ ├── get-payment-link.json │ │ ├── modifications.json │ │ ├── orders.json │ │ ├── orders_cancel.json │ │ ├── origin_keys.json │ │ ├── payment-details.json │ │ ├── payment-result.json │ │ ├── payment_links.json │ │ ├── payment_methods.json │ │ ├── payment_methods_balance.json │ │ ├── payment_session.json │ │ ├── payments.json │ │ ├── psp_cancel.json │ │ ├── refund.json │ │ ├── sessions-success.json │ │ ├── stored_payment_methods.json │ │ ├── update-payment-link.json │ │ └── verify.json │ │ ├── DataProtectionService │ │ └── request_subject_erasure.json │ │ ├── DisputesService │ │ └── retrieve_applicable_defense_reasons.json │ │ ├── Fund │ │ ├── account_holder_balance.json │ │ ├── account_holder_transaction_list.json │ │ ├── payout_account_holder.json │ │ ├── refund_funds_transfer.json │ │ ├── refund_not_paid_out_transfers.json │ │ ├── setup_beneficiary.json │ │ └── transfer_funds.json │ │ ├── Hop │ │ └── get_onboarding_url.json │ │ ├── LegalEntityManagement │ │ └── create_business_line.json │ │ ├── Management │ │ ├── create_store.json │ │ └── get_companies.json │ │ ├── Notification │ │ ├── create_notification_configuration.json │ │ ├── delete_notification_configurations.json │ │ ├── get_notification_configuration.json │ │ ├── get_notification_configuration_list.json │ │ ├── test_notification_configuration.json │ │ └── update_notification_configuration.json │ │ ├── Payment │ │ ├── adjust_authorisation.json │ │ ├── authorise.json │ │ ├── authorise3d.json │ │ ├── authorise3ds2.json │ │ ├── cancel.json │ │ ├── cancel_or_refund.json │ │ ├── capture.json │ │ ├── donate.json │ │ ├── get_authentication_result.json │ │ ├── refund.json │ │ ├── retrieve_3ds2_result.json │ │ ├── technical_cancel.json │ │ └── void_pending_refund.json │ │ ├── Payout │ │ ├── confirm_third_party.json │ │ ├── decline_third_party.json │ │ ├── payout.json │ │ ├── store_detail.json │ │ ├── store_detail_and_submit_third_party.json │ │ └── submit_third_party.json │ │ ├── Recurring │ │ ├── create_permit.json │ │ ├── disable.json │ │ ├── list_recurring_details.json │ │ └── schedule_account_updater.json │ │ ├── StoredValue │ │ └── issue_giftcard.json │ │ ├── Terminal │ │ ├── assign_terminals.json │ │ ├── find_terminal.json │ │ └── get_terminals_under_account.json │ │ ├── TerminalCloudAPI │ │ ├── connected_terminals.json │ │ └── sync_payment.json │ │ ├── Transfers │ │ ├── get_transactions.json │ │ └── make_transfer.json │ │ └── Webhooks │ │ ├── backslash_webhook.json │ │ ├── colon_webhook.json │ │ ├── forwardslash_webhook.json │ │ └── mixed_webhook.json ├── notification_spec.rb ├── payments_spec.rb ├── payouts_spec.rb ├── pos_terminal_management_spec.rb ├── recurring_spec.rb ├── service_spec.rb ├── spec_helper.rb ├── stored_value_spec.rb ├── terminal_cloud_api_spec.rb ├── transfers_spec.rb └── utils │ └── hmac_validator_spec.rb └── templates ├── api-single.mustache ├── api-small.mustache ├── api.mustache └── config.yaml /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @Adyen/developer-relations 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Request a new feature or improvement. See open issues before requesting. 3 | title: "[Feature]: " 4 | labels: ["Feature"] 5 | assignees: [] 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: "#### Is your feature request related to a problem? Please describe." 10 | 11 | - type: input 12 | id: feature-summary 13 | attributes: 14 | label: "Feature summary" 15 | description: "Provide a short description of the feature request." 16 | placeholder: "Example: Add support for donation event." 17 | 18 | - type: textarea 19 | id: problem-statement 20 | attributes: 21 | label: "Problem statement" 22 | description: "Explain the problem this feature aims to solve." 23 | placeholder: "Example: I have an issue with consuming the donations webhook." 24 | validations: 25 | required: true 26 | 27 | - type: textarea 28 | id: proposed-solution 29 | attributes: 30 | label: "Proposed solution" 31 | description: "Describe how you want this feature to work." 32 | placeholder: "Example: Add Donation enum to ..." 33 | validations: 34 | required: true 35 | 36 | - type: textarea 37 | id: alternatives 38 | attributes: 39 | label: "Alternatives considered" 40 | description: "Describe any alternative solutions you've explored." 41 | placeholder: "Example: I tried to extend the current namespace but ..." 42 | 43 | - type: textarea 44 | id: additional-context 45 | attributes: 46 | label: "Additional context" 47 | description: "Provide any extra details, references, or screenshots." -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Description** 2 | 3 | 4 | **Tested scenarios** 5 | 6 | 7 | **Fixed issue**: 8 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | exclude: 3 | authors: 4 | - renovate[bot] 5 | - dependabot[bot] 6 | categories: 7 | - title: Breaking Changes 🛠 8 | labels: 9 | - Breaking change 10 | - title: New Features 💎 11 | labels: 12 | - Feature 13 | - title: Fixes ⛑️ 14 | labels: 15 | - Fix 16 | - title: Other Changes 🖇️ 17 | labels: 18 | - "*" 19 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | schedule: 5 | - cron: "40 12 * * 0" 6 | 7 | jobs: 8 | analyze: 9 | name: Analyze 10 | runs-on: ubuntu-latest 11 | permissions: 12 | actions: read 13 | contents: read 14 | security-events: write 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | language: [ javascript ] 20 | 21 | steps: 22 | - name: Checkout 23 | uses: actions/checkout@v4 24 | 25 | - name: Initialize CodeQL 26 | uses: github/codeql-action/init@v3 27 | with: 28 | languages: ${{ matrix.language }} 29 | queries: +security-and-quality 30 | 31 | - name: Autobuild 32 | uses: github/codeql-action/autobuild@v3 33 | 34 | - name: Perform CodeQL Analysis 35 | uses: github/codeql-action/analyze@v3 36 | with: 37 | category: "/language:${{ matrix.language }}" 38 | -------------------------------------------------------------------------------- /.github/workflows/label_new_issues.yml: -------------------------------------------------------------------------------- 1 | name: Label New Issues 2 | on: 3 | issues: 4 | types: [opened] 5 | 6 | jobs: 7 | add-label: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Add 'needs response' label to new issues 11 | uses: actions-ecosystem/action-add-labels@v1 12 | with: 13 | github_token: ${{ secrets.GITHUB_TOKEN }} 14 | labels: 'needs response' 15 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | pre-release: 7 | required: false 8 | type: boolean 9 | default: false 10 | description: "This release will be labeled as non-production ready" 11 | github-release: 12 | required: false 13 | type: boolean 14 | default: false 15 | description: "Publish Github release for the current version" 16 | # Monitor pull request events 17 | pull_request: 18 | types: 19 | - closed 20 | branches: 21 | - main 22 | 23 | jobs: 24 | release: 25 | permissions: 26 | contents: write 27 | pull-requests: write 28 | runs-on: ubuntu-latest 29 | steps: 30 | - uses: actions/checkout@v4 31 | - name: Prepare the next main release 32 | uses: Adyen/release-automation-action@v1.3.1 33 | with: 34 | token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} 35 | develop-branch: main 36 | version-files: lib/adyen/version.rb 37 | release-title: Adyen Ruby API Library 38 | pre-release: ${{ inputs.pre-release || false }} 39 | github-release: ${{ inputs.github-release || false }} 40 | separator: .pre.beta 41 | -------------------------------------------------------------------------------- /.github/workflows/ruby.yml: -------------------------------------------------------------------------------- 1 | name: ruby 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | strategy: 8 | fail-fast: false 9 | matrix: 10 | os: [ubuntu-latest] 11 | # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' 12 | ruby: [2.7, '3.0', 3.1, 3.2, head] 13 | runs-on: ${{ matrix.os }} 14 | steps: 15 | - uses: actions/checkout@v4 16 | - uses: ruby/setup-ruby@v1 17 | with: 18 | ruby-version: ${{ matrix.ruby }} 19 | bundler-cache: true # runs 'bundle install' and caches installed gems automatically 20 | - run: bundle exec rspec 21 | -------------------------------------------------------------------------------- /.github/workflows/rubygems_release.yml: -------------------------------------------------------------------------------- 1 | name: Publish Gem 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v4 13 | - name: Release Gem on RubyGems 14 | if: contains(github.ref, 'refs/tags/v') 15 | uses: cadwallion/publish-rubygems-action@v1.1.0 16 | env: 17 | GITHUB_TOKEN: ${{secrets.TOKEN_RUBYGEMS_RELEASES_WITH_EXPIRATION}} 18 | RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} 19 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: Close Stale Issues 2 | on: 3 | schedule: 4 | - cron: '30 8 * * *' 5 | 6 | jobs: 7 | stale: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/stale@v9 11 | with: 12 | repo-token: ${{ secrets.GITHUB_TOKEN }} 13 | stale-issue-message: 'This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs.' 14 | close-issue-message: 'This issue was closed due to inactivity. Please reopen if you still encounter this problem or have more information to add.' 15 | stale-pr-message: "This PR hasn't received any updates in a year and will be automatically closed in 30 days. Feel free to re-open if you plan to continue working on this pull request" 16 | days-before-stale: -1 17 | days-before-close: -1 18 | days-before-issue-stale: 14 19 | days-before-issue-close: 7 20 | stale-issue-label: 'stale' 21 | close-issue-label: 'closed-due-to-inactivity' 22 | exempt-issue-labels: 'do not stale, needs response' 23 | days-before-pr-stale: 365 24 | days-before-pr-close: 30 25 | exempt-pr-labels: 'do not stale' 26 | only-pr-labels: awaiting-changes,blocked,work-in-progress,awaiting-upstream 27 | remove-pr-stale-when-updated: true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | design.txt 2 | /Gemfile.lock 3 | *.gem 4 | 5 | # VSCode 6 | .vs 7 | *.code-workspace 8 | 9 | .rspec 10 | .rspec_status 11 | 12 | .bundle 13 | .ruby-version 14 | 15 | .DS_Store 16 | 17 | .idea 18 | main.rb 19 | build/ 20 | openapi-generator-cli-6.0.1.jar 21 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | Style/FrozenStringLiteralComment: 2 | Enabled: false 3 | Metrics/BlockLength: 4 | Enabled: false 5 | Documentation: 6 | Enabled: false 7 | Naming/FileName: 8 | Enabled: false 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution guidelines 2 | 3 | ## How to contribute step-by-step 4 | 5 | 1. Fork the `Adyen/adyen-ruby-api-library` repository. 6 | 2. Create a new branch from `main` in your fork. This makes it easier for you to keep track of your changes. 7 | 3. Make the desired changes to the code. 8 | * If you are adding new functionality or fixing a bug, we recommend you add unit tests that cover it. 9 | 4. Push the changes to your fork. 10 | 5. Create a pull request to the `Adyen/adyen-ruby-api-library` repository. 11 | 6. In your pull request, please describe in detail: 12 | * What problem you’re solving 13 | * Your approach to fixing the problem 14 | * Any tests you wrote 15 | 7. Check Allow edits from maintainers. 16 | 8. Create the pull request. 17 | 9. Ensure that all checks have passed. 18 | 19 | After you create your pull request, one of the code owners will review your code. 20 | We aim to review your request within 2-3 business days. 21 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | ruby '>= 2.7.0' 6 | 7 | gem 'faraday' 8 | 9 | gem 'activesupport', group: :development 10 | gem 'bundler', group: :development 11 | gem 'rspec', group: :development 12 | gem 'webmock', group: :development 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Adyen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'bundler/gem_tasks' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) 5 | 6 | task default: :spec 7 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 10.3.0 2 | 3 | -------------------------------------------------------------------------------- /adyen-ruby-api-library.gemspec: -------------------------------------------------------------------------------- 1 | require_relative 'lib/adyen/version' 2 | 3 | Gem::Specification.new do |spec| 4 | spec.name = 'adyen-ruby-api-library' 5 | spec.version = Adyen::VERSION 6 | spec.required_ruby_version = '>= 2.7.0' 7 | spec.authors = ['Adyen'] 8 | spec.email = ['support@adyen.com'] 9 | 10 | spec.summary = 'Official Adyen Ruby API Library' 11 | spec.description = 'Official Adyen API Library for Ruby. Simplifies integrating with the Adyen API,\ 12 | including Checkout, Marketpay, payments, recurring, and payouts. For support please reach out to \ 13 | support@adyen.com. If you would like to contribute please submit \ 14 | a comment or pull request at https://github.com/Adyen/adyen-ruby-api-library.' 15 | spec.homepage = 'https://www.adyen.com' 16 | spec.license = 'MIT' 17 | 18 | spec.metadata = { 19 | 'documentation_uri' => 'https://docs.adyen.com/developers/development-resources/libraries', 20 | 'homepage_uri' => 'https://www.adyen.com', 21 | 'source_code_uri' => 'https://github.com/Adyen/adyen-ruby-api-library' 22 | } 23 | 24 | spec.files = `git ls-files`.split("\n") 25 | 26 | spec.add_dependency 'faraday' 27 | 28 | spec.add_development_dependency 'activesupport' 29 | spec.add_development_dependency 'bundler' 30 | spec.add_development_dependency 'webmock' 31 | end 32 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require_relative '../lib/adyen-ruby-api-library' 4 | 5 | # You can add fixtures and/or initialization code here to make experimenting 6 | # with your gem easier. You can also use a different console, if you like. 7 | 8 | # (If you use this, don't forget to add pry to your Gemfile!) 9 | # require "pry" 10 | # Pry.start 11 | 12 | require 'irb' 13 | IRB.start(__FILE__) 14 | -------------------------------------------------------------------------------- /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/adyen-ruby-api-library.rb: -------------------------------------------------------------------------------- 1 | require_relative 'adyen/version' 2 | require_relative 'adyen/client' 3 | require_relative 'adyen/errors' 4 | require_relative 'adyen/services/checkout' 5 | require_relative 'adyen/services/payment' 6 | require_relative 'adyen/services/payout' 7 | require_relative 'adyen/services/recurring' 8 | require_relative 'adyen/services/marketpay' 9 | require_relative 'adyen/services/posTerminalManagement' 10 | require_relative 'adyen/services/service' 11 | require_relative 'adyen/services/dataProtection' 12 | require_relative 'adyen/services/disputes' 13 | require_relative 'adyen/services/binLookup' 14 | require_relative 'adyen/hash_with_accessors' 15 | require_relative 'adyen/utils/hmac_validator' 16 | require_relative 'adyen/services/legalEntityManagement' 17 | require_relative 'adyen/services/balancePlatform' 18 | require_relative 'adyen/services/transfers' 19 | require_relative 'adyen/services/management' 20 | require_relative 'adyen/services/storedValue' 21 | require_relative 'adyen/services/balanceControlService' 22 | require_relative 'adyen/services/terminalCloudAPI' 23 | require_relative 'adyen/services/posMobile' 24 | -------------------------------------------------------------------------------- /lib/adyen/hash_with_accessors.rb: -------------------------------------------------------------------------------- 1 | # rubocop:disable Metrics/AbcSize 2 | # rubocop:disable Metrics/MethodLength 3 | # rubocop:disable Metrics/PerceivedComplexity 4 | 5 | # This utility method inherits from Hash, but allows keys to be read 6 | # and updated with dot notation. Usage is entirely optional (i.e., hash values 7 | # can still be accessed via symbol and string keys). 8 | # 9 | # Based on: https://gist.github.com/winfred/2185384#file-ruby-dot-hash-access-rb 10 | module Adyen 11 | class HashWithAccessors < Hash 12 | def method_missing(method, *args) 13 | string_key = method.to_s.sub(/=\z/, '') 14 | sym_key = string_key.to_sym 15 | 16 | key = if key?(string_key) 17 | string_key 18 | elsif key?(sym_key) 19 | sym_key 20 | end 21 | 22 | return super unless key 23 | 24 | assignment = sym_key != method 25 | 26 | if assignment 27 | raise ArgumentError, "wrong number of arguments (given #{args.size}, expected 1)" unless args.size == 1 28 | 29 | self[key] = args.first 30 | else 31 | raise ArgumentError, "wrong number of arguments (given #{args.size}, expected 0)" unless args.empty? 32 | 33 | self[key] 34 | end 35 | end 36 | 37 | def respond_to_missing?(method, include_private = false) 38 | string_key = method.to_s.sub(/=\z/, '') 39 | key?(string_key) || key?(string_key.to_sym) || super 40 | end 41 | end 42 | end 43 | # rubocop:enable all 44 | -------------------------------------------------------------------------------- /lib/adyen/result.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | module Adyen 4 | class AdyenResult 5 | attr_reader :response, :header, :status 6 | 7 | def initialize(response, header, status) 8 | @response = JSON.parse(response, object_class: HashWithAccessors) 9 | 10 | # `header` in Faraday response is not a JSON string, but rather a 11 | # Faraday `Headers` object. Convert first before parsing 12 | @header = JSON.parse(header.to_json, object_class: HashWithAccessors) 13 | @status = status 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/adyen/services/balanceControlService.rb: -------------------------------------------------------------------------------- 1 | require_relative './service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class BalanceControlService < Service 9 | attr_accessor :service, :version 10 | 11 | DEFAULT_VERSION = 1 12 | def initialize(client, version = DEFAULT_VERSION) 13 | super(client, version, 'BalanceControlService') 14 | end 15 | 16 | # Start a balance transfer 17 | def balance_transfer(request, headers: {}) 18 | endpoint = '/balanceTransfer'.gsub(/{.+?}/, '%s') 19 | endpoint = endpoint.gsub(%r{^/}, '') 20 | endpoint = format(endpoint) 21 | 22 | action = { method: 'post', url: endpoint } 23 | @client.call_adyen_api(@service, action, request, headers, @version) 24 | end 25 | 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/bank_account_validation_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class BankAccountValidationApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Validate a bank account 16 | def validate_bank_account_identification(request, headers: {}) 17 | endpoint = '/validateBankAccountIdentification'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/card_orders_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class CardOrdersApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Get card order items 16 | def get_card_order_items(id, headers: {}, query_params: {}) 17 | endpoint = '/cardorders/{id}/items'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, id) 20 | endpoint += create_query_string(query_params) 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Get a list of card orders 26 | def list_card_orders(headers: {}, query_params: {}) 27 | endpoint = '/cardorders'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint) 30 | endpoint += create_query_string(query_params) 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/grant_accounts_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class GrantAccountsApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Get a grant account 16 | # 17 | # Deprecated since Configuration API v2 18 | # Use the `/grantAccounts/{id}` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grantAccounts/(id)) instead. 19 | def get_grant_account(id, headers: {}) 20 | endpoint = '/grantAccounts/{id}'.gsub(/{.+?}/, '%s') 21 | endpoint = endpoint.gsub(%r{^/}, '') 22 | endpoint = format(endpoint, id) 23 | 24 | action = { method: 'get', url: endpoint } 25 | @client.call_adyen_api(@service, action, {}, headers, @version) 26 | end 27 | 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/grant_offers_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class GrantOffersApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Get all available grant offers 16 | # 17 | # Deprecated since Configuration API v2 18 | # Use the `/grantOffers` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grantOffers) instead. 19 | def get_all_available_grant_offers(headers: {}, query_params: {}) 20 | endpoint = '/grantOffers'.gsub(/{.+?}/, '%s') 21 | endpoint = endpoint.gsub(%r{^/}, '') 22 | endpoint = format(endpoint) 23 | endpoint += create_query_string(query_params) 24 | action = { method: 'get', url: endpoint } 25 | @client.call_adyen_api(@service, action, {}, headers, @version) 26 | end 27 | 28 | # Get a grant offer 29 | # 30 | # Deprecated since Configuration API v2 31 | # Use the `/grantOffers/{id}` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grantOffers/(id)) instead. 32 | def get_grant_offer(grant_offer_id, headers: {}) 33 | endpoint = '/grantOffers/{grantOfferId}'.gsub(/{.+?}/, '%s') 34 | endpoint = endpoint.gsub(%r{^/}, '') 35 | endpoint = format(endpoint, grant_offer_id) 36 | 37 | action = { method: 'get', url: endpoint } 38 | @client.call_adyen_api(@service, action, {}, headers, @version) 39 | end 40 | 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/manage_card_pin_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class ManageCardPINApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Change a card PIN 16 | def change_card_pin(request, headers: {}) 17 | endpoint = '/pins/change'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Get an RSA public key 26 | def public_key(headers: {}, query_params: {}) 27 | endpoint = '/publicKey'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint) 30 | endpoint += create_query_string(query_params) 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Reveal a card PIN 36 | def reveal_card_pin(request, headers: {}) 37 | endpoint = '/pins/reveal'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint) 40 | 41 | action = { method: 'post', url: endpoint } 42 | @client.call_adyen_api(@service, action, request, headers, @version) 43 | end 44 | 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/network_tokens_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class NetworkTokensApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Get a network token 16 | def get_network_token(network_token_id, headers: {}) 17 | endpoint = '/networkTokens/{networkTokenId}'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, network_token_id) 20 | 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Update a network token 26 | def update_network_token(request, network_token_id, headers: {}) 27 | endpoint = '/networkTokens/{networkTokenId}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, network_token_id) 30 | 31 | action = { method: 'patch', url: endpoint } 32 | @client.call_adyen_api(@service, action, request, headers, @version) 33 | end 34 | 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class PaymentInstrumentGroupsApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Create a payment instrument group 16 | def create_payment_instrument_group(request, headers: {}) 17 | endpoint = '/paymentInstrumentGroups'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Get all transaction rules for a payment instrument group 26 | def get_all_transaction_rules_for_payment_instrument_group(id, headers: {}) 27 | endpoint = '/paymentInstrumentGroups/{id}/transactionRules'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, id) 30 | 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a payment instrument group 36 | def get_payment_instrument_group(id, headers: {}) 37 | endpoint = '/paymentInstrumentGroups/{id}'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, id) 40 | 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/platform_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class PlatformApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Get all account holders under a balance platform 16 | def get_all_account_holders_under_balance_platform(id, headers: {}, query_params: {}) 17 | endpoint = '/balancePlatforms/{id}/accountHolders'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, id) 20 | endpoint += create_query_string(query_params) 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Get all transaction rules for a balance platform 26 | def get_all_transaction_rules_for_balance_platform(id, headers: {}) 27 | endpoint = '/balancePlatforms/{id}/transactionRules'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, id) 30 | 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a balance platform 36 | def get_balance_platform(id, headers: {}) 37 | endpoint = '/balancePlatforms/{id}'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, id) 40 | 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/transaction_rules_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TransactionRulesApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Create a transaction rule 16 | def create_transaction_rule(request, headers: {}) 17 | endpoint = '/transactionRules'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Delete a transaction rule 26 | def delete_transaction_rule(transaction_rule_id, headers: {}) 27 | endpoint = '/transactionRules/{transactionRuleId}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, transaction_rule_id) 30 | 31 | action = { method: 'delete', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a transaction rule 36 | def get_transaction_rule(transaction_rule_id, headers: {}) 37 | endpoint = '/transactionRules/{transactionRuleId}'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, transaction_rule_id) 40 | 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | # Update a transaction rule 46 | def update_transaction_rule(request, transaction_rule_id, headers: {}) 47 | endpoint = '/transactionRules/{transactionRuleId}'.gsub(/{.+?}/, '%s') 48 | endpoint = endpoint.gsub(%r{^/}, '') 49 | endpoint = format(endpoint, transaction_rule_id) 50 | 51 | action = { method: 'patch', url: endpoint } 52 | @client.call_adyen_api(@service, action, request, headers, @version) 53 | end 54 | 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/adyen/services/balancePlatform/transfer_routes_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TransferRoutesApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'BalancePlatform') 13 | end 14 | 15 | # Calculate transfer routes 16 | def calculate_transfer_routes(request, headers: {}) 17 | endpoint = '/transferRoutes/calculate'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adyen/services/binLookup.rb: -------------------------------------------------------------------------------- 1 | require_relative './service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class BinLookup < Service 9 | attr_accessor :service, :version 10 | 11 | DEFAULT_VERSION = 54 12 | def initialize(client, version = DEFAULT_VERSION) 13 | super(client, version, 'BinLookup') 14 | end 15 | 16 | # Check if 3D Secure is available 17 | def get3ds_availability(request, headers: {}) 18 | endpoint = '/get3dsAvailability'.gsub(/{.+?}/, '%s') 19 | endpoint = endpoint.gsub(%r{^/}, '') 20 | endpoint = format(endpoint) 21 | 22 | action = { method: 'post', url: endpoint } 23 | @client.call_adyen_api(@service, action, request, headers, @version) 24 | end 25 | 26 | # Get a fees cost estimate 27 | def get_cost_estimate(request, headers: {}) 28 | endpoint = '/getCostEstimate'.gsub(/{.+?}/, '%s') 29 | endpoint = endpoint.gsub(%r{^/}, '') 30 | endpoint = format(endpoint) 31 | 32 | action = { method: 'post', url: endpoint } 33 | @client.call_adyen_api(@service, action, request, headers, @version) 34 | end 35 | 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /lib/adyen/services/checkout.rb: -------------------------------------------------------------------------------- 1 | require_relative 'checkout/donations_api' 2 | require_relative 'checkout/modifications_api' 3 | require_relative 'checkout/orders_api' 4 | require_relative 'checkout/payment_links_api' 5 | require_relative 'checkout/payments_api' 6 | require_relative 'checkout/recurring_api' 7 | require_relative 'checkout/utility_api' 8 | 9 | module Adyen 10 | 11 | # NOTE: This class is auto generated by OpenAPI Generator 12 | # Ref: https://openapi-generator.tech 13 | # 14 | # Do not edit the class manually. 15 | class Checkout 16 | attr_accessor :service, :version 17 | 18 | DEFAULT_VERSION = 71 19 | def initialize(client, version = DEFAULT_VERSION) 20 | @service = 'Checkout' 21 | @client = client 22 | @version = version 23 | end 24 | 25 | def donations_api 26 | @donations_api ||= Adyen::DonationsApi.new(@client, @version) 27 | end 28 | 29 | def modifications_api 30 | @modifications_api ||= Adyen::ModificationsApi.new(@client, @version) 31 | end 32 | 33 | def orders_api 34 | @orders_api ||= Adyen::OrdersApi.new(@client, @version) 35 | end 36 | 37 | def payment_links_api 38 | @payment_links_api ||= Adyen::PaymentLinksApi.new(@client, @version) 39 | end 40 | 41 | def payments_api 42 | @payments_api ||= Adyen::PaymentsApi.new(@client, @version) 43 | end 44 | 45 | def recurring_api 46 | @recurring_api ||= Adyen::RecurringApi.new(@client, @version) 47 | end 48 | 49 | def utility_api 50 | @utility_api ||= Adyen::UtilityApi.new(@client, @version) 51 | end 52 | 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /lib/adyen/services/checkout/donations_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class DonationsApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Checkout') 13 | end 14 | 15 | # Get a list of donation campaigns. 16 | def donation_campaigns(request, headers: {}) 17 | endpoint = '/donationCampaigns'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Start a transaction for donations 26 | def donations(request, headers: {}) 27 | endpoint = '/donations'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint) 30 | 31 | action = { method: 'post', url: endpoint } 32 | @client.call_adyen_api(@service, action, request, headers, @version) 33 | end 34 | 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adyen/services/checkout/orders_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class OrdersApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Checkout') 13 | end 14 | 15 | # Cancel an order 16 | def cancel_order(request, headers: {}) 17 | endpoint = '/orders/cancel'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Get the balance of a gift card 26 | def get_balance_of_gift_card(request, headers: {}) 27 | endpoint = '/paymentMethods/balance'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint) 30 | 31 | action = { method: 'post', url: endpoint } 32 | @client.call_adyen_api(@service, action, request, headers, @version) 33 | end 34 | 35 | # Create an order 36 | def orders(request, headers: {}) 37 | endpoint = '/orders'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint) 40 | 41 | action = { method: 'post', url: endpoint } 42 | @client.call_adyen_api(@service, action, request, headers, @version) 43 | end 44 | 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/adyen/services/checkout/payment_links_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class PaymentLinksApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Checkout') 13 | end 14 | 15 | # Get a payment link 16 | def get_payment_link(link_id, headers: {}) 17 | endpoint = '/paymentLinks/{linkId}'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, link_id) 20 | 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Create a payment link 26 | def payment_links(request, headers: {}) 27 | endpoint = '/paymentLinks'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint) 30 | 31 | action = { method: 'post', url: endpoint } 32 | @client.call_adyen_api(@service, action, request, headers, @version) 33 | end 34 | 35 | # Update the status of a payment link 36 | def update_payment_link(request, link_id, headers: {}) 37 | endpoint = '/paymentLinks/{linkId}'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, link_id) 40 | 41 | action = { method: 'patch', url: endpoint } 42 | @client.call_adyen_api(@service, action, request, headers, @version) 43 | end 44 | 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/adyen/services/checkout/recurring_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class RecurringApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Checkout') 13 | end 14 | 15 | # Delete a token for stored payment details 16 | def delete_token_for_stored_payment_details(stored_payment_method_id, headers: {}, query_params: {}) 17 | endpoint = '/storedPaymentMethods/{storedPaymentMethodId}'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, stored_payment_method_id) 20 | endpoint += create_query_string(query_params) 21 | action = { method: 'delete', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Get tokens for stored payment details 26 | def get_tokens_for_stored_payment_details(headers: {}, query_params: {}) 27 | endpoint = '/storedPaymentMethods'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint) 30 | endpoint += create_query_string(query_params) 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Create a token to store payment details 36 | def stored_payment_methods(request, headers: {}) 37 | endpoint = '/storedPaymentMethods'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint) 40 | 41 | action = { method: 'post', url: endpoint } 42 | @client.call_adyen_api(@service, action, request, headers, @version) 43 | end 44 | 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/adyen/services/checkout/utility_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class UtilityApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Checkout') 13 | end 14 | 15 | # Get an Apple Pay session 16 | def get_apple_pay_session(request, headers: {}) 17 | endpoint = '/applePay/sessions'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Create originKey values for domains 26 | # 27 | # Deprecated since Adyen Checkout API v67 28 | def origin_keys(request, headers: {}) 29 | endpoint = '/originKeys'.gsub(/{.+?}/, '%s') 30 | endpoint = endpoint.gsub(%r{^/}, '') 31 | endpoint = format(endpoint) 32 | 33 | action = { method: 'post', url: endpoint } 34 | @client.call_adyen_api(@service, action, request, headers, @version) 35 | end 36 | 37 | # Updates the order for PayPal Express Checkout 38 | def updates_order_for_paypal_express_checkout(request, headers: {}) 39 | endpoint = '/paypal/updateOrder'.gsub(/{.+?}/, '%s') 40 | endpoint = endpoint.gsub(%r{^/}, '') 41 | endpoint = format(endpoint) 42 | 43 | action = { method: 'post', url: endpoint } 44 | @client.call_adyen_api(@service, action, request, headers, @version) 45 | end 46 | 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /lib/adyen/services/dataProtection.rb: -------------------------------------------------------------------------------- 1 | require_relative './service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class DataProtection < Service 9 | attr_accessor :service, :version 10 | 11 | DEFAULT_VERSION = 1 12 | def initialize(client, version = DEFAULT_VERSION) 13 | super(client, version, 'DataProtectionService') 14 | end 15 | 16 | # Submit a Subject Erasure Request. 17 | def request_subject_erasure(request, headers: {}) 18 | endpoint = '/requestSubjectErasure'.gsub(/{.+?}/, '%s') 19 | endpoint = endpoint.gsub(%r{^/}, '') 20 | endpoint = format(endpoint) 21 | 22 | action = { method: 'post', url: endpoint } 23 | @client.call_adyen_api(@service, action, request, headers, @version) 24 | end 25 | 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/adyen/services/legalEntityManagement.rb: -------------------------------------------------------------------------------- 1 | require_relative 'legalEntityManagement/business_lines_api' 2 | require_relative 'legalEntityManagement/documents_api' 3 | require_relative 'legalEntityManagement/hosted_onboarding_api' 4 | require_relative 'legalEntityManagement/legal_entities_api' 5 | require_relative 'legalEntityManagement/pci_questionnaires_api' 6 | require_relative 'legalEntityManagement/tax_e_delivery_consent_api' 7 | require_relative 'legalEntityManagement/terms_of_service_api' 8 | require_relative 'legalEntityManagement/transfer_instruments_api' 9 | 10 | module Adyen 11 | 12 | # NOTE: This class is auto generated by OpenAPI Generator 13 | # Ref: https://openapi-generator.tech 14 | # 15 | # Do not edit the class manually. 16 | class LegalEntityManagement 17 | attr_accessor :service, :version 18 | 19 | DEFAULT_VERSION = 3 20 | def initialize(client, version = DEFAULT_VERSION) 21 | @service = 'LegalEntityManagement' 22 | @client = client 23 | @version = version 24 | end 25 | 26 | def business_lines_api 27 | @business_lines_api ||= Adyen::BusinessLinesApi.new(@client, @version) 28 | end 29 | 30 | def documents_api 31 | @documents_api ||= Adyen::DocumentsApi.new(@client, @version) 32 | end 33 | 34 | def hosted_onboarding_api 35 | @hosted_onboarding_api ||= Adyen::HostedOnboardingApi.new(@client, @version) 36 | end 37 | 38 | def legal_entities_api 39 | @legal_entities_api ||= Adyen::LegalEntitiesApi.new(@client, @version) 40 | end 41 | 42 | def pci_questionnaires_api 43 | @pci_questionnaires_api ||= Adyen::PCIQuestionnairesApi.new(@client, @version) 44 | end 45 | 46 | def tax_e_delivery_consent_api 47 | @tax_e_delivery_consent_api ||= Adyen::TaxEDeliveryConsentApi.new(@client, @version) 48 | end 49 | 50 | def terms_of_service_api 51 | @terms_of_service_api ||= Adyen::TermsOfServiceApi.new(@client, @version) 52 | end 53 | 54 | def transfer_instruments_api 55 | @transfer_instruments_api ||= Adyen::TransferInstrumentsApi.new(@client, @version) 56 | end 57 | 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /lib/adyen/services/legalEntityManagement/business_lines_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class BusinessLinesApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'LegalEntityManagement') 13 | end 14 | 15 | # Create a business line 16 | def create_business_line(request, headers: {}) 17 | endpoint = '/businessLines'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Delete a business line 26 | def delete_business_line(id, headers: {}) 27 | endpoint = '/businessLines/{id}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, id) 30 | 31 | action = { method: 'delete', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a business line 36 | def get_business_line(id, headers: {}) 37 | endpoint = '/businessLines/{id}'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, id) 40 | 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | # Update a business line 46 | def update_business_line(request, id, headers: {}) 47 | endpoint = '/businessLines/{id}'.gsub(/{.+?}/, '%s') 48 | endpoint = endpoint.gsub(%r{^/}, '') 49 | endpoint = format(endpoint, id) 50 | 51 | action = { method: 'patch', url: endpoint } 52 | @client.call_adyen_api(@service, action, request, headers, @version) 53 | end 54 | 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/adyen/services/legalEntityManagement/documents_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class DocumentsApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'LegalEntityManagement') 13 | end 14 | 15 | # Delete a document 16 | def delete_document(id, headers: {}) 17 | endpoint = '/documents/{id}'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, id) 20 | 21 | action = { method: 'delete', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Get a document 26 | def get_document(id, headers: {}, query_params: {}) 27 | endpoint = '/documents/{id}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, id) 30 | endpoint += create_query_string(query_params) 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Update a document 36 | def update_document(request, id, headers: {}) 37 | endpoint = '/documents/{id}'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, id) 40 | 41 | action = { method: 'patch', url: endpoint } 42 | @client.call_adyen_api(@service, action, request, headers, @version) 43 | end 44 | 45 | # Upload a document for verification checks 46 | def upload_document_for_verification_checks(request, headers: {}) 47 | endpoint = '/documents'.gsub(/{.+?}/, '%s') 48 | endpoint = endpoint.gsub(%r{^/}, '') 49 | endpoint = format(endpoint) 50 | 51 | action = { method: 'post', url: endpoint } 52 | @client.call_adyen_api(@service, action, request, headers, @version) 53 | end 54 | 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class HostedOnboardingApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'LegalEntityManagement') 13 | end 14 | 15 | # Get a link to an Adyen-hosted onboarding page 16 | def get_link_to_adyenhosted_onboarding_page(request, id, headers: {}) 17 | endpoint = '/legalEntities/{id}/onboardingLinks'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, id) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Get an onboarding link theme 26 | def get_onboarding_link_theme(id, headers: {}) 27 | endpoint = '/themes/{id}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, id) 30 | 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a list of hosted onboarding page themes 36 | def list_hosted_onboarding_page_themes(headers: {}) 37 | endpoint = '/themes'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint) 40 | 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/adyen/services/legalEntityManagement/tax_e_delivery_consent_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TaxEDeliveryConsentApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'LegalEntityManagement') 13 | end 14 | 15 | # Check the status of consent for electronic delivery of tax forms 16 | def check_status_of_consent_for_electronic_delivery_of_tax_forms(id, headers: {}) 17 | endpoint = '/legalEntities/{id}/checkTaxElectronicDeliveryConsent'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, id) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Set the consent status for electronic delivery of tax forms 26 | def set_consent_status_for_electronic_delivery_of_tax_forms(request, id, headers: {}) 27 | endpoint = '/legalEntities/{id}/setTaxElectronicDeliveryConsent'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, id) 30 | 31 | action = { method: 'post', url: endpoint } 32 | @client.call_adyen_api(@service, action, request, headers, @version) 33 | end 34 | 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TransferInstrumentsApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'LegalEntityManagement') 13 | end 14 | 15 | # Create a transfer instrument 16 | def create_transfer_instrument(request, headers: {}) 17 | endpoint = '/transferInstruments'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Delete a transfer instrument 26 | def delete_transfer_instrument(id, headers: {}) 27 | endpoint = '/transferInstruments/{id}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, id) 30 | 31 | action = { method: 'delete', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a transfer instrument 36 | def get_transfer_instrument(id, headers: {}) 37 | endpoint = '/transferInstruments/{id}'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, id) 40 | 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | # Update a transfer instrument 46 | def update_transfer_instrument(request, id, headers: {}) 47 | endpoint = '/transferInstruments/{id}'.gsub(/{.+?}/, '%s') 48 | endpoint = endpoint.gsub(%r{^/}, '') 49 | endpoint = format(endpoint, id) 50 | 51 | action = { method: 'patch', url: endpoint } 52 | @client.call_adyen_api(@service, action, request, headers, @version) 53 | end 54 | 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/adyen/services/management/account_company_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class AccountCompanyLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Get a company account 16 | def get_company_account(company_id, headers: {}) 17 | endpoint = '/companies/{companyId}'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, company_id) 20 | 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Get a list of company accounts 26 | def list_company_accounts(headers: {}, query_params: {}) 27 | endpoint = '/companies'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint) 30 | endpoint += create_query_string(query_params) 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a list of merchant accounts 36 | def list_merchant_accounts(company_id, headers: {}, query_params: {}) 37 | endpoint = '/companies/{companyId}/merchants'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, company_id) 40 | endpoint += create_query_string(query_params) 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/adyen/services/management/account_merchant_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class AccountMerchantLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Create a merchant account 16 | def create_merchant_account(request, headers: {}) 17 | endpoint = '/merchants'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Get a merchant account 26 | def get_merchant_account(merchant_id, headers: {}) 27 | endpoint = '/merchants/{merchantId}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, merchant_id) 30 | 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a list of merchant accounts 36 | def list_merchant_accounts(headers: {}, query_params: {}) 37 | endpoint = '/merchants'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint) 40 | endpoint += create_query_string(query_params) 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | # Request to activate a merchant account 46 | def request_to_activate_merchant_account(merchant_id, headers: {}) 47 | endpoint = '/merchants/{merchantId}/activate'.gsub(/{.+?}/, '%s') 48 | endpoint = endpoint.gsub(%r{^/}, '') 49 | endpoint = format(endpoint, merchant_id) 50 | 51 | action = { method: 'post', url: endpoint } 52 | @client.call_adyen_api(@service, action, {}, headers, @version) 53 | end 54 | 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/adyen/services/management/api_key_company_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class APIKeyCompanyLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Generate new API key 16 | def generate_new_api_key(company_id, api_credential_id, headers: {}) 17 | endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, company_id, api_credential_id) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adyen/services/management/api_key_merchant_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class APIKeyMerchantLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Generate new API key 16 | def generate_new_api_key(merchant_id, api_credential_id, headers: {}) 17 | endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, merchant_id, api_credential_id) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adyen/services/management/client_key_company_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class ClientKeyCompanyLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Generate new client key 16 | def generate_new_client_key(company_id, api_credential_id, headers: {}) 17 | endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, company_id, api_credential_id) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adyen/services/management/client_key_merchant_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class ClientKeyMerchantLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Generate new client key 16 | def generate_new_client_key(merchant_id, api_credential_id, headers: {}) 17 | endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, merchant_id, api_credential_id) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adyen/services/management/terminal_actions_company_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TerminalActionsCompanyLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Get terminal action 16 | def get_terminal_action(company_id, action_id, headers: {}) 17 | endpoint = '/companies/{companyId}/terminalActions/{actionId}'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, company_id, action_id) 20 | 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Get a list of terminal actions 26 | def list_terminal_actions(company_id, headers: {}, query_params: {}) 27 | endpoint = '/companies/{companyId}/terminalActions'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, company_id) 30 | endpoint += create_query_string(query_params) 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adyen/services/management/terminal_actions_terminal_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TerminalActionsTerminalLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Create a terminal action 16 | def create_terminal_action(request, headers: {}) 17 | endpoint = '/terminals/scheduleActions'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adyen/services/management/terminal_settings_company_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TerminalSettingsCompanyLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Get the terminal logo 16 | def get_terminal_logo(company_id, headers: {}, query_params: {}) 17 | endpoint = '/companies/{companyId}/terminalLogos'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, company_id) 20 | endpoint += create_query_string(query_params) 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Get terminal settings 26 | def get_terminal_settings(company_id, headers: {}) 27 | endpoint = '/companies/{companyId}/terminalSettings'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, company_id) 30 | 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Update the terminal logo 36 | def update_terminal_logo(request, company_id, headers: {}, query_params: {}) 37 | endpoint = '/companies/{companyId}/terminalLogos'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, company_id) 40 | endpoint += create_query_string(query_params) 41 | action = { method: 'patch', url: endpoint } 42 | @client.call_adyen_api(@service, action, request, headers, @version) 43 | end 44 | 45 | # Update terminal settings 46 | def update_terminal_settings(request, company_id, headers: {}) 47 | endpoint = '/companies/{companyId}/terminalSettings'.gsub(/{.+?}/, '%s') 48 | endpoint = endpoint.gsub(%r{^/}, '') 49 | endpoint = format(endpoint, company_id) 50 | 51 | action = { method: 'patch', url: endpoint } 52 | @client.call_adyen_api(@service, action, request, headers, @version) 53 | end 54 | 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/adyen/services/management/terminal_settings_terminal_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TerminalSettingsTerminalLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Get the terminal logo 16 | def get_terminal_logo(terminal_id, headers: {}) 17 | endpoint = '/terminals/{terminalId}/terminalLogos'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, terminal_id) 20 | 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Get terminal settings 26 | def get_terminal_settings(terminal_id, headers: {}) 27 | endpoint = '/terminals/{terminalId}/terminalSettings'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, terminal_id) 30 | 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Update the logo 36 | def update_logo(request, terminal_id, headers: {}) 37 | endpoint = '/terminals/{terminalId}/terminalLogos'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, terminal_id) 40 | 41 | action = { method: 'patch', url: endpoint } 42 | @client.call_adyen_api(@service, action, request, headers, @version) 43 | end 44 | 45 | # Update terminal settings 46 | def update_terminal_settings(request, terminal_id, headers: {}) 47 | endpoint = '/terminals/{terminalId}/terminalSettings'.gsub(/{.+?}/, '%s') 48 | endpoint = endpoint.gsub(%r{^/}, '') 49 | endpoint = format(endpoint, terminal_id) 50 | 51 | action = { method: 'patch', url: endpoint } 52 | @client.call_adyen_api(@service, action, request, headers, @version) 53 | end 54 | 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/adyen/services/management/terminals_terminal_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TerminalsTerminalLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Get a list of terminals 16 | def list_terminals(headers: {}, query_params: {}) 17 | endpoint = '/terminals'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | endpoint += create_query_string(query_params) 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Reassign a terminal 26 | def reassign_terminal(request, terminal_id, headers: {}) 27 | endpoint = '/terminals/{terminalId}/reassign'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, terminal_id) 30 | 31 | action = { method: 'post', url: endpoint } 32 | @client.call_adyen_api(@service, action, request, headers, @version) 33 | end 34 | 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adyen/services/management/users_company_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class UsersCompanyLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Create a new user 16 | def create_new_user(request, company_id, headers: {}) 17 | endpoint = '/companies/{companyId}/users'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, company_id) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Get user details 26 | def get_user_details(company_id, user_id, headers: {}) 27 | endpoint = '/companies/{companyId}/users/{userId}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, company_id, user_id) 30 | 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a list of users 36 | def list_users(company_id, headers: {}, query_params: {}) 37 | endpoint = '/companies/{companyId}/users'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, company_id) 40 | endpoint += create_query_string(query_params) 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | # Update user details 46 | def update_user_details(request, company_id, user_id, headers: {}) 47 | endpoint = '/companies/{companyId}/users/{userId}'.gsub(/{.+?}/, '%s') 48 | endpoint = endpoint.gsub(%r{^/}, '') 49 | endpoint = format(endpoint, company_id, user_id) 50 | 51 | action = { method: 'patch', url: endpoint } 52 | @client.call_adyen_api(@service, action, request, headers, @version) 53 | end 54 | 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/adyen/services/management/users_merchant_level_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class UsersMerchantLevelApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Management') 13 | end 14 | 15 | # Create a new user 16 | def create_new_user(request, merchant_id, headers: {}) 17 | endpoint = '/merchants/{merchantId}/users'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint, merchant_id) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Get user details 26 | def get_user_details(merchant_id, user_id, headers: {}) 27 | endpoint = '/merchants/{merchantId}/users/{userId}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, merchant_id, user_id) 30 | 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | # Get a list of users 36 | def list_users(merchant_id, headers: {}, query_params: {}) 37 | endpoint = '/merchants/{merchantId}/users'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint, merchant_id) 40 | endpoint += create_query_string(query_params) 41 | action = { method: 'get', url: endpoint } 42 | @client.call_adyen_api(@service, action, {}, headers, @version) 43 | end 44 | 45 | # Update a user 46 | def update_user(request, merchant_id, user_id, headers: {}) 47 | endpoint = '/merchants/{merchantId}/users/{userId}'.gsub(/{.+?}/, '%s') 48 | endpoint = endpoint.gsub(%r{^/}, '') 49 | endpoint = format(endpoint, merchant_id, user_id) 50 | 51 | action = { method: 'patch', url: endpoint } 52 | @client.call_adyen_api(@service, action, request, headers, @version) 53 | end 54 | 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/adyen/services/payout.rb: -------------------------------------------------------------------------------- 1 | require_relative 'payout/initialization_api' 2 | require_relative 'payout/instant_payouts_api' 3 | require_relative 'payout/reviewing_api' 4 | 5 | module Adyen 6 | 7 | # NOTE: This class is auto generated by OpenAPI Generator 8 | # Ref: https://openapi-generator.tech 9 | # 10 | # Do not edit the class manually. 11 | class Payout 12 | attr_accessor :service, :version 13 | 14 | DEFAULT_VERSION = 68 15 | def initialize(client, version = DEFAULT_VERSION) 16 | @service = 'Payout' 17 | @client = client 18 | @version = version 19 | end 20 | 21 | def initialization_api 22 | @initialization_api ||= Adyen::InitializationApi.new(@client, @version) 23 | end 24 | 25 | def instant_payouts_api 26 | @instant_payouts_api ||= Adyen::InstantPayoutsApi.new(@client, @version) 27 | end 28 | 29 | def reviewing_api 30 | @reviewing_api ||= Adyen::ReviewingApi.new(@client, @version) 31 | end 32 | 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adyen/services/payout/initialization_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class InitializationApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Payout') 13 | end 14 | 15 | # Store payout details 16 | def store_detail(request, headers: {}) 17 | endpoint = '/storeDetail'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Store details and submit a payout 26 | def store_detail_and_submit_third_party(request, headers: {}) 27 | endpoint = '/storeDetailAndSubmitThirdParty'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint) 30 | 31 | action = { method: 'post', url: endpoint } 32 | @client.call_adyen_api(@service, action, request, headers, @version) 33 | end 34 | 35 | # Submit a payout 36 | def submit_third_party(request, headers: {}) 37 | endpoint = '/submitThirdParty'.gsub(/{.+?}/, '%s') 38 | endpoint = endpoint.gsub(%r{^/}, '') 39 | endpoint = format(endpoint) 40 | 41 | action = { method: 'post', url: endpoint } 42 | @client.call_adyen_api(@service, action, request, headers, @version) 43 | end 44 | 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/adyen/services/payout/instant_payouts_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class InstantPayoutsApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Payout') 13 | end 14 | 15 | # Make an instant card payout 16 | def payout(request, headers: {}) 17 | endpoint = '/payout'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adyen/services/payout/reviewing_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class ReviewingApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Payout') 13 | end 14 | 15 | # Confirm a payout 16 | def confirm_third_party(request, headers: {}) 17 | endpoint = '/confirmThirdParty'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | # Cancel a payout 26 | def decline_third_party(request, headers: {}) 27 | endpoint = '/declineThirdParty'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint) 30 | 31 | action = { method: 'post', url: endpoint } 32 | @client.call_adyen_api(@service, action, request, headers, @version) 33 | end 34 | 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adyen/services/posMobile.rb: -------------------------------------------------------------------------------- 1 | require_relative './service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class PosMobile < Service 9 | attr_accessor :service, :version 10 | 11 | DEFAULT_VERSION = 68 12 | def initialize(client, version = DEFAULT_VERSION) 13 | super(client, version, 'PosMobile') 14 | end 15 | 16 | # Create a communication session 17 | def create_communication_session(request, headers: {}) 18 | endpoint = '/sessions'.gsub(/{.+?}/, '%s') 19 | endpoint = endpoint.gsub(%r{^/}, '') 20 | endpoint = format(endpoint) 21 | 22 | action = { method: 'post', url: endpoint } 23 | @client.call_adyen_api(@service, action, request, headers, @version) 24 | end 25 | 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/adyen/services/service.rb: -------------------------------------------------------------------------------- 1 | module Adyen 2 | class Service 3 | attr_accessor :service, :version 4 | 5 | # add snake case to camel case converter to String 6 | # to convert rubinic method names to Adyen API methods 7 | # 8 | # i.e. snake_case -> snakeCase 9 | # note that the first letter is not capitalized as normal 10 | def self.action_for_method_name(method_name) 11 | method_name.to_s.gsub(/_./) { |x| x[1].upcase } 12 | end 13 | 14 | def initialize(client, version, service, method_names = [], with_application_info = []) 15 | @client = client 16 | @version = version 17 | @service = service 18 | 19 | # dynamically create API methods 20 | method_names.each do |method_name| 21 | define_singleton_method method_name do |request, headers = {}| 22 | action = self.class.action_for_method_name(method_name) 23 | @client.call_adyen_api(@service, action, request, headers, @version, 24 | _with_application_info: with_application_info.include?(method_name)) 25 | end 26 | end 27 | end 28 | 29 | # create query parameter from a hash 30 | def create_query_string(arr) 31 | "?#{URI.encode_www_form(arr)}" 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adyen/services/sessionAuthentication.rb: -------------------------------------------------------------------------------- 1 | require_relative 'sessionAuthentication/session_authentication_api' 2 | 3 | module Adyen 4 | 5 | # NOTE: This class is auto generated by OpenAPI Generator 6 | # Ref: https://openapi-generator.tech 7 | # 8 | # Do not edit the class manually. 9 | class SessionAuthentication 10 | attr_accessor :service, :version 11 | 12 | DEFAULT_VERSION = 1 13 | def initialize(client, version = DEFAULT_VERSION) 14 | @service = 'SessionAuthentication' 15 | @client = client 16 | @version = version 17 | end 18 | 19 | def session_authentication_api 20 | @session_authentication_api ||= Adyen::SessionAuthenticationApi.new(@client, @version) 21 | end 22 | 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/adyen/services/sessionAuthentication/session_authentication_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class SessionAuthenticationApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'SessionAuthentication') 13 | end 14 | 15 | # Create a session token 16 | def create_authentication_session(request, authentication_session_request, headers: {}) 17 | endpoint = '/sessions'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | 21 | action = { method: 'post', url: endpoint } 22 | @client.call_adyen_api(@service, action, request, headers, @version) 23 | end 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/adyen/services/terminalCloudAPI.rb: -------------------------------------------------------------------------------- 1 | require_relative './service' 2 | module Adyen 3 | class TerminalCloudAPI < Service 4 | attr_accessor :service 5 | 6 | def initialize(client) 7 | super(client, nil ,'TerminalCloudAPI') 8 | end 9 | 10 | def connected_terminals(request, headers: {}) 11 | endpoint = '/connectedTerminals'.gsub(/{.+?}/, '%s') 12 | endpoint = endpoint.gsub(%r{^/}, '') 13 | endpoint = format(endpoint) 14 | 15 | action = { method: 'post', url: endpoint } 16 | @client.call_adyen_api(@service, action, request, headers, @version) 17 | end 18 | 19 | def sync(request, headers: {}) 20 | endpoint = '/sync'.gsub(/{.+?}/, '%s') 21 | endpoint = endpoint.gsub(%r{^/}, '') 22 | endpoint = format(endpoint) 23 | 24 | action = { method: 'post', url: endpoint } 25 | @client.call_adyen_api(@service, action, request, headers, @version) 26 | end 27 | 28 | def async(request, headers: {}) 29 | endpoint = '/async'.gsub(/{.+?}/, '%s') 30 | endpoint = endpoint.gsub(%r{^/}, '') 31 | endpoint = format(endpoint) 32 | 33 | action = { method: 'post', url: endpoint } 34 | @client.call_adyen_api(@service, action, request, headers, @version) 35 | end 36 | 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /lib/adyen/services/transfers.rb: -------------------------------------------------------------------------------- 1 | require_relative 'transfers/capital_api' 2 | require_relative 'transfers/transactions_api' 3 | require_relative 'transfers/transfers_api' 4 | 5 | module Adyen 6 | 7 | # NOTE: This class is auto generated by OpenAPI Generator 8 | # Ref: https://openapi-generator.tech 9 | # 10 | # Do not edit the class manually. 11 | class Transfers 12 | attr_accessor :service, :version 13 | 14 | DEFAULT_VERSION = 4 15 | def initialize(client, version = DEFAULT_VERSION) 16 | @service = 'Transfers' 17 | @client = client 18 | @version = version 19 | end 20 | 21 | def capital_api 22 | @capital_api ||= Adyen::CapitalApi.new(@client, @version) 23 | end 24 | 25 | def transactions_api 26 | @transactions_api ||= Adyen::TransactionsApi.new(@client, @version) 27 | end 28 | 29 | def transfers_api 30 | @transfers_api ||= Adyen::TransfersApi.new(@client, @version) 31 | end 32 | 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/adyen/services/transfers/capital_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class CapitalApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Transfers') 13 | end 14 | 15 | # Get a capital account 16 | # 17 | # Deprecated since Transfers API v4 18 | # Use the `/grants` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grants) instead. 19 | def get_capital_account(headers: {}, query_params: {}) 20 | endpoint = '/grants'.gsub(/{.+?}/, '%s') 21 | endpoint = endpoint.gsub(%r{^/}, '') 22 | endpoint = format(endpoint) 23 | endpoint += create_query_string(query_params) 24 | action = { method: 'get', url: endpoint } 25 | @client.call_adyen_api(@service, action, {}, headers, @version) 26 | end 27 | 28 | # Get grant reference details 29 | # 30 | # Deprecated since Transfers API v4 31 | # Use the `/grants/{grantId}` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grants/(grantId)) instead. 32 | def get_grant_reference_details(id, headers: {}) 33 | endpoint = '/grants/{id}'.gsub(/{.+?}/, '%s') 34 | endpoint = endpoint.gsub(%r{^/}, '') 35 | endpoint = format(endpoint, id) 36 | 37 | action = { method: 'get', url: endpoint } 38 | @client.call_adyen_api(@service, action, {}, headers, @version) 39 | end 40 | 41 | # Request a grant payout 42 | # 43 | # Deprecated since Transfers API v4 44 | # Use the `/grants` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/post/grants) instead. 45 | def request_grant_payout(request, headers: {}) 46 | endpoint = '/grants'.gsub(/{.+?}/, '%s') 47 | endpoint = endpoint.gsub(%r{^/}, '') 48 | endpoint = format(endpoint) 49 | 50 | action = { method: 'post', url: endpoint } 51 | @client.call_adyen_api(@service, action, request, headers, @version) 52 | end 53 | 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /lib/adyen/services/transfers/transactions_api.rb: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | 4 | # NOTE: This class is auto generated by OpenAPI Generator 5 | # Ref: https://openapi-generator.tech 6 | # 7 | # Do not edit the class manually. 8 | class TransactionsApi < Service 9 | attr_accessor :service, :version 10 | 11 | def initialize(client, version = DEFAULT_VERSION) 12 | super(client, version, 'Transfers') 13 | end 14 | 15 | # Get all transactions 16 | def get_all_transactions(headers: {}, query_params: {}) 17 | endpoint = '/transactions'.gsub(/{.+?}/, '%s') 18 | endpoint = endpoint.gsub(%r{^/}, '') 19 | endpoint = format(endpoint) 20 | endpoint += create_query_string(query_params) 21 | action = { method: 'get', url: endpoint } 22 | @client.call_adyen_api(@service, action, {}, headers, @version) 23 | end 24 | 25 | # Get a transaction 26 | def get_transaction(id, headers: {}) 27 | endpoint = '/transactions/{id}'.gsub(/{.+?}/, '%s') 28 | endpoint = endpoint.gsub(%r{^/}, '') 29 | endpoint = format(endpoint, id) 30 | 31 | action = { method: 'get', url: endpoint } 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | end 34 | 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/adyen/version.rb: -------------------------------------------------------------------------------- 1 | module Adyen 2 | NAME = 'adyen-ruby-api-library'.freeze 3 | VERSION = '10.3.0'.freeze 4 | end 5 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base"], 4 | "minimumReleaseAge": "21 days" 5 | } 6 | -------------------------------------------------------------------------------- /spec/account_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe Adyen::Payment, service: 'marketpay account service' do 4 | # client instance to be used in dynamically generated tests 5 | client = create_client(:basic) 6 | 7 | # methods / values to test for 8 | # format is defined in spec_helper 9 | test_sets = [ 10 | %w[create_account_holder accountHolderCode TestAccountHolder781664], 11 | %w[get_account_holder pspReference 8815263414367329], 12 | %w[update_account_holder pspReference 9914762676580105], 13 | %w[update_account_holder_state pspReference 8515090175978108], 14 | %w[suspend_account_holder pspReference 9914762643560032], 15 | %w[un_suspend_account_holder pspReference 9914762644860159], 16 | %w[close_account_holder pspReference 9914713476670992], 17 | %w[create_account status Active], 18 | %w[update_account pspReference 9914860311410009], 19 | %w[close_account status Closed], 20 | %w[upload_document pspReference 9914762681460244], 21 | %w[get_uploaded_documents pspReference 9914694369860322], 22 | %w[delete_bank_accounts pspReference 9914694372670551], 23 | %w[delete_shareholders pspReference 9914694372990637], 24 | %w[delete_signatories pspReference 9914694372990637], 25 | %w[delete_payout_methods pspReference 9914694372990637], 26 | %w[check_account_holder pspReference 9914694372990637] 27 | ] 28 | 29 | generate_tests(client, 'Account', test_sets, client.marketpay.account) 30 | end 31 | -------------------------------------------------------------------------------- /spec/balance_control_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'json' 3 | 4 | RSpec.describe Adyen::BalancePlatform, service: 'balancePlatform' do 5 | before(:all) do 6 | @shared_values = { 7 | client: create_client(:api_key), 8 | service: 'BalancePlatform' 9 | } 10 | end 11 | 12 | # must be created manually because every field in the response is an array 13 | it 'makes a balance transfer POST call' do 14 | request_body = JSON.parse(json_from_file('mocks/requests/BalanceControl/balance_transfer.json')) 15 | 16 | response_body = json_from_file('mocks/responses/BalanceControl/balance_transfer.json') 17 | 18 | url = @shared_values[:client].service_url(@shared_values[:service], 'balanceTransfer', 19 | @shared_values[:client].balance_control_service.version) 20 | WebMock.stub_request(:post, url) 21 | .with( 22 | body: request_body, 23 | headers: { 24 | 'x-api-key' => @shared_values[:client].api_key 25 | } 26 | ) 27 | .to_return( 28 | body: response_body 29 | ) 30 | 31 | result = @shared_values[:client].balance_control_service.balance_transfer(request_body) 32 | response_hash = result.response 33 | 34 | expect(result.status) 35 | .to eq(200) 36 | expect(response_hash) 37 | .to eq(JSON.parse(response_body)) 38 | expect(response_hash) 39 | .to be_a Adyen::HashWithAccessors 40 | expect(response_hash) 41 | .to be_a_kind_of Hash 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /spec/data_protection_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe Adyen::DataProtection, service: 'Data Protection Service' do 4 | # client instance to be used in dynamically generated tests 5 | client = create_client(:basic) 6 | 7 | # methods / values to test for 8 | # format is defined in spec_helper 9 | test_sets = [ 10 | %w[request_subject_erasure result SUCCESS] 11 | ] 12 | 13 | generate_tests(client, 'DataProtectionService', test_sets, client.data_protection) 14 | end 15 | -------------------------------------------------------------------------------- /spec/disputes_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe Adyen::Disputes, service: 'disputes service' do 4 | before(:all) do 5 | @shared_values = { 6 | client: create_client(:api_key), 7 | service: 'Disputes' 8 | } 9 | end 10 | 11 | # methods / values to test for 12 | # format is defined in spec_helper 13 | it 'makes a retrieve_applicable_defense_reasons call' do 14 | request_body = JSON.parse(json_from_file('mocks/requests/DisputesService/retrieve_applicable_defense_reasons.json')) 15 | 16 | response_body = json_from_file('mocks/responses/DisputesService/retrieve_applicable_defense_reasons.json') 17 | 18 | url = @shared_values[:client].service_url(@shared_values[:service], 'retrieveApplicableDefenseReasons', 19 | @shared_values[:client].disputes.version) 20 | WebMock.stub_request(:post, url) 21 | .with( 22 | body: request_body, 23 | headers: { 24 | 'x-api-key' => @shared_values[:client].api_key 25 | } 26 | ) 27 | .to_return( 28 | body: response_body 29 | ) 30 | 31 | result = @shared_values[:client].disputes.retrieve_applicable_defense_reasons(request_body) 32 | response_hash = result.response 33 | 34 | expect(result.status) 35 | .to eq(200) 36 | expect(response_hash) 37 | .to eq(JSON.parse(response_body)) 38 | expect(response_hash) 39 | .to be_a Adyen::HashWithAccessors 40 | expect(response_hash) 41 | .to be_a_kind_of Hash 42 | expect(response_hash['disputeServiceResult']['success']) 43 | .to eq(true) 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /spec/fund_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe Adyen::Payment, service: 'marketpay fund service' do 4 | # client instance to be used in dynamically generated tests 5 | client = create_client(:basic) 6 | 7 | # methods / values to test for 8 | # format is defined in spec_helper 9 | test_sets = [ 10 | %w[payout_account_holder pspReference 9915090894325643], 11 | %w[account_holder_balance pspReference 9914719436100053], 12 | %w[account_holder_transaction_list pspReference 9914721175530029], 13 | %w[refund_not_paid_out_transfers pspReference 9915090894215323], 14 | %w[setup_beneficiary pspReference 9914860354282596], 15 | %w[transfer_funds pspReference 9915090893984580], 16 | %w[refund_funds_transfer pspReference 9915090893984580] 17 | ] 18 | 19 | generate_tests(client, 'Fund', test_sets, client.marketpay.fund) 20 | end 21 | -------------------------------------------------------------------------------- /spec/hop_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe Adyen::Payment, service: 'marketpay hop service' do 4 | # client instance to be used in dynamically generated tests 5 | client = create_client(:basic) 6 | 7 | # methods / values to test for 8 | # format is defined in spec_helper 9 | test_sets = [ 10 | %w[get_onboarding_url pspReference 8815850625171183] 11 | ] 12 | 13 | generate_tests(client, 'Hop', test_sets, client.marketpay.hop) 14 | end 15 | -------------------------------------------------------------------------------- /spec/lem_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'json' 3 | 4 | RSpec.describe Adyen::LegalEntityManagement, service: 'LegalEntityManagement' do 5 | before(:all) do 6 | @shared_values = { 7 | client: create_client(:api_key), 8 | service: 'LegalEntityManagement' 9 | } 10 | end 11 | 12 | # must be created manually because every field in the response is an array 13 | it 'makes a business_lines POST call' do 14 | request_body = JSON.parse(json_from_file('mocks/requests/LegalEntityManagement/create_business_line.json')) 15 | 16 | response_body = json_from_file('mocks/responses/LegalEntityManagement/create_business_line.json') 17 | 18 | url = @shared_values[:client].service_url(@shared_values[:service], 'businessLines', 19 | @shared_values[:client].legal_entity_management.version) 20 | WebMock.stub_request(:post, url) 21 | .with( 22 | body: request_body, 23 | headers: { 24 | 'x-api-key' => @shared_values[:client].api_key 25 | } 26 | ) 27 | .to_return( 28 | body: response_body 29 | ) 30 | 31 | result = @shared_values[:client].legal_entity_management.business_lines_api.create_business_line(request_body) 32 | response_hash = result.response 33 | 34 | expect(result.status) 35 | .to eq(200) 36 | expect(response_hash) 37 | .to eq(JSON.parse(response_body)) 38 | expect(response_hash) 39 | .to be_a Adyen::HashWithAccessors 40 | expect(response_hash) 41 | .to be_a_kind_of Hash 42 | end 43 | 44 | it 'makes a documents DELETE call' do 45 | url = @shared_values[:client].service_url(@shared_values[:service], 'documents/123', 46 | @shared_values[:client].legal_entity_management.version) 47 | WebMock.stub_request(:delete, url) 48 | .with( 49 | headers: { 50 | 'x-api-key' => @shared_values[:client].api_key 51 | } 52 | ) 53 | .to_return( 54 | body: '{}' 55 | ) 56 | 57 | result = @shared_values[:client].legal_entity_management.documents_api.delete_document('123') 58 | result.response 59 | 60 | expect(result.status) 61 | .to eq(200) 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /spec/management-oauth_spec.rb: -------------------------------------------------------------------------------- 1 | require "spec_helper" 2 | require "json" 3 | 4 | # rubocop:disable Metrics/BlockLength 5 | 6 | RSpec.describe "Adyen::Management OAuth Authentication", service: "Management" do 7 | before(:all) do 8 | @shared_values = { 9 | client: create_client(:oauth), 10 | service: "Management", 11 | } 12 | @auth_header = { "Authorization": "Bearer #{@shared_values[:client].oauth_token}" } 13 | end 14 | 15 | # must be created manually because every field in the response is an array 16 | it "makes a companies GET call" do 17 | response_body = json_from_file("mocks/responses/Management/get_companies.json") 18 | 19 | url = @shared_values[:client].service_url(@shared_values[:service], "companies", @shared_values[:client].management.version) 20 | WebMock.stub_request(:get, url). 21 | with( 22 | headers: @auth_header 23 | ). 24 | to_return( 25 | body: response_body 26 | ) 27 | 28 | result = @shared_values[:client].management.account_company_level_api.list_company_accounts() 29 | response_hash = result.response 30 | 31 | expect(result.status). 32 | to eq(200) 33 | expect(response_hash). 34 | to eq(JSON.parse(response_body)) 35 | expect(response_hash). 36 | to be_a Adyen::HashWithAccessors 37 | expect(response_hash). 38 | to be_a_kind_of Hash 39 | end 40 | 41 | it "makes a create_store POST call" do 42 | request_body = JSON.parse(json_from_file("mocks/responses/LegalEntityManagement/create_business_line.json")) 43 | 44 | response_body = json_from_file("mocks/responses/LegalEntityManagement/create_business_line.json") 45 | 46 | url = @shared_values[:client].service_url(@shared_values[:service], "merchants/merchantID/stores", @shared_values[:client].management.version) 47 | WebMock.stub_request(:post, url). 48 | with( 49 | body: request_body, 50 | headers: @auth_header 51 | ). 52 | to_return( 53 | body: response_body 54 | ) 55 | 56 | result = @shared_values[:client].management.account_store_level_api.create_store_by_merchant_id(request_body, 'merchantID') 57 | response_hash = result.response 58 | 59 | expect(result.status). 60 | to eq(200) 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /spec/mocks/requests/Account/check_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER", 3 | "accountStateType": "Payout", 4 | "tier": "2" 5 | } 6 | -------------------------------------------------------------------------------- /spec/mocks/requests/Account/close_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountCode": "CODE_OF_ACCOUNT" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/close_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/create_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/create_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "GENERATE_CODE", 3 | "accountHolderDetails": { 4 | "email": "tim@green.com", 5 | "individualDetails": { 6 | "name": { 7 | "firstName": "Tim", 8 | "gender": "MALE", 9 | "lastName": "Green" 10 | } 11 | } 12 | }, 13 | "legalEntity": "Individual", 14 | "description": "Test Account Holder" 15 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/delete_bank_accounts.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER", 3 | "bankAccountUUIDs": [ 4 | "eeb6ed22-3bae-483c-83b9-bc2097a75d40" 5 | ] 6 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/delete_payout_methods.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER", 3 | "payoutMethodCodes": [ 4 | "mock_code" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /spec/mocks/requests/Account/delete_shareholders.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER", 3 | "shareholderCodes": [ 4 | "9188218c-576e-4cbe-8e86-72722f453920" 5 | ] 6 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/delete_signatories.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER", 3 | "signatoryCodes": [ 4 | "9188218c-576e-4cbe-8e86-72722f453920" 5 | ] 6 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/get_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/get_uploaded_documents.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER", 3 | "bankAccountUUID": "EXAMPLE_UUID" 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/suspend_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/un_suspend_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/update_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountCode": "CODE_OF_ACCOUNT", 3 | "payoutSchedule": { 4 | "schedule": "WEEKLY", 5 | "action": "CLOSE" 6 | } 7 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/update_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER", 3 | "accountHolderDetails": { 4 | "address": { 5 | "city": "Amsterdam", 6 | "country": "NL", 7 | "postalCode": "12345", 8 | "stateOrProvince": "NH", 9 | "street": "Teststreet 1" 10 | }, 11 | "bankAccountDetails": [], 12 | "email": "test@adyen.com", 13 | "individualDetails": { 14 | "name": { 15 | "firstName": "First name", 16 | "gender": "MALE", 17 | "lastName": "Last Name" 18 | }, 19 | "personalData": { 20 | "dateOfBirth": "1970-01-01", 21 | "idNumber": "1234567890", 22 | "nationality": "NL" 23 | } 24 | }, 25 | "merchantCategoryCode": "7999", 26 | "phoneNumber": { 27 | "phoneCountryCode": "NL", 28 | "phoneNumber": "0612345678", 29 | "phoneType": "Mobile" 30 | }, 31 | "webAddress": "http://www.accountholderwebsite.com" 32 | } 33 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/update_account_holder_state.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER", 3 | "disable": "true", 4 | "reason": "test reason payout", 5 | "stateType": "Payout" 6 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Account/upload_document.json: -------------------------------------------------------------------------------- 1 | { 2 | "documentContent": "dGVzdCBkb2N1bWVudCBjb250ZW50", 3 | "documentDetail": { 4 | "accountHolderCode": "CODE_OF_ACCOUNT_HOLDER", 5 | "documentType": "PASSPORT", 6 | "filename": "passport.png", 7 | "description": "test passport description" 8 | } 9 | } -------------------------------------------------------------------------------- /spec/mocks/requests/BalanceControl/balance_transfer.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "value": 50000, 4 | "currency": "EUR" 5 | }, 6 | "description": "Your description for the transfer", 7 | "fromMerchant": "MerchantAccount_NL", 8 | "toMerchant": "MerchantAccount_DE", 9 | "type": "debit" 10 | } -------------------------------------------------------------------------------- /spec/mocks/requests/BalancePlatform/create_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Liable account holder used for international payments and payouts", 3 | "reference": "S.Eller-001", 4 | "legalEntityId": "LE322JV223222D5GG42KN6869" 5 | } -------------------------------------------------------------------------------- /spec/mocks/requests/BalancePlatform/update_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Liable account holder used for international payments and payouts", 3 | "reference": "S.Eller-001", 4 | "legalEntityId": "LE322JV223222D5GG42KN6869", 5 | "capabilities": { 6 | "receivePayments": { 7 | "requested": true 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /spec/mocks/requests/BinLookup/get_3ds_availability.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "cardNumber": "4111111111111111" 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/BinLookup/get_cost_estimate.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "EUR", 4 | "value": 1000 5 | }, 6 | "cardNumber": "5101180000000007", 7 | "merchantAccount": "TestMerchant" 8 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/amount_updates.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "str", 4 | "value": 0 5 | }, 6 | "merchantAccount": "TestMerchant", 7 | "reason": "delayedCharge", 8 | "reference": "123456789", 9 | "splits": [ 10 | { 11 | "account": "string", 12 | "amount": { 13 | "currency": "str", 14 | "value": 0 15 | }, 16 | "description": "string", 17 | "reference": "string", 18 | "type": "BalanceAccount" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/apple_pay_sessions.json: -------------------------------------------------------------------------------- 1 | { 2 | "displayName": "YOUR_MERCHANT_NAME", 3 | "domainName": "window.location.hostname", 4 | "merchantIdentifier": "YOUR_MERCHANT_ID" 5 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/capture.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "str", 4 | "value": 0 5 | }, 6 | "lineItems": [ 7 | { 8 | "amountExcludingTax": 0, 9 | "amountIncludingTax": 0, 10 | "description": "string", 11 | "id": "string", 12 | "imageUrl": "string", 13 | "itemCategory": "string", 14 | "productUrl": "string", 15 | "quantity": 0, 16 | "taxAmount": 0, 17 | "taxPercentage": 0 18 | } 19 | ], 20 | "merchantAccount": "string", 21 | "reference": "string", 22 | "splits": [ 23 | { 24 | "account": "string", 25 | "amount": { 26 | "currency": "str", 27 | "value": 0 28 | }, 29 | "description": "string", 30 | "reference": "string", 31 | "type": "BalanceAccount" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/generic_cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "paymentReference": "12345", 4 | "reference": "123456789" 5 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/modifications_request.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adyen/adyen-ruby-api-library/a26075e56988344a15c1aeb9e0bc4b2bb0c9bd93/spec/mocks/requests/Checkout/modifications_request.json -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/orders.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency":"USD", 4 | "value": "1000" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/orders_cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "MERCHANT_ACCOUNT", 3 | "order": { 4 | "orderData": "mocked_order_data", 5 | "pspReference": "mocked_psp_ref" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/origin_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "originDomains": "https://adyen.com" 3 | } 4 | -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/payment-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": "VALUE_YOU_GET_FROM_CHECKOUT_SDK" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/payment_links.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "USD", 4 | "value": 1000 5 | }, 6 | "countryCode": "US", 7 | "merchantAccount": "TestMerchant", 8 | "reference": "Merchant Reference" 9 | } 10 | -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/payment_methods.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/payment_methods_balance.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "paymentMethod": { 4 | "type": "givex", 5 | "number": "4126491073027401", 6 | "cvc": "737" 7 | }, 8 | "merchantAccount": "YOUR_MERCHANT_ACCOUNT" 9 | } 10 | -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/payment_session.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "value": 1500, 4 | "currency": "EUR" 5 | }, 6 | "channel": "Web", 7 | "countryCode": "US", 8 | "html": true, 9 | "origin": "www.example.com", 10 | "returnUrl": "www.example.com", 11 | "shopperLocale": "en_GB", 12 | "shopperCountry": "US", 13 | "reference": "Merchant Reference", 14 | "merchantAccount": "TestMerchant" 15 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/payments.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "USD", 4 | "value": 1000 5 | }, 6 | "reference": "Mock payment", 7 | "paymentMethod": { 8 | "type": "scheme", 9 | "number": "4111111111111111", 10 | "expiryMonth": "08", 11 | "expiryYear": "2018", 12 | "holderName": "John Smith", 13 | "cvc": "737" 14 | }, 15 | "returnUrl": "", 16 | "merchantAccount": "TestMerchant" 17 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/psp_cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "reference": "123456789" 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/refund.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "str", 4 | "value": 0 5 | }, 6 | "lineItems": [ 7 | { 8 | "amountExcludingTax": 0, 9 | "amountIncludingTax": 0, 10 | "description": "string", 11 | "id": "string", 12 | "imageUrl": "string", 13 | "itemCategory": "string", 14 | "productUrl": "string", 15 | "quantity": 0, 16 | "taxAmount": 0, 17 | "taxPercentage": 0 18 | } 19 | ], 20 | "merchantAccount": "TestMerchant", 21 | "reference": "123456789", 22 | "splits": [ 23 | { 24 | "account": "string", 25 | "amount": { 26 | "currency": "str", 27 | "value": 0 28 | }, 29 | "description": "string", 30 | "reference": "string", 31 | "type": "BalanceAccount" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Checkout/sessions.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "YourMerchantAccount", 3 | "amount": { 4 | "value": 100, 5 | "currency": "EUR" 6 | }, 7 | "returnUrl": "https://your-company.com/checkout?shopperOrder=12xy..", 8 | "reference": "YOUR_PAYMENT_REFERENCE", 9 | "countryCode": "NL" 10 | } -------------------------------------------------------------------------------- /spec/mocks/requests/DataProtectionService/request_subject_erasure.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "test_merchant", 3 | "pspReference": "test_reference", 4 | "forceErasure": true 5 | } 6 | -------------------------------------------------------------------------------- /spec/mocks/requests/DisputesService/retrieve_applicable_defense_reasons.json: -------------------------------------------------------------------------------- 1 | { 2 | "disputePspReference": "DZ4DPSHB4WD2WN82", 3 | "merchantAccountCode": "YOUR_MERCHANT_ACCOUNT" 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Fund/account_holder_balance.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "TestAccountHolder877209" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Fund/account_holder_transaction_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "TestAccountHolder423978", 3 | "transactionStatuses": [ 4 | "PendingCredit", 5 | "Credited", 6 | "Debited" 7 | ], 8 | "transactionListsPerAccount": [ 9 | { 10 | "TransactionListForAccount": { 11 | "accountCode": "2e64b396-1200-4474-b848-0cb06b52b3c7", 12 | "page": 2 13 | } 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Fund/payout_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountCode": "118731451", 3 | "amount": { 4 | "currency": "EUR", 5 | "value": 99792 6 | }, 7 | "accountHolderCode": "TestAccountHolder877209", 8 | "description": "12345 – Test", 9 | "bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c" 10 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Fund/refund_funds_transfer.json: -------------------------------------------------------------------------------- 1 | { 2 | "originalReference": "190324759", 3 | "amount": { 4 | "currency": "EUR", 5 | "value": 2000 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /spec/mocks/requests/Fund/refund_not_paid_out_transfers.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "TestAccountHolder502924", 3 | "accountCode": "189184578" 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Fund/setup_beneficiary.json: -------------------------------------------------------------------------------- 1 | { 2 | "destinationAccountCode": "128952522", 3 | "merchantReference": "Test", 4 | "sourceAccountCode": "134498192" 5 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Fund/transfer_funds.json: -------------------------------------------------------------------------------- 1 | { 2 | "sourceAccountCode": "100000000", 3 | "destinationAccountCode": "190324759", 4 | "amount": { 5 | "currency": "EUR", 6 | "value": 2000 7 | }, 8 | "transferCode": "CODE_A" 9 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Hop/get_onboarding_url.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderCode": "YourUniqueAccountHolderCode", 3 | "returnUrl": "https://your.return-url.com/?submerchant=123" 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/LegalEntityManagement/create_business_line.json: -------------------------------------------------------------------------------- 1 | { 2 | "service": "banking", 3 | "industryCode": "4531", 4 | "webData": [ 5 | { 6 | "webAddress": "https://www.adyen.com" 7 | } 8 | ], 9 | "legalEntityId": "YOUR_LEGAL_ENTITY", 10 | "sourceOfFunds": { 11 | "type": "business", 12 | "adyenProcessedFunds": false, 13 | "description": "Funds from my flower shop business" 14 | } 15 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Management/create_store.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "City centre store", 3 | "shopperStatement": "Springfield Shop", 4 | "phoneNumber": "1813702551707653", 5 | "reference": "Spring_store_2", 6 | "address": { 7 | "country": "US", 8 | "line1": "200 Main Street", 9 | "line2": "Building 5A", 10 | "line3": "Suite 3", 11 | "city": "Springfield", 12 | "stateOrProvince": "NY", 13 | "postalCode": "20250" 14 | } 15 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Notification/create_notification_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurationDetails": { 3 | "active": "true", 4 | "description": "Test notification769551", 5 | "eventConfigs": [ 6 | { 7 | "NotificationEventConfiguration": { 8 | "eventType": "ACCOUNT_HOLDER_VERIFICATION", 9 | "includeMode": "INCLUDE" 10 | } 11 | } 12 | ], 13 | "messageFormat": "SOAP", 14 | "notifyURL": "https://www.merchant-domain.com/notification-handler", 15 | "notifyUsername": "testUserName", 16 | "notifyPassword": "testPassword", 17 | "sendActionHeader": "true", 18 | "sslProtocol": "SSL" 19 | } 20 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Notification/delete_notification_configurations.json: -------------------------------------------------------------------------------- 1 | { 2 | "notificationIds": [ 3 | 134678887, 4 | 234674578 5 | ] 6 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Notification/get_notification_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "notificationId": 234674578 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Notification/get_notification_configuration_list.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /spec/mocks/requests/Notification/test_notification_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "eventTypes": [], 3 | "notificationId": 234674578 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Notification/update_notification_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurationDetails": { 3 | "active": "false", 4 | "description": "new description799847", 5 | "eventConfigs": [ 6 | { 7 | "NotificationEventConfiguration": { 8 | "eventType": "ACCOUNT_HOLDER_CREATED", 9 | "includeMode": "EXCLUDE" 10 | } 11 | }, 12 | { 13 | "NotificationEventConfiguration": { 14 | "eventType": "ACCOUNT_CREATED", 15 | "includeMode": "INCLUDE" 16 | } 17 | } 18 | ], 19 | "notificationId": 234674578, 20 | "notifyPassword": "testPassword2", 21 | "notifyURL": "http://www.adyen.com", 22 | "notifyUsername": "testUserName2", 23 | "sendActionHeader": "false", 24 | "sslProtocol": "TLSv10" 25 | } 26 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/adjust_authorisation.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount" : "TestMerchant", 3 | "modificationAmount" : { 4 | "currency" : "EUR", 5 | "value" : 1500 6 | }, 7 | "originalReference" : "8123456789012345", 8 | "reference" : "Adjust Authorisation", 9 | "additionalData" : { 10 | "industryUsage" : "DelayedCharge" 11 | } 12 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/authorise.json: -------------------------------------------------------------------------------- 1 | { 2 | "card": { 3 | "number": "4111111111111111", 4 | "expiryMonth": "08", 5 | "expiryYear": "2018", 6 | "holderName": "Test Person", 7 | "cvc": "737" 8 | }, 9 | "amount": { 10 | "value": 1500, 11 | "currency": "EUR" 12 | }, 13 | "billingAddress" : { 14 | "country" : "US", 15 | "city" : "Cupertino", 16 | "street" : "Infinite Loop", 17 | "houseNumberOrName" : "1", 18 | "stateOrProvince" : "CA", 19 | "postalCode" : "95014" 20 | }, 21 | "channel": "Web", 22 | "countryCode": "US", 23 | "returnUrl": "www.example.com", 24 | "shopperLocale": "en_GB", 25 | "shopperCountry": "US", 26 | "reference": "Merchant Reference", 27 | "merchantAccount": "TestMerchant" 28 | } 29 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/authorise3d.json: -------------------------------------------------------------------------------- 1 | { 2 | "md":"NQoFyCoAFvXlGTRTZUO/gQApqUw66VhBXLUyO8nKY+Tw8ARE6SiWcbyF1v/0vdiSB2kK3AhKRE60b896iKEw2y0UjWGhiJJvXDOgHF9rkJLE87O5VlIbC512MP+TmZamajCBeGA+rjnHLHI6Toqds+WAa2RzUcxpcFppEygpLWLwnotnOcS412WBuoylNuxBZjtLoq8e1bMui6QwYZuDXBI8eETq9p607FrzDiZu4s9LwzNrewdqsYDrHYap5hOpYGgA9Z++HDtvLtMENqfETAa1qQKFQV5WVoQQFt0kWIyn4HluxS9uxDUfaXwMN1uHv75JXH5XijDxlnkwtxxRZbF/wbAOFVCs8peenxZ4fk/TCiyBZDw3oPzmXC42WYTQPWc44GCcs7pxd97O+W2Hspa3Ic/5jbx6WT3hVePtuap32QX1ijiTZ76ucEvcRYPpSOVJ2X7S0hBJNK71XIVoiQ==", 3 | "paResponse":"eNpVUdtuwjAM/ZWND2iStqEXmUgZnTQeym3wsKepSi2oRFtI20H39UuAji1PPufYjn0Mm71GTN5RdRoFpNg02Q6finwyisPQ5TSgPvfGEaU8GglYyjWeBHyhboq6EsyhjgtkgKZcq31WtQIydXqZzQVnrucDuSMoUc8SscGmXZalVKeu0KiB3GioshLFVn7K6XM8rQ9Fta7rHMiVBlV3Vat7wd0QyACg0wexb9tjTMj5fHayvMfKUXUJxCpAHgMtOxs1ptOlyMUi2fXzjfTSZMXS7w+eJpItVtK+CRCbAXnWonApCxil3hPjse/GfgTkykNW2hHE63ZtJOpQapa8UXC0P8kbMJqV/lJgnNZYqV5EgV1lQICXY12hyTCO/sZAHoNP36yvqjVecdcay8dBGNHB4qtguxTGGRbS8NrGAiC2lNyPR+5HNtG/4/8A8k2p9Q==", 4 | "merchantAccount": "TestMerchant", 5 | "shopperIP": "61.294.12.12" 6 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/authorise3ds2.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount":"TestMerchant", 3 | "threeDS2RequestData":{ 4 | "threeDSCompInd":"Y" 5 | }, 6 | "threeDS2Token":"BQABAQBPCQZ98WKh3v7qGnBlUMGClVzDolIjs8w/8L64WIAqaOGZipbZod7n+E=" 7 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "originalReference": "8123456789012345" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/cancel_or_refund.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "originalReference": "8123456789012345" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/capture.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "originalReference": "8123456789012345", 4 | "modificationAmount": { 5 | "value": 2000, 6 | "currency": "EUR" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/donate.json: -------------------------------------------------------------------------------- 1 | { 2 | "originalReference": "882594077439995E", 3 | "modificationAmount": { 4 | "value": 100, 5 | "currency": "USD" 6 | }, 7 | "reference": "Donation", 8 | "donationAccount": "TestMerchantDonations", 9 | "merchantAccount": "TestMerchant" 10 | } 11 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/get_authentication_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "MERCHANT_ACCOUNT", 3 | "pspReference": "9914694372990637" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/refund.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "originalReference": "8123456789012345", 4 | "modificationAmount": { 5 | "value": 2000, 6 | "currency": "EUR" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/retrieve_3ds2_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "MERCHANT_ACCOUNT", 3 | "pspReference": "9914694372990637" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/technical_cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "MERCHANT_ACCOUNT", 3 | "originalReference": "9914694372990637" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payment/void_pending_refund.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "MERCHANT_ACCOUNT", 3 | "originalReference": "9914694372990637" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payout/confirm_third_party.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "originalReference": "8123456789012345" 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Payout/decline_third_party.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "originalReference": "8123456789012345" 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Payout/payout.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "USD", 4 | "value": 1000 5 | }, 6 | "merchantAccount": "MERCHANT_ACCOUNT", 7 | "reference": "9876543210" 8 | } 9 | -------------------------------------------------------------------------------- /spec/mocks/requests/Payout/store_detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "card": { 3 | "number": "4111111111111111", 4 | "expiryMonth": "08", 5 | "expiryYear": "2018", 6 | "holderName": "Test Person", 7 | "cvc": "737" 8 | }, 9 | "amount": { 10 | "value": 1500, 11 | "currency": "EUR" 12 | }, 13 | "billingAddress" : { 14 | "country" : "US", 15 | "city" : "Cupertino", 16 | "street" : "Infinite Loop", 17 | "houseNumberOrName" : "1", 18 | "stateOrProvince" : "CA", 19 | "postalCode" : "95014" 20 | }, 21 | "shopperEmail": "shopper@email.com", 22 | "channel": "Web", 23 | "countryCode": "US", 24 | "returnUrl": "www.example.com", 25 | "shopperLocale": "en_GB", 26 | "shopperCountry": "US", 27 | "shopperReference": "crrood", 28 | "reference": "PM authorise card", 29 | "merchantAccount": "TestMerchant", 30 | "recurring": { 31 | "contract": "PAYOUT" 32 | } 33 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Payout/store_detail_and_submit_third_party.json: -------------------------------------------------------------------------------- 1 | { 2 | "card": { 3 | "number": "4111111111111111", 4 | "expiryMonth": "08", 5 | "expiryYear": "2018", 6 | "holderName": "Test Person", 7 | "cvc": "737" 8 | }, 9 | "amount": { 10 | "value": 1500, 11 | "currency": "EUR" 12 | }, 13 | "billingAddress" : { 14 | "country" : "US", 15 | "city" : "Cupertino", 16 | "street" : "Infinite Loop", 17 | "houseNumberOrName" : "1", 18 | "stateOrProvince" : "CA", 19 | "postalCode" : "95014" 20 | }, 21 | "shopperEmail": "shopper@email.com", 22 | "channel": "Web", 23 | "countryCode": "US", 24 | "returnUrl": "www.example.com", 25 | "shopperLocale": "en_GB", 26 | "shopperCountry": "US", 27 | "shopperReference": "crrood", 28 | "reference": "PM authorise card", 29 | "merchantAccount": "TestMerchant", 30 | "recurring": { 31 | "contract": "PAYOUT" 32 | } 33 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Payout/submit_third_party.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "EUR", 4 | "value": "1000" 5 | }, 6 | "merchantAccount": "TestMerchant", 7 | "recurring": { 8 | "contract": "PAYOUT" 9 | }, 10 | "reference": "PayoutPayment-0001", 11 | "shopperEmail": "shopper@email.com", 12 | "shopperReference": "TheShopperReference", 13 | "shopperName": { 14 | "firstName": "Adyen", 15 | "gender": "MALE", 16 | "lastName": "Test" 17 | }, 18 | "dateOfBirth": "1990-01-01", 19 | "entityType": "Company", 20 | "nationality": "NL", 21 | "selectedRecurringDetailReference": "LATEST" 22 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Recurring/create_permit.json: -------------------------------------------------------------------------------- 1 | { 2 | "permits": "object", 3 | "merchantAccount": "TestMerchant", 4 | "shopperReference": "shopperReference", 5 | "recurringDetailsReference": "object" 6 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Recurring/disable.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "shopperReference": "shopperReference", 4 | "recurringDetailReference": "8123456789012345" 5 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Recurring/list_recurring_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "shopperReference": "shopperReference" 4 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Recurring/schedule_account_updater.json: -------------------------------------------------------------------------------- 1 | { 2 | "card": { 3 | "number": "4111111111111111", 4 | "expiryMonth": "8", 5 | "expiryYear": "2018", 6 | "cvc": "737", 7 | "holderName": "John Smith" 8 | }, 9 | "reference": "Merchant Reference", 10 | "merchantAccount": "TestMerchant", 11 | "shopperReference": "shopperReference" 12 | } 13 | -------------------------------------------------------------------------------- /spec/mocks/requests/StoredValue/issue_giftcard.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "YOUR_MERCHANT_ACCOUNT", 3 | "store": "YOUR_STORE_ID", 4 | "paymentMethod": { 5 | "type": "givex" 6 | }, 7 | "amount": { 8 | "currency": "EUR", 9 | "value": 1000 10 | }, 11 | "reference": "YOUR_REFERENCE" 12 | } 13 | -------------------------------------------------------------------------------- /spec/mocks/requests/Terminal/assign_terminals.json: -------------------------------------------------------------------------------- 1 | { 2 | "companyAccount": "TestCompany", 3 | "merchantAccount": "TestMerchant", 4 | "merchantInventory": false, 5 | "terminals": ["e285-123456789"] 6 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Terminal/find_terminal.json: -------------------------------------------------------------------------------- 1 | { 2 | "terminal": "e285-123456789" 3 | } 4 | -------------------------------------------------------------------------------- /spec/mocks/requests/Terminal/get_terminals_under_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "companyAccount" : "TestCompany", 3 | "merchantAccount" : "TestMerchant" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/requests/TerminalCloudAPI/connected_terminals.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "YourMerchantAccount" 3 | } -------------------------------------------------------------------------------- /spec/mocks/requests/TerminalCloudAPI/sync_payment.json: -------------------------------------------------------------------------------- 1 | { 2 | "SaleToPOIRequest": { 3 | "MessageHeader": { 4 | "MessageClass": "Service", 5 | "MessageCategory": "Payment", 6 | "MessageType": "Request", 7 | "ServiceID": "1233094855", 8 | "SaleID": "POSSystemID12345", 9 | "POIID": "V400m-1234123412", 10 | "ProtocolVersion": "3.0" 11 | }, 12 | "PaymentRequest": { 13 | "SaleData": { 14 | "SaleTransactionID": { 15 | "TransactionID": "123456764", 16 | "TimeStamp": "2023-08-23T09:48:55" 17 | }, 18 | "SaleToAcquirerData": "eyJhcHBsaWNhdGlvbkluZm8iOnsiYWR5ZW5MaWJyYXJ5Ijp7Im5hbWUiOiJhZ....", 19 | "TokenRequestedType": "Transaction" 20 | }, 21 | "PaymentTransaction": { 22 | "AmountsReq": { 23 | "Currency": "EUR", 24 | "RequestedAmount": 10 25 | } 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /spec/mocks/requests/Transfers/make_transfer.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "value": 110000, 4 | "currency": "EUR" 5 | }, 6 | "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4", 7 | "category": "bank", 8 | "counterparty": { 9 | "bankAccount": { 10 | "accountHolder": { 11 | "fullName": "A. Klaassen", 12 | "address": { 13 | "city": "San Francisco", 14 | "country": "US", 15 | "postalCode": "94678", 16 | "stateOrProvince": "CA", 17 | "street": "Brannan Street", 18 | "street2": "274" 19 | } 20 | }, 21 | "accountIdentification": { 22 | "type": "numberAndBic", 23 | "accountNumber": "123456789", 24 | "bic": "BOFAUS3NXXX" 25 | } 26 | } 27 | }, 28 | "priority": "crossBorder", 29 | "referenceForBeneficiary": "Your-reference-sent-to-the-beneficiary", 30 | "reference": "Your internal reference for the transfer", 31 | "description": "Your description for the transfer" 32 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/check_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914694372990637" 3 | } 4 | -------------------------------------------------------------------------------- /spec/mocks/responses/Account/close_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914913129290137", 3 | "submittedAsync":"false", 4 | "status":"Closed" 5 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/close_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914713476670992", 3 | "submittedAsync":"false", 4 | "accountHolderStatus":{ 5 | "status":"Closed" 6 | } 7 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/create_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914913130220156", 3 | "submittedAsync":"false", 4 | "accountHolderCode":"TestAccountHolder5691", 5 | "accountCode":"195920946", 6 | "status":"Active" 7 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/delete_bank_accounts.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914694372670551", 3 | "submittedAsync":"false" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/delete_payout_methods.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "9914694372990637" 3 | } 4 | -------------------------------------------------------------------------------- /spec/mocks/responses/Account/delete_shareholders.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914694372990637", 3 | "submittedAsync":"false" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/delete_signatories.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914694372990637" 3 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/get_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8815263414367329", 3 | "submittedAsync": "false", 4 | "accountHolderCode": "holderCode", 5 | "accountHolderDetails": { 6 | "bankAccountDetails": [], 7 | "email": "tim@green.com", 8 | "individualDetails": { 9 | "name": { 10 | "firstName": "Tim", 11 | "gender": "MALE", 12 | "lastName": "Green" 13 | } 14 | }, 15 | "merchantCategoryCode": "7999" 16 | }, 17 | "accountHolderStatus": { 18 | "status": "Active", 19 | "processingState": { 20 | "disabled": "false", 21 | "processedFrom": { 22 | "currency": "EUR", 23 | "value": 0 24 | }, 25 | "processedTo": { 26 | "currency": "EUR", 27 | "value": 9999 28 | }, 29 | "tierNumber": 0 30 | }, 31 | "payoutState": { 32 | "allowPayout": "false", 33 | "disabled": "false" 34 | } 35 | }, 36 | "accounts": [ 37 | { 38 | "Account": { 39 | "accountCode": "152059446", 40 | "description": "TransactionAccount", 41 | "payoutSchedule": { 42 | "schedule": "DEFAULT" 43 | }, 44 | "status": "Active" 45 | } 46 | } 47 | ], 48 | "legalEntity": "Individual", 49 | "verification": { 50 | "accountHolder": { 51 | "checks": [ 52 | { 53 | "type": "IDENTITY_VERIFICATION", 54 | "status": "AWAITING_DATA", 55 | "requiredFields": [ 56 | "AccountHolderDetails.Address.address", 57 | "AccountHolderDetails.PersonalData.personalData" 58 | ] 59 | }, 60 | { 61 | "type": "BANK_ACCOUNT_VERIFICATION", 62 | "status": "AWAITING_DATA", 63 | "requiredFields": [ 64 | "AccountHolderDetails.BankAccountDetails.bankAccount", 65 | "AccountHolderDetails.BankAccountDetails.bankStatement" 66 | ] 67 | } 68 | ] 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/get_uploaded_documents.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914694369860322", 3 | "submittedAsync":"false", 4 | "documentDetails":[ 5 | { 6 | "DocumentDetail":{ 7 | "accountHolderCode":"TestAccountHolder8031", 8 | "bankAccountUUID": "EXAMPLE_UUID", 9 | "countryCode":"NL", 10 | "description":"description1", 11 | "documentType":"BANK_STATEMENT", 12 | "filename":"bankstatement.png" 13 | } 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/suspend_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914762643560032", 3 | "submittedAsync":"false", 4 | "accountHolderStatus":{ 5 | "status":"Suspended", 6 | "processingState":{ 7 | "processedFrom":{ 8 | "currency":"EUR", 9 | "value":0 10 | }, 11 | "processedTo":{ 12 | "currency":"EUR", 13 | "value":9999 14 | } 15 | }, 16 | "payoutState":{ 17 | "allowPayout":"false", 18 | "payoutLimit":{ 19 | "currency":"EUR", 20 | "value":49999 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/un_suspend_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914762644860159", 3 | "submittedAsync":"false", 4 | "accountHolderStatus":{ 5 | "status":"Active", 6 | "processingState":{ 7 | "processedFrom":{ 8 | "currency":"EUR", 9 | "value":0 10 | }, 11 | "processedTo":{ 12 | "currency":"EUR", 13 | "value":9999 14 | } 15 | }, 16 | "payoutState":{ 17 | "allowPayout":"false", 18 | "payoutLimit":{ 19 | "currency":"EUR", 20 | "value":49999 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/update_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "9914860311410009", 3 | "submittedAsync": "false", 4 | "accountCode": "198360329", 5 | "payoutSchedule": { 6 | "nextScheduledPayout": "2017-02-06T11:32:26+01:00", 7 | "schedule": "WEEKLY" 8 | } 9 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/update_account_holder_state.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8515090175978108", 3 | "submittedAsync": "false", 4 | "accountHolderCode": "testIndividual5", 5 | "accountHolderStatus": { 6 | "status": "Active", 7 | "processingState": { 8 | "disabled": "false", 9 | "processedFrom": { 10 | "currency": "USD", 11 | "value": 0 12 | }, 13 | "processedTo": { 14 | "currency": "USD", 15 | "value": 9999 16 | } 17 | }, 18 | "payoutState": { 19 | "allowPayout": "true", 20 | "payoutLimit": { 21 | "currency": "USD", 22 | "value": 74999 23 | }, 24 | "disabled": "false" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Account/upload_document.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference":"9914762681460244", 3 | "submittedAsync":"false", 4 | "accountHolderCode":"TestAccountHolder534055", 5 | "accountHolderDetails":{ 6 | "bankAccountDetails":[ 7 | 8 | ], 9 | "email":"testEmail@gmail.com", 10 | "individualDetails":{ 11 | "name":{ 12 | "firstName":"TestFirstName", 13 | "gender":"MALE", 14 | "lastName":"TestLastName" 15 | } 16 | }, 17 | "merchantCategoryCode":"7999" 18 | }, 19 | "accountHolderStatus":{ 20 | "status":"Active", 21 | "processingState":{ 22 | "processedFrom":{ 23 | "currency":"GBP", 24 | "value":0 25 | }, 26 | "processedTo":{ 27 | "currency":"GBP", 28 | "value":9999 29 | } 30 | }, 31 | "payoutState":{ 32 | "allowPayout":"true", 33 | "payoutLimit":{ 34 | "currency":"GBP", 35 | "value":49999 36 | } 37 | } 38 | }, 39 | "invalidFields":[ 40 | 41 | ], 42 | "verification":{ 43 | "accountHolder":{ 44 | "checks":[ 45 | { 46 | "type":"PASSPORT_VERIFICATION", 47 | "status":"AWAITING_DATA", 48 | "requiredFields":[ 49 | "AccountHolderDetails.Document.passport" 50 | ] 51 | }, 52 | { 53 | "type":"IDENTITY_VERIFICATION", 54 | "status":"PASSED", 55 | "summary":{ 56 | "code":1602, 57 | "description":"Passed" 58 | } 59 | } 60 | ] 61 | }, 62 | "bankAccounts":[ 63 | { 64 | "bankAccountUUID":"2f11df0b-a265-47ae-89c0-3d892066e7f5", 65 | "checks":[ 66 | { 67 | "type":"BANK_ACCOUNT_VERIFICATION", 68 | "status":"PASSED" 69 | } 70 | ] 71 | } 72 | ] 73 | }, 74 | "updatedFields":[ 75 | 76 | ] 77 | } -------------------------------------------------------------------------------- /spec/mocks/responses/BalanceControl/balance_transfer.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "value": 50000, 4 | "currency": "EUR" 5 | }, 6 | "createdAt": "2022-01-24T14:59:11+01:00", 7 | "description": "Your description for the transfer", 8 | "fromMerchant": "MerchantAccount_NL", 9 | "toMerchant": "MerchantAccount_DE", 10 | "type": "debit", 11 | "reference": "Unique reference for the transfer", 12 | "pspReference": "8816080397613514", 13 | "status": "transferred" 14 | } -------------------------------------------------------------------------------- /spec/mocks/responses/BalancePlatform/create_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "balancePlatform": "YOUR_BALANCE_PLATFORM", 3 | "description": "Liable account holder used for international payments and payouts", 4 | "legalEntityId": "LE322JV223222D5GG42KN6869", 5 | "reference": "S.Eller-001", 6 | "capabilities": { 7 | "receiveFromPlatformPayments": { 8 | "enabled": true, 9 | "requested": true, 10 | "allowed": false, 11 | "verificationStatus": "pending" 12 | }, 13 | "receiveFromBalanceAccount": { 14 | "enabled": true, 15 | "requested": true, 16 | "allowed": false, 17 | "verificationStatus": "pending" 18 | }, 19 | "sendToBalanceAccount": { 20 | "enabled": true, 21 | "requested": true, 22 | "allowed": false, 23 | "verificationStatus": "pending" 24 | }, 25 | "sendToTransferInstrument": { 26 | "enabled": true, 27 | "requested": true, 28 | "allowed": false, 29 | "requestedSettings": { 30 | "interval": "daily", 31 | "maxAmount": { 32 | "currency": "EUR", 33 | "value": 0 34 | } 35 | }, 36 | "verificationStatus": "pending" 37 | } 38 | }, 39 | "id": "AH32272223222G5HNCR9S3M5Z", 40 | "status": "active" 41 | } -------------------------------------------------------------------------------- /spec/mocks/responses/BalancePlatform/get_balance_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountHolderId": "AH32272223222B59K6RTQBFNZ", 3 | "defaultCurrencyCode": "EUR", 4 | "timeZone": "Europe/Amsterdam", 5 | "balances": [ 6 | { 7 | "available": 0, 8 | "balance": 0, 9 | "currency": "EUR", 10 | "reserved": 0 11 | } 12 | ], 13 | "id": "BA3227C223222B5BLP6JQC3FD", 14 | "status": "active" 15 | } -------------------------------------------------------------------------------- /spec/mocks/responses/BalancePlatform/update_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "balancePlatform": "YOUR_BALANCE_PLATFORM", 3 | "description": "Liable account holder used for international payments and payouts", 4 | "legalEntityId": "LE322JV223222F5GKQZZ9DS99", 5 | "reference": "S.Eller-001", 6 | "capabilities": { 7 | "receivePayments": { 8 | "enabled": false, 9 | "requested": true, 10 | "allowed": false, 11 | "verificationStatus": "pending" 12 | } 13 | }, 14 | "id": "AH3227C223222C5GKR23686TF", 15 | "status": "active" 16 | } -------------------------------------------------------------------------------- /spec/mocks/responses/BinLookup/get_3ds_availability.json: -------------------------------------------------------------------------------- 1 | { 2 | "binDetails": { 3 | "issuerCountry": "NL" 4 | }, 5 | "threeDS1Supported": true, 6 | "threeDS2CardRangeDetails": [], 7 | "threeDS2supported": false 8 | } -------------------------------------------------------------------------------- /spec/mocks/responses/BinLookup/get_cost_estimate.json: -------------------------------------------------------------------------------- 1 | { 2 | "costEstimateAmount": { 3 | "currency": "EUR", 4 | "value": 1000 5 | }, 6 | "resultCode": "Success", 7 | "surchargeType": "PASSTHROUGH" 8 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/amount_updates.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "str", 4 | "value": 0 5 | }, 6 | "merchantAccount": "TestMerchant", 7 | "paymentPspReference": "123456789", 8 | "pspReference": "12345", 9 | "reason": "delayedCharge", 10 | "reference": "123456789", 11 | "splits": [ 12 | { 13 | "account": "string", 14 | "amount": { 15 | "currency": "str", 16 | "value": 0 17 | }, 18 | "description": "string", 19 | "reference": "string", 20 | "type": "BalanceAccount" 21 | } 22 | ], 23 | "status": "received" 24 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/apple_pay_sessions.json: -------------------------------------------------------------------------------- 1 | { 2 | "data" : "LARGE_BLOB_HERE" 3 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/capture.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "str", 4 | "value": 0 5 | }, 6 | "lineItems": [ 7 | { 8 | "amountExcludingTax": 0, 9 | "amountIncludingTax": 0, 10 | "description": "string", 11 | "id": "string", 12 | "imageUrl": "string", 13 | "itemCategory": "string", 14 | "productUrl": "string", 15 | "quantity": 0, 16 | "taxAmount": 0, 17 | "taxPercentage": 0 18 | } 19 | ], 20 | "merchantAccount": "string", 21 | "paymentPspReference": "string", 22 | "pspReference": "12345", 23 | "reference": "123456789", 24 | "splits": [ 25 | { 26 | "account": "string", 27 | "amount": { 28 | "currency": "str", 29 | "value": 0 30 | }, 31 | "description": "string", 32 | "reference": "string", 33 | "type": "BalanceAccount" 34 | } 35 | ], 36 | "status": "received" 37 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/generic_cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "string", 3 | "paymentReference": "123456789", 4 | "pspReference": "12345", 5 | "reference": "123456789", 6 | "status": "received" 7 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/get-payment-link.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "USD", 4 | "value": 1000 5 | }, 6 | "id": "MockId", 7 | "merchantAccount": "TestMerchant", 8 | "reference": "Merchant Reference", 9 | "status": "active", 10 | "url": "https://adyen.com" 11 | } 12 | -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/modifications.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adyen/adyen-ruby-api-library/a26075e56988344a15c1aeb9e0bc4b2bb0c9bd93/spec/mocks/responses/Checkout/modifications.json -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/orders.json: -------------------------------------------------------------------------------- 1 | { 2 | "expiresAt": "1970-01-01", 3 | "orderData": "mockedOrderData", 4 | "remainingAmount": { 5 | "currency": "USD", 6 | "value": 100 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/orders_cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "mocked_psp_ref", 3 | "resultCode": "cancelled" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/origin_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "originKeys": { 3 | "https://adyen.com": "mocked_origin_key" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/payment-details.json: -------------------------------------------------------------------------------- 1 | { 2 | "resultCode": "RedirectShopper", 3 | "details": [ 4 | { 5 | "key": "returnUrlQueryString", 6 | "type": "text" 7 | } 8 | ], 9 | "paymentData": "Ab02b4c0!BQABAgCZ5wU8Xzylbj3tQI9zZtbOmutq5gON3jF0JOVL9VXTcQ70LkB8UzJZ2EuJiURbwNSpyfMnNNR9ecDBq0Ai+Cu97eUP6/wc51Gh2VClWKILA3fpetixy8rcEd1dHVT9Exa77zg0LuY6qXz/5GIIH62y9CnmKJH4a4KZVQwFu9VYtPnsC8p6Bby2BuByD/VSa3noZDBVuapvWL7+8P6QaPgkFgoWYnzT8uzdoCio+gTNEYivlxhuQj5qa+eyQCrzZDXAvl+1a1z7O3BOOC7yPT0VDd8zNnyxKk9lyax75FUCRYl1BNCP1CGGDzHfvsS8C4FhXPixhZ4Lb1pYajLpKXNqfiRqU4DXn6bAkdnoQ5X8TvD3HqgHos4OLY93qq7j3ai+zeS/hWkZrd0SM+br3G+kCPmzMcBYdIqJLecJcVUUWHUNfdYIl6tmzNDbeedqSXVkyX+w7R/bM3hHppQyFpy2UM6BHalSaIc2oqR2wLQeObOlV9VML2yAvUzIK6OsFdnCtjK+aQsYwBvKMHkgsukvJiEvfwkLzrwxJQWRvYQtVV7ITcSz98tKZmxUFdke8Hca+ySTbqq9OvjGCK+T7FLhaKYGSECcwwKCCKMneTW7S/8Y+qpw2WRBx2Bhho8ZfIwsnq2Nll+QbaOJEiC0PG3NokYhcrKVhXiFFkYYnzNI9hAnjkefE+5rR5dWWWM8Q8h7AEp7ImtleSI6IkFGMEFBQTEwM0NBNTM3RUFFRDg3QzI0REQ1MzkwOUI4MEE3OEE5MjNFMzgyM0Q2OERBQ0M5NEI5RkY4MzA1REMifbA560uFihRRe//z0I3kVj3lZxHTKJZgPZUDraWMQfkMjM7KKXPwyCXyThFp1bFYMmebpxYvbqErFky66og24VCmvNKiZnf1uPJi5OsK9t6QJU1vhC0/QzeCu1TQLUEyUWrelX0V+iO+933RFUzSv78BLNO/bt5JMFIKQoLP6J4CW+bHk+fWrBn4PhbZ5z/ezu23OHoDvg6Pvk1kjxps8FAbHoSB35b+HvOUDtph/usiBWBCgLQVtkbR7C2ImDd4HRh3QvkgjXgbRGGIBBc+jPM9TMYytNlAhB32jktviPASz9+v073N417onB0pcS0Bp2iFTpmsMjWcSbctbj65JTiBIwY6egGrD9ona/oEb+/oppiz4KzS2sJKvtOPg+Jxn2UNssc0dg8gZhV1dxfSqDNonsfxl0vwKoeG99FjyrfgFQvYNlqjn3/WNacjFtCOrBafIQJk95TnkBdpzuqtvqQyIZeq7PbRuTNIb1AQBTmKNmuZMd+gO95sIvhbE1XgO2InIQKCpw0q0Hbw9Nzowm6w1gbSKnabGZhb8SOM+lJ37dNTsNIB/5Eo36kijladqVt5RYGMHLkQa6vxjhfuYPfHYzO5MX4i0ml8rstB5D5sfLqvY3Igzc6RnDhpX5kxVIFAhuPxkTeKFTpCXmnHJwilCY9pZTzVlJp6kOWnk1JlalrzmI3iU6Zhz3ICLNQ+Ub/HEnombi31lZWHnUmhwGKxKg==", 10 | "redirect": { 11 | "method": "GET", 12 | "url": "https://test.adyen.com/hpp/redirectIdeal.shtml?brandCode=ideal¤cyCode=USD&merchantAccount=ColinRood&merchantReference=PM+Checkout+Payment&merchantSig=MKOR8NMs6190maY8sPDCMgOHNIscN356EIhUxSnpDsw%3D&paymentAmount=1000&resURL=https%3A%2F%2Fcheckoutshopper-test.adyen.com%2Fcheckoutshopper%2Fservices%2FPaymentIncomingRedirect%2Fv1%2FlocalPaymentMethod%3FreturnURL%3D&sessionValidity=2018-03-02T18%3A05%3A42Z&skinCode=pub.v2.8115054323780109.7FDNnCDyDJG8hRqbIjU3AQHvyBRuRoNFYHQWgmX4lAU" 13 | } 14 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/payment-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8535253563623704", 3 | "resultCode": "Authorised" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/payment_links.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "USD", 4 | "value": 1000 5 | }, 6 | "expiresAt": "2019-12-14T10:05:29Z", 7 | "reference": "Merchant Reference", 8 | "url": "https://checkoutshopper-test.adyen.com" 9 | } 10 | -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/payment_methods.json: -------------------------------------------------------------------------------- 1 | { 2 | "paymentMethods": [ 3 | { 4 | "details": [ 5 | { 6 | "key": "additionalData.card.encrypted.json", 7 | "type": "cardToken" 8 | } 9 | ], 10 | "name": "Credit Card", 11 | "type": "scheme" 12 | }, 13 | { 14 | "details": [ 15 | { 16 | "items": [ 17 | { 18 | "id": "0721", 19 | "name": "ING" 20 | }, 21 | { 22 | "id": "0511", 23 | "name": "Triodos Bank" 24 | }, 25 | { 26 | "id": "0761", 27 | "name": "ASN Bank" 28 | }, 29 | { 30 | "id": "0751", 31 | "name": "SNS Bank" 32 | }, 33 | { 34 | "id": "0771", 35 | "name": "RegioBank" 36 | }, 37 | { 38 | "id": "0031", 39 | "name": "ABN Amro" 40 | }, 41 | { 42 | "id": "0021", 43 | "name": "Rabobank" 44 | }, 45 | { 46 | "id": "0161", 47 | "name": "Van Lanschot Bankiers" 48 | }, 49 | { 50 | "id": "0802", 51 | "name": "bunq" 52 | }, 53 | { 54 | "id": "0801", 55 | "name": "Knab" 56 | } 57 | ], 58 | "key": "idealIssuer", 59 | "type": "select" 60 | } 61 | ], 62 | "name": "iDEAL", 63 | "type": "ideal" 64 | } 65 | ] 66 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/payment_methods_balance.json: -------------------------------------------------------------------------------- 1 | { 2 | "balance": "100" 3 | } 4 | -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/psp_cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "merchantAccount": "TestMerchant", 3 | "paymentPspReference": "string", 4 | "pspReference": "12345", 5 | "reference": "123456789", 6 | "status": "received" 7 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/refund.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "str", 4 | "value": 0 5 | }, 6 | "lineItems": [ 7 | { 8 | "amountExcludingTax": 0, 9 | "amountIncludingTax": 0, 10 | "description": "string", 11 | "id": "string", 12 | "imageUrl": "string", 13 | "itemCategory": "string", 14 | "productUrl": "string", 15 | "quantity": 0, 16 | "taxAmount": 0, 17 | "taxPercentage": 0 18 | } 19 | ], 20 | "merchantAccount": "TestMerchant", 21 | "paymentPspReference": "123456789", 22 | "pspReference": "12345", 23 | "reference": "123456789", 24 | "splits": [ 25 | { 26 | "account": "string", 27 | "amount": { 28 | "currency": "str", 29 | "value": 0 30 | }, 31 | "description": "string", 32 | "reference": "string", 33 | "type": "BalanceAccount" 34 | } 35 | ], 36 | "status": "received" 37 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/sessions-success.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "session-test-id", 3 | "amount": { 4 | "currency": "EUR", 5 | "value": 1000 6 | }, 7 | "reference": "TestReference", 8 | "returnUrl": "http://test-url.com", 9 | "expiresAt": "2021-09-30T06:45:06Z", 10 | "merchantAccount": "YourMerchantAccount" 11 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/stored_payment_methods.json: -------------------------------------------------------------------------------- 1 | {"merchantAccount":"TestMerchantAccount", "shopperReference":"test-1234"} -------------------------------------------------------------------------------- /spec/mocks/responses/Checkout/update-payment-link.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "currency": "USD", 4 | "value": 1000 5 | }, 6 | "id": "MockId", 7 | "merchantAccount": "TestMerchant", 8 | "reference": "Merchant Reference", 9 | "status": "expired", 10 | "url": "https://adyen.com" 11 | } 12 | -------------------------------------------------------------------------------- /spec/mocks/responses/DataProtectionService/request_subject_erasure.json: -------------------------------------------------------------------------------- 1 | { 2 | "result": "SUCCESS" 3 | } 4 | -------------------------------------------------------------------------------- /spec/mocks/responses/DisputesService/retrieve_applicable_defense_reasons.json: -------------------------------------------------------------------------------- 1 | { 2 | "defenseReasons": [ 3 | { 4 | "defenseDocumentTypes": [ 5 | { 6 | "available": false, 7 | "defenseDocumentTypeCode": "TIDorInvoice", 8 | "requirementLevel": "Optional" 9 | }, 10 | { 11 | "available": false, 12 | "defenseDocumentTypeCode": "GoodsNotReturned", 13 | "requirementLevel": "Required" 14 | } 15 | ], 16 | "defenseReasonCode": "GoodsNotReturned", 17 | "satisfied": false 18 | }, 19 | { 20 | "defenseDocumentTypes": [ 21 | { 22 | "available": false, 23 | "defenseDocumentTypeCode": "TIDorInvoice", 24 | "requirementLevel": "Optional" 25 | }, 26 | { 27 | "available": false, 28 | "defenseDocumentTypeCode": "GoodsRepairedOrReplaced", 29 | "requirementLevel": "Required" 30 | } 31 | ], 32 | "defenseReasonCode": "GoodsRepairedOrReplaced", 33 | "satisfied": false 34 | }, 35 | { 36 | "defenseDocumentTypes": [ 37 | { 38 | "available": false, 39 | "defenseDocumentTypeCode": "GoodsWereAsDescribed", 40 | "requirementLevel": "Required" 41 | }, 42 | { 43 | "available": false, 44 | "defenseDocumentTypeCode": "TIDorInvoice", 45 | "requirementLevel": "Required" 46 | } 47 | ], 48 | "defenseReasonCode": "GoodsWereAsDescribed", 49 | "satisfied": false 50 | }, 51 | { 52 | "defenseDocumentTypes": [ 53 | { 54 | "available": false, 55 | "defenseDocumentTypeCode": "TIDorInvoice", 56 | "requirementLevel": "Optional" 57 | }, 58 | { 59 | "available": false, 60 | "defenseDocumentTypeCode": "DefenseMaterial", 61 | "requirementLevel": "Required" 62 | } 63 | ], 64 | "defenseReasonCode": "SupplyDefenseMaterial", 65 | "satisfied": false 66 | } 67 | ], 68 | "disputeServiceResult": { 69 | "success": true 70 | } 71 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Fund/account_holder_balance.json: -------------------------------------------------------------------------------- 1 | { 2 | "totalBalance":{ 3 | "pendingBalance":[ 4 | { 5 | "Amount":{ 6 | "value":42058, 7 | "currency":"EUR" 8 | } 9 | } 10 | ], 11 | "balance":[ 12 | { 13 | "Amount":{ 14 | "currency":"EUR", 15 | "value":99792 16 | } 17 | } 18 | ] 19 | }, 20 | "pspReference":"9914719436100053", 21 | "resultCode":"Success", 22 | "balancePerAccount":[ 23 | { 24 | "AccountDetailBalance":{ 25 | "detailBalance":{ 26 | "pendingBalance":[ 27 | { 28 | "Amount":{ 29 | "value":42058, 30 | "currency":"EUR" 31 | } 32 | } 33 | ], 34 | "balance":[ 35 | { 36 | "Amount":{ 37 | "currency":"EUR", 38 | "value":99792 39 | } 40 | } 41 | ] 42 | }, 43 | "accountCode":"118731451" 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Fund/payout_account_holder.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "9915090894325643", 3 | "submittedAsync": "false", 4 | "bankAccountUUID": "testbankaccount", 5 | "merchantReference": "MerchantReference" 6 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Fund/refund_funds_transfer.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "9915090893984580", 3 | "merchantReference": "MerchantReference", 4 | "resultCode": "Received" 5 | } 6 | -------------------------------------------------------------------------------- /spec/mocks/responses/Fund/refund_not_paid_out_transfers.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "9915090894215323", 3 | "submittedAsync": "false", 4 | "resultCode": "Failed" 5 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Fund/setup_beneficiary.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "9914860354282596", 3 | "submittedAsync": "false", 4 | "resultCode": "Success" 5 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Fund/transfer_funds.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "9915090893984580", 3 | "submittedAsync": "false", 4 | "merchantReference": "MerchantReference", 5 | "resultCode": "Received" 6 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Hop/get_onboarding_url.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8815850625171183", 3 | "resultCode": "Success", 4 | "submittedAsync": "false", 5 | "invalidFields": [], 6 | "redirectUrl": "https://hop-test.adyen.com/hop/view/?token=BQABAQANDBQftSiV8pqlYYFRjIZmBIhE3Ls%2FgdLQ3kcTbflt4FDPves0B9kq7aSZUqKwRciwBEN3PX23ZPqGmYXTb7QklLY5YdEXvUdEgtFnJl9uDWK09texQ3djnTPW6JKrok5svw%2FGZyGHqF1NAbuqPPPLF8o5Jzzri8AqyQKig%2BtMmEibuCuZrIvMbJjcINfDk0OBHir8bNjHgMGFiDBOXdkiww%2FB1VXP2MMqSB1yqcXiKL1o%2B12czdB9wJ5wwsQLGlcuE2Z0%2BZNIQL3MdRomkphpkIWBPFN9YmyGS0Wel6trve6ghBl4q4e1C%2B9BMQKc4P0jrC9FrkBZvhtBYoN%2BfUfrEDbgXpXjXYa1tlfU53XoD%2FsAAA1n2PuQSyfTxEf8qpwAcB9oDN%2BrbpwxYwIk42kCGztAQShTwZzx%2B4VifKpjBdtHA4bSHEqOzGPvpQ6bk4viluLn9Ealv0ylf%2FC3w%2BZCmThg8%2B2EIiABmMK8Jbfijl%2FM%2FqE43F0QN9SveJjwkN5IYGra5QbErUdAPDMfDksPjy%2FY8j%2B2XT1kMwSOLbWTCfhP%2FM%2F68Ll50RuhfJOkgfdP%2BfSxbK9i9uAmEsJ980cABWPpB4MH27asGfZ17mCM3TavaiI9d9Gs3X1HIoEZehFKWEhoaGsEaoSBQ6ut6VnZoOCCBsvssg9aqi1LJKpwwWg4CjS9Ygrw1dnSYjyFO2HeKGXf4TUS7DSCF7tpUJlBen69Xaqbwg%2BHfNfmgcCoZwSgvg%3D%3D" 7 | } -------------------------------------------------------------------------------- /spec/mocks/responses/LegalEntityManagement/create_business_line.json: -------------------------------------------------------------------------------- 1 | { 2 | "industryCode": "4531", 3 | "legalEntityId": "YOUR_LEGAL_ENTITY", 4 | "service": "banking", 5 | "sourceOfFunds": { 6 | "adyenProcessedFunds": false, 7 | "description": "Funds from my flower shop business", 8 | "type": "business" 9 | }, 10 | "webData": [ 11 | { 12 | "webAddress": "https://www.adyen.com", 13 | "webAddressId": "SE322KH223222N5HN4HP54PZC" 14 | } 15 | ], 16 | "id": "SE322KH223222N5HN4HP54PXD" 17 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Management/create_store.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "YOUR_STORE_ID", 3 | "address": { 4 | "country": "US", 5 | "line1": "200 Main Street", 6 | "line2": "Building 5A", 7 | "line3": "Suite 3", 8 | "city": "Springfield", 9 | "stateOrProvince": "NY", 10 | "postalCode": "20250" 11 | }, 12 | "description": "City centre store", 13 | "merchantId": "YOUR_MERCHANT_ACCOUNT_ID", 14 | "shopperStatement": "Springfield Shop", 15 | "phoneNumber": "1813702551707653", 16 | "reference": "Spring_store_2", 17 | "status": "active", 18 | "_links": { 19 | "self": { 20 | "href": "https://management-test.adyen.com/v1/stores/YOUR_STORE_ID" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Management/get_companies.json: -------------------------------------------------------------------------------- 1 | { 2 | "_links": { 3 | "first": { 4 | "href": "https://management-test.adyen.com/v1/companies?pageNumber=1&pageSize=10" 5 | }, 6 | "last": { 7 | "href": "https://management-test.adyen.com/v1/companies?pageNumber=1&pageSize=10" 8 | }, 9 | "self": { 10 | "href": "https://management-test.adyen.com/v1/companies?pageNumber=1&pageSize=10" 11 | } 12 | }, 13 | "itemsTotal": 1, 14 | "pagesTotal": 1, 15 | "data": [ 16 | { 17 | "id": "YOUR_COMPANY_ACCOUNT", 18 | "name": "YOUR_COMPANY_NAME", 19 | "status": "Active", 20 | "dataCenters": [ 21 | { 22 | "name": "default", 23 | "livePrefix": "" 24 | } 25 | ], 26 | "_links": { 27 | "self": { 28 | "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT" 29 | }, 30 | "apiCredentials": { 31 | "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/apiCredentials" 32 | }, 33 | "users": { 34 | "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/users" 35 | }, 36 | "webhooks": { 37 | "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/webhooks" 38 | } 39 | } 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Notification/create_notification_configuration.json: -------------------------------------------------------------------------------- 1 | /* 2 | * ###### 3 | * ###### 4 | * ############ ####( ###### #####. ###### ############ ############ 5 | * ############# #####( ###### #####. ###### ############# ############# 6 | * ###### #####( ###### #####. ###### ##### ###### ##### ###### 7 | * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### 8 | * ###### ###### #####( ###### #####. ###### ##### ##### ###### 9 | * ############# ############# ############# ############# ##### ###### 10 | * ############ ############ ############# ############ ##### ###### 11 | * ###### 12 | * ############# 13 | * ############ 14 | * 15 | * 16 | * Copyright (c) 2017 Adyen B.V. 17 | * This file is open source and available under the MIT license. 18 | * See the LICENSE file for more info. 19 | */ 20 | { 21 | "pspReference": "8515077331535427", 22 | "submittedAsync": "false", 23 | "configurationDetails": { 24 | "active": "true", 25 | "apiVersion": 1, 26 | "description": "TestBas", 27 | "eventConfigs": [ 28 | { 29 | "NotificationEventConfiguration": { 30 | "eventType": "ACCOUNT_HOLDER_STATUS_CHANGE", 31 | "includeMode": "INCLUDE" 32 | } 33 | } 34 | ], 35 | "messageFormat": "SOAP", 36 | "notificationId": 157, 37 | "notifyURL": "https://cal-test.adyen.com/cal/services/ViasNotification/handleGenericEvent", 38 | "sendActionHeader": "true", 39 | "sslProtocol": "SSLInsecureCiphers" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spec/mocks/responses/Notification/delete_notification_configurations.json: -------------------------------------------------------------------------------- 1 | /* 2 | * ###### 3 | * ###### 4 | * ############ ####( ###### #####. ###### ############ ############ 5 | * ############# #####( ###### #####. ###### ############# ############# 6 | * ###### #####( ###### #####. ###### ##### ###### ##### ###### 7 | * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### 8 | * ###### ###### #####( ###### #####. ###### ##### ##### ###### 9 | * ############# ############# ############# ############# ##### ###### 10 | * ############ ############ ############# ############ ##### ###### 11 | * ###### 12 | * ############# 13 | * ############ 14 | * 15 | * 16 | * Copyright (c) 2017 Adyen B.V. 17 | * This file is open source and available under the MIT license. 18 | * See the LICENSE file for more info. 19 | */ 20 | { 21 | "pspReference": "8515078085249090", 22 | "submittedAsync": "false" 23 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Notification/get_notification_configuration.json: -------------------------------------------------------------------------------- 1 | /* 2 | * ###### 3 | * ###### 4 | * ############ ####( ###### #####. ###### ############ ############ 5 | * ############# #####( ###### #####. ###### ############# ############# 6 | * ###### #####( ###### #####. ###### ##### ###### ##### ###### 7 | * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### 8 | * ###### ###### #####( ###### #####. ###### ##### ##### ###### 9 | * ############# ############# ############# ############# ##### ###### 10 | * ############ ############ ############# ############ ##### ###### 11 | * ###### 12 | * ############# 13 | * ############ 14 | * 15 | * 16 | * Copyright (c) 2017 Adyen B.V. 17 | * This file is open source and available under the MIT license. 18 | * See the LICENSE file for more info. 19 | */ 20 | { 21 | "pspReference": "8815078078131377", 22 | "submittedAsync": "false", 23 | "configurationDetails": { 24 | "active": "true", 25 | "apiVersion": 1, 26 | "description": "TestBas", 27 | "eventConfigs": [ 28 | { 29 | "NotificationEventConfiguration": { 30 | "eventType": "ACCOUNT_HOLDER_STATUS_CHANGE", 31 | "includeMode": "INCLUDE" 32 | } 33 | } 34 | ], 35 | "messageFormat": "SOAP", 36 | "notificationId": 157, 37 | "notifyURL": "https://cal-test.adyen.com/cal/services/ViasNotification/handleGenericEvent", 38 | "sendActionHeader": "true", 39 | "sslProtocol": "SSLInsecureCiphers" 40 | } 41 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Notification/update_notification_configuration.json: -------------------------------------------------------------------------------- 1 | /* 2 | * ###### 3 | * ###### 4 | * ############ ####( ###### #####. ###### ############ ############ 5 | * ############# #####( ###### #####. ###### ############# ############# 6 | * ###### #####( ###### #####. ###### ##### ###### ##### ###### 7 | * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### 8 | * ###### ###### #####( ###### #####. ###### ##### ##### ###### 9 | * ############# ############# ############# ############# ##### ###### 10 | * ############ ############ ############# ############ ##### ###### 11 | * ###### 12 | * ############# 13 | * ############ 14 | * 15 | * 16 | * Copyright (c) 2017 Adyen B.V. 17 | * This file is open source and available under the MIT license. 18 | * See the LICENSE file for more info. 19 | */ 20 | { 21 | "pspReference": "8515078084389038", 22 | "submittedAsync": "false", 23 | "configurationDetails": { 24 | "active": "false", 25 | "apiVersion": 1, 26 | "description": "TestUpdate", 27 | "eventConfigs": [ 28 | { 29 | "NotificationEventConfiguration": { 30 | "eventType": "ACCOUNT_CREATED", 31 | "includeMode": "INCLUDE" 32 | } 33 | }, 34 | { 35 | "NotificationEventConfiguration": { 36 | "eventType": "ACCOUNT_HOLDER_CREATED", 37 | "includeMode": "EXCLUDE" 38 | } 39 | } 40 | ], 41 | "messageFormat": "SOAP", 42 | "notificationId": 157, 43 | "notifyURL": "https://cal-test.adyen.com/cal/services/ViasNotification/handleGenericEvent", 44 | "sendActionHeader": "true", 45 | "sslProtocol": "SSLInsecureCiphers" 46 | } 47 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/adjust_authorisation.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8515246816792775", 3 | "response": "[adjustAuthorisation-received]" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/authorise3d.json: -------------------------------------------------------------------------------- 1 | { 2 | "additionalData": { 3 | "fraudResultType": "GREEN", 4 | "fraudManualReview": "false", 5 | "aliasType": "Default", 6 | "alias": "E840075550837688" 7 | }, 8 | "fraudResult": { 9 | "accountScore": 12, 10 | "results": [ 11 | { 12 | "FraudCheckResult": { 13 | "accountScore": 12, 14 | "checkId": -1, 15 | "name": "Pre-Auth-Risk-Total" 16 | } 17 | }, 18 | { 19 | "FraudCheckResult": { 20 | "accountScore": 0, 21 | "checkId": 25, 22 | "name": "CVCAuthResultCheck" 23 | } 24 | } 25 | ] 26 | }, 27 | "pspReference": "8524836146572696", 28 | "resultCode": "Authorised", 29 | "authCode": "90473" 30 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/authorise3ds2.json: -------------------------------------------------------------------------------- 1 | { 2 | "additionalData":{ 3 | "threeds2.threeDS2ResponseData.dsReferenceNumber":"ADYEN-DS-SIMULATOR", 4 | "threeds2.threeDS2ResponseData.transStatus":"C", 5 | "threeds2.threeDS2ResponseData.acsChallengeMandated":"Y", 6 | "threeds2.threeDS2ResponseData.acsURL":"http:\/\/localhost:8080\/threeds2simulator\/services\/ThreeDS2Simulator\/v1\/handle\/eb9c6eb3-57b3-400d-bf2f-4e72bd69dcec", 7 | "threeds2.threeDS2ResponseData.threeDSServerTransID":"c9200190-5ffe-11e8-954f-2677777ae710", 8 | "threeds2.threeDS2ResponseData.authenticationType":"01", 9 | "threeds2.threeDS2ResponseData.dsTransID":"73aab3ce-eb39-49e8-8e9b-46fb77a472f1", 10 | "threeds2.threeDS2ResponseData.messageVersion":"2.1.0", 11 | "threeds2.threeDS2Token":"BQABAQBPCQZ98WKh3v7qGnBlUMGClVzDolIjs8w/8L64WIAqaOGZipbZod7n+E=...", 12 | "threeds2.threeDS2ResponseData.acsTransID":"eb9c6eb3-57b3-400d-bf2f-4e72b779dcec", 13 | "threeds2.threeDS2ResponseData.acsReferenceNumber":"ADYEN-ACS-SIMULATOR" 14 | }, 15 | "pspReference":"9935272408577755", 16 | "resultCode":"ChallengeShopper" 17 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "PSP_REFERENCE", 3 | "response": "[cancel-received]" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/cancel_or_refund.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "PSP_REFERENCE", 3 | "response": "[cancelOrRefund-received]" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/capture.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8524840434233409", 3 | "response": "[capture-received]" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/donate.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "882594132885209C", 3 | "response": "[donation-received]" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/get_authentication_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "threeDS2Result": { 3 | "transStatus": "Y" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/refund.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8524873258461343", 3 | "response": "[refund-received]" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/retrieve_3ds2_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "threeDS2Result": { 3 | "transStatus": "Y" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/technical_cancel.json: -------------------------------------------------------------------------------- 1 | { 2 | "originalReference": "9914694372990637" 3 | } 4 | -------------------------------------------------------------------------------- /spec/mocks/responses/Payment/void_pending_refund.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "9914694372990637" 3 | } 4 | -------------------------------------------------------------------------------- /spec/mocks/responses/Payout/confirm_third_party.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8815260620352855", 3 | "response": "[payout-confirm-received]" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payout/decline_third_party.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8815260621484939", 3 | "response": "[payout-decline-received]" 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payout/payout.json: -------------------------------------------------------------------------------- 1 | { 2 | "resultCode": "Success" 3 | } 4 | -------------------------------------------------------------------------------- /spec/mocks/responses/Payout/store_detail.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8515136787207087", 3 | "recurringDetailReference": "8415088571022720", 4 | "resultCode": "Success" 5 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payout/store_detail_and_submit_third_party.json: -------------------------------------------------------------------------------- 1 | { 2 | "additionalData": { 3 | "fraudResultType": "GREEN", 4 | "fraudManualReview": "false" 5 | }, 6 | "pspReference": "8515131751004933", 7 | "resultCode": "[payout-submit-received]" 8 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Payout/submit_third_party.json: -------------------------------------------------------------------------------- 1 | { 2 | "additionalData": { 3 | "fraudResultType": "GREEN", 4 | "fraudManualReview": "false" 5 | }, 6 | "pspReference": "8815131768219992", 7 | "resultCode": "[payout-submit-received]" 8 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Recurring/create_permit.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8815260599791117", 3 | "permitResultList": [{"yadayada": "yadayada"}] 4 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Recurring/disable.json: -------------------------------------------------------------------------------- 1 | { 2 | "details": [ 3 | { 4 | "RecurringDetail": { 5 | "acquirer": "TestPmmAcquirer", 6 | "acquirerAccount": "TestPmmAcquirerAccount", 7 | "additionalData": { 8 | "cardBin": "411111" 9 | }, 10 | "alias": "ALIAS", 11 | "aliasType": "Default", 12 | "card": { 13 | "expiryMonth": "8", 14 | "expiryYear": "2018", 15 | "holderName": "Holder", 16 | "number": "1111" 17 | }, 18 | "contractTypes": [ 19 | "ONECLICK" 20 | ], 21 | "creationDate": "2017-03-07T09:43:33+01:00", 22 | "firstPspReference": "PSP_REF", 23 | "paymentMethodVariant": "visa", 24 | "recurringDetailReference": "RECURRING_REFERENCE", 25 | "variant": "visa" 26 | } 27 | } 28 | ], 29 | "response": "[detail-successfully-disabled]" 30 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Recurring/list_recurring_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "creationDate": "2017-03-01T11:53:11+01:00", 3 | "details": [ 4 | { 5 | "RecurringDetail": { 6 | "acquirer": "TestPmmAcquirer", 7 | "acquirerAccount": "TestPmmAcquirerAccount", 8 | "additionalData": { 9 | "cardBin": "411111" 10 | }, 11 | "alias": "cardAlias", 12 | "aliasType": "Default", 13 | "card": { 14 | "expiryMonth": "8", 15 | "expiryYear": "2018", 16 | "holderName": "Holder", 17 | "number": "1111" 18 | }, 19 | "contractTypes": [ 20 | "ONECLICK" 21 | ], 22 | "creationDate": "2017-03-07T09:43:33+01:00", 23 | "firstPspReference": "8524888762135795", 24 | "paymentMethodVariant": "visa", 25 | "recurringDetailReference": "recurringReference", 26 | "variant": "visa" 27 | } 28 | }, 29 | { 30 | "RecurringDetail": { 31 | "acquirer": "PayPalSandbox", 32 | "acquirerAccount": "TestPmmAcquirerAccount", 33 | "billingAddress": { 34 | "city": "City", 35 | "country": "NL", 36 | "houseNumberOrName": "1", 37 | "postalCode": "2312aa", 38 | "stateOrProvince": "NA", 39 | "street": "Street" 40 | }, 41 | "contractTypes": [ 42 | "RECURRING" 43 | ], 44 | "creationDate": "2017-10-10T08:50:02+02:00", 45 | "firstPspReference": "8515076181707110", 46 | "paymentMethodVariant": "paypal", 47 | "recurringDetailReference": "8315076181982020", 48 | "tokenDetails": { 49 | "tokenData": { 50 | "EmailId": "tedtest@test.nl", 51 | "PayPal.PayerId": "H95EPL8B2KFE6", 52 | "BillingAgreementId": "B-7MA42752FE774625C" 53 | }, 54 | "tokenDataType": "PayPal" 55 | }, 56 | "variant": "paypal" 57 | } 58 | } 59 | ], 60 | "shopperReference": "test-123", 61 | "invalidOneclickContracts": "false" 62 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Recurring/schedule_account_updater.json: -------------------------------------------------------------------------------- 1 | { 2 | "pspReference": "8815260599791117", 3 | "result": "Success" 4 | } 5 | -------------------------------------------------------------------------------- /spec/mocks/responses/StoredValue/issue_giftcard.json: -------------------------------------------------------------------------------- 1 | { 2 | "currentBalance": { 3 | "currency": "EUR", 4 | "value": 1000 5 | }, 6 | "pspReference": "851564651069192J", 7 | "resultCode": "Success", 8 | "paymentMethod": { 9 | "number": "7219627091701347", 10 | "securityCode": "0140", 11 | "type": "givex" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spec/mocks/responses/Terminal/assign_terminals.json: -------------------------------------------------------------------------------- 1 | { 2 | "results": { 3 | "e285-123456789": "Done" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /spec/mocks/responses/Terminal/find_terminal.json: -------------------------------------------------------------------------------- 1 | { 2 | "companyAccount": "TestCompany", 3 | "merchantAccount": "TestMerchant", 4 | "merchantInventory": false, 5 | "terminal": "e285-123456789" 6 | } 7 | -------------------------------------------------------------------------------- /spec/mocks/responses/Terminal/get_terminals_under_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "companyAccount": "TestCompany", 3 | "merchantAccounts": [ 4 | { 5 | "merchantAccount": "TestMerchant", 6 | "inStoreTerminals": [ 7 | "P400Plus-123456789" 8 | ] 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /spec/mocks/responses/TerminalCloudAPI/connected_terminals.json: -------------------------------------------------------------------------------- 1 | { 2 | "uniqueTerminalIds": [ 3 | "V400m-1234123412" 4 | ] 5 | } -------------------------------------------------------------------------------- /spec/mocks/responses/TerminalCloudAPI/sync_payment.json: -------------------------------------------------------------------------------- 1 | { 2 | "SaleToPOIResponse":{ 3 | "MessageHeader":{}, 4 | "PaymentResponse":{ 5 | "POIData":{ 6 | "POITransactionID":{ 7 | "TransactionID": "oLkO0012498220087000.KHQC5N7G84BLNK43" 8 | } 9 | }, 10 | "Response":{ 11 | "Result":"Success", 12 | "AdditionalResponse":"...shopperEmail=shoppersemail%40address.com..." 13 | } 14 | }, 15 | "PaymentReceipt":{} 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spec/mocks/responses/Transfers/make_transfer.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "1W1UG35U8A9J5ZLG", 3 | "amount": { 4 | "value": 110000, 5 | "currency": "EUR" 6 | }, 7 | "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4", 8 | "category": "bank", 9 | "counterparty": { 10 | "bankAccount": { 11 | "accountHolder": { 12 | "fullName": "A. Klaassen", 13 | "address": { 14 | "city": "San Francisco", 15 | "country": "US", 16 | "postalCode": "94678", 17 | "stateOrProvince": "CA", 18 | "street": "Brannan Street", 19 | "street2": "274" 20 | } 21 | }, 22 | "accountIdentification": { 23 | "type": "numberAndBic", 24 | "accountNumber": "123456789", 25 | "bic": "BOFAUS3NXXX" 26 | } 27 | }, 28 | "priority": "crossBorder", 29 | "referenceForBeneficiary": "Your-reference-sent-to-the-beneficiary", 30 | "reference": "Your internal reference for the transfer", 31 | "description": "Your description for the transfer", 32 | "direction": "outgoing", 33 | "reason": "approved", 34 | "status": "authorised" 35 | } 36 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Webhooks/backslash_webhook.json: -------------------------------------------------------------------------------- 1 | { 2 | "additionalData": { 3 | "acquirerCode": "TestPmmAcquirer", 4 | "acquirerReference": "DZMKWLXW6N6", 5 | "authCode": "076181", 6 | "avsResult": "5 No AVS data provided", 7 | "avsResultRaw": "5", 8 | "cardSummary": "1111", 9 | "checkout.cardAddedBrand": "visa", 10 | "cvcResult": "1 Matches", 11 | "cvcResultRaw": "M", 12 | "expiryDate": "03/2030", 13 | "hmacSignature": "nIgT81gaB5oJpn2jPXupDq68iRo2wUlBsuYjtYfwKqo=", 14 | "paymentMethod": "visa", 15 | "refusalReasonRaw": "AUTHORISED", 16 | "retry.attempt1.acquirer": "TestPmmAcquirer", 17 | "retry.attempt1.acquirerAccount": "TestPmmAcquirerAccount", 18 | "retry.attempt1.avsResultRaw": "5", 19 | "retry.attempt1.rawResponse": "AUTHORISED", 20 | "retry.attempt1.responseCode": "Approved", 21 | "retry.attempt1.scaExemptionRequested": "lowValue", 22 | "scaExemptionRequested": "lowValue" 23 | }, 24 | "amount": { 25 | "currency": "EUR", 26 | "value": 1000 27 | }, 28 | "eventCode": "AUTHORISATION", 29 | "eventDate": "2023-01-09T16:27:29+01:00", 30 | "merchantAccountCode": "AntoniStroinski", 31 | "merchantReference": "\\\\slashes are fun", 32 | "operations": [ 33 | "CANCEL", 34 | "CAPTURE", 35 | "REFUND" 36 | ], 37 | "paymentMethod": "visa", 38 | "pspReference": "T7FD4VM4D3RZNN82", 39 | "reason": "076181:1111:03/2030", 40 | "success": "true" 41 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Webhooks/colon_webhook.json: -------------------------------------------------------------------------------- 1 | { 2 | "additionalData": { 3 | "acquirerCode": "TestPmmAcquirer", 4 | "acquirerReference": "8NQH5BNF58M", 5 | "authCode": "039404", 6 | "avsResult": "5 No AVS data provided", 7 | "avsResultRaw": "5", 8 | "cardSummary": "1111", 9 | "checkout.cardAddedBrand": "visa", 10 | "cvcResult": "1 Matches", 11 | "cvcResultRaw": "M", 12 | "expiryDate": "03/2030", 13 | "hmacSignature": "2EQYm7YJpKO4EtHSPu55SQTyWf8dkW5u2nD1tJFpViA=", 14 | "paymentMethod": "visa", 15 | "refusalReasonRaw": "AUTHORISED", 16 | "retry.attempt1.acquirer": "TestPmmAcquirer", 17 | "retry.attempt1.acquirerAccount": "TestPmmAcquirerAccount", 18 | "retry.attempt1.avsResultRaw": "5", 19 | "retry.attempt1.rawResponse": "AUTHORISED", 20 | "retry.attempt1.responseCode": "Approved", 21 | "retry.attempt1.scaExemptionRequested": "lowValue", 22 | "scaExemptionRequested": "lowValue" 23 | }, 24 | "amount": { 25 | "currency": "EUR", 26 | "value": 1000 27 | }, 28 | "eventCode": "AUTHORISATION", 29 | "eventDate": "2023-01-10T13:40:54+01:00", 30 | "merchantAccountCode": "AntoniStroinski", 31 | "merchantReference": ":slashes are fun", 32 | "operations": [ 33 | "CANCEL", 34 | "CAPTURE", 35 | "REFUND" 36 | ], 37 | "paymentMethod": "visa", 38 | "pspReference": "M8NB66SBZSGLNK82", 39 | "reason": "039404:1111:03/2030", 40 | "success": "true" 41 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Webhooks/forwardslash_webhook.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": { 3 | "value": 1000, 4 | "currency": "EUR" 5 | }, 6 | "reason": "087330:1111:03/2030", 7 | "success": "true", 8 | "eventCode": "AUTHORISATION", 9 | "eventDate": "2023-01-10T13:37:30+01:00", 10 | "operations": [ 11 | "CANCEL", 12 | "CAPTURE", 13 | "REFUND" 14 | ], 15 | "pspReference": "X3GWNS6KJ8NKGK82", 16 | "paymentMethod": "visa", 17 | "additionalData": { 18 | "authCode": "087330", 19 | "avsResult": "5 No AVS data provided", 20 | "cvcResult": "1 Matches", 21 | "expiryDate": "03/2030", 22 | "cardSummary": "1111", 23 | "acquirerCode": "TestPmmAcquirer", 24 | "avsResultRaw": "5", 25 | "cvcResultRaw": "M", 26 | "hmacSignature": "9Z0xdpG9Xi3zcmXv14t/BvMBut77O/Xq9D4CQXSDUi4=", 27 | "paymentMethod": "visa", 28 | "refusalReasonRaw": "AUTHORISED", 29 | "acquirerReference": "HHCCC326PH6", 30 | "scaExemptionRequested": "lowValue", 31 | "checkout.cardAddedBrand": "visa", 32 | "retry.attempt1.acquirer": "TestPmmAcquirer", 33 | "retry.attempt1.rawResponse": "AUTHORISED", 34 | "retry.attempt1.avsResultRaw": "5", 35 | "retry.attempt1.responseCode": "Approved", 36 | "retry.attempt1.acquirerAccount": "TestPmmAcquirerAccount", 37 | "retry.attempt1.scaExemptionRequested": "lowValue" 38 | }, 39 | "merchantReference": "//slashes are fun", 40 | "merchantAccountCode": "AntoniStroinski" 41 | } -------------------------------------------------------------------------------- /spec/mocks/responses/Webhooks/mixed_webhook.json: -------------------------------------------------------------------------------- 1 | { 2 | "additionalData": { 3 | "acquirerCode": "TestPmmAcquirer", 4 | "acquirerReference": "J8DXDJ2PV6P", 5 | "authCode": "052095", 6 | "avsResult": "5 No AVS data provided", 7 | "avsResultRaw": "5", 8 | "cardSummary": "1111", 9 | "checkout.cardAddedBrand": "visa", 10 | "cvcResult": "1 Matches", 11 | "cvcResultRaw": "M", 12 | "expiryDate": "03/2030", 13 | "hmacSignature": "CZErGCNQaSsxbaQfZaJlakqo7KPP+mIa8a+wx3yNs9A=", 14 | "paymentMethod": "visa", 15 | "refusalReasonRaw": "AUTHORISED", 16 | "retry.attempt1.acquirer": "TestPmmAcquirer", 17 | "retry.attempt1.acquirerAccount": "TestPmmAcquirerAccount", 18 | "retry.attempt1.avsResultRaw": "5", 19 | "retry.attempt1.rawResponse": "AUTHORISED", 20 | "retry.attempt1.responseCode": "Approved", 21 | "retry.attempt1.scaExemptionRequested": "lowValue", 22 | "scaExemptionRequested": "lowValue" 23 | }, 24 | "amount": { 25 | "currency": "EUR", 26 | "value": 1000 27 | }, 28 | "eventCode": "AUTHORISATION", 29 | "eventDate": "2023-01-10T13:42:29+01:00", 30 | "merchantAccountCode": "AntoniStroinski", 31 | "merchantReference": "\\:/\\/slashes are fun", 32 | "operations": [ 33 | "CANCEL", 34 | "CAPTURE", 35 | "REFUND" 36 | ], 37 | "paymentMethod": "visa", 38 | "pspReference": "ZVWN7D3WSMK2WN82", 39 | "reason": "052095:1111:03/2030", 40 | "success": "true" 41 | } -------------------------------------------------------------------------------- /spec/notification_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | RSpec.describe Adyen::Payment, service: 'marketpay fund service' do 4 | # client instance to be used in dynamically generated tests 5 | client = create_client(:basic) 6 | 7 | # methods / values to test for 8 | # format is defined in spec_helper 9 | test_sets = [ 10 | %w[create_notification_configuration pspReference 8515077331535427], 11 | %w[delete_notification_configurations pspReference 8515078085249090], 12 | %w[get_notification_configuration pspReference 8815078078131377], 13 | %w[get_notification_configuration_list pspReference 8515078078661665], 14 | %w[test_notification_configuration pspReference 8515078087759211], 15 | %w[update_notification_configuration pspReference 8515078084389038] 16 | ] 17 | 18 | generate_tests(client, 'Notification', test_sets, client.marketpay.notification) 19 | end 20 | -------------------------------------------------------------------------------- /spec/payments_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'json' 3 | 4 | RSpec.describe Adyen::Payment, service: 'Payment' do 5 | before(:all) do 6 | @shared_values = { 7 | client: create_client(:api_key), 8 | service: 'Payment' 9 | } 10 | end 11 | 12 | # must be created manually because every field in the response is an array 13 | it 'makes an adjust_authorisation POST call' do 14 | request_body = JSON.parse(json_from_file('mocks/requests/Payment/adjust_authorisation.json')) 15 | 16 | response_body = json_from_file('mocks/responses/Payment/adjust_authorisation.json') 17 | 18 | url = @shared_values[:client].service_url(@shared_values[:service], 'adjustAuthorisation', 19 | @shared_values[:client].payment.version) 20 | WebMock.stub_request(:post, url) 21 | .with( 22 | body: request_body, 23 | headers: { 24 | 'x-api-key' => @shared_values[:client].api_key 25 | } 26 | ) 27 | .to_return( 28 | body: response_body 29 | ) 30 | 31 | result = @shared_values[:client].payment.adjust_authorisation(request_body) 32 | response_hash = result.response 33 | 34 | expect(result.status) 35 | .to eq(200) 36 | expect(response_hash) 37 | .to eq(JSON.parse(response_body)) 38 | expect(response_hash) 39 | .to be_a Adyen::HashWithAccessors 40 | expect(response_hash) 41 | .to be_a_kind_of Hash 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /spec/payouts_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'json' 3 | 4 | RSpec.describe Adyen::Payout, service: 'Payout' do 5 | before(:all) do 6 | @shared_values = { 7 | client: create_client(:api_key), 8 | service: 'Payout' 9 | } 10 | end 11 | 12 | # must be created manually because every field in the response is an array 13 | it 'makes a business_lines POST call' do 14 | request_body = JSON.parse(json_from_file('mocks/requests/Payout/confirm_third_party.json')) 15 | 16 | response_body = json_from_file('mocks/responses/Payout/confirm_third_party.json') 17 | 18 | url = @shared_values[:client].service_url(@shared_values[:service], 'confirmThirdParty', 19 | @shared_values[:client].payout.version) 20 | WebMock.stub_request(:post, url) 21 | .with( 22 | body: request_body, 23 | headers: { 24 | 'x-api-key' => @shared_values[:client].api_key 25 | } 26 | ) 27 | .to_return( 28 | body: response_body 29 | ) 30 | 31 | result = @shared_values[:client].payout.reviewing_api.confirm_third_party(request_body) 32 | response_hash = result.response 33 | 34 | expect(result.status) 35 | .to eq(200) 36 | expect(response_hash) 37 | .to eq(JSON.parse(response_body)) 38 | expect(response_hash) 39 | .to be_a Adyen::HashWithAccessors 40 | expect(response_hash) 41 | .to be_a_kind_of Hash 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /spec/pos_terminal_management_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'json' 3 | 4 | RSpec.describe Adyen::PosTerminalManagement, service: 'PosTerminalManagement' do 5 | before(:all) do 6 | @shared_values = { 7 | client: create_client(:api_key), 8 | service: 'LegalEntityManagement' 9 | } 10 | end 11 | 12 | # must be created manually because every field in the response is an array 13 | it 'makes a assign_terminals POST call' do 14 | request_body = JSON.parse(json_from_file('mocks/requests/Terminal/assign_terminals.json')) 15 | 16 | response_body = json_from_file('mocks/responses/Terminal/assign_terminals.json') 17 | 18 | url = @shared_values[:client].service_url(@shared_values[:service], 'assignTerminals', 19 | @shared_values[:client].pos_terminal_management.version) 20 | WebMock.stub_request(:post, url) 21 | .with( 22 | body: request_body, 23 | headers: { 24 | 'x-api-key' => @shared_values[:client].api_key 25 | } 26 | ) 27 | .to_return( 28 | body: response_body 29 | ) 30 | 31 | result = @shared_values[:client].pos_terminal_management.assign_terminals(request_body) 32 | response_hash = result.response 33 | 34 | expect(result.status) 35 | .to eq(200) 36 | expect(response_hash) 37 | .to eq(JSON.parse(response_body)) 38 | expect(response_hash) 39 | .to be_a Adyen::HashWithAccessors 40 | expect(response_hash) 41 | .to be_a_kind_of Hash 42 | end 43 | end 44 | # rubocop:enable Metrics/BlockLength 45 | -------------------------------------------------------------------------------- /spec/recurring_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require_relative '../lib/adyen/errors' 3 | 4 | RSpec.describe Adyen::Payment, service: 'recurring service' do 5 | # client instance to be used in dynamically generated tests 6 | client = create_client(:basic) 7 | 8 | # methods / values to test for 9 | # format is defined in spec_helper 10 | test_sets = [ 11 | ['list_recurring_details', 'creationDate', '2017-03-01T11:53:11+01:00'], 12 | ['disable', 'response', '[detail-successfully-disabled]'], 13 | ['create_permit', 'pspReference', '8815260599791117'], 14 | ['schedule_account_updater', 'result', 'Success'] 15 | ] 16 | 17 | generate_tests(client, 'Recurring', test_sets, client.recurring) 18 | end 19 | -------------------------------------------------------------------------------- /spec/stored_value_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'json' 3 | 4 | RSpec.describe Adyen::BalancePlatform, service: 'balancePlatform' do 5 | before(:all) do 6 | @shared_values = { 7 | client: create_client(:api_key), 8 | service: 'BalancePlatform' 9 | } 10 | end 11 | 12 | # must be created manually because every field in the response is an array 13 | it 'makes a issue POST call' do 14 | request_body = JSON.parse(json_from_file('mocks/requests/StoredValue/issue_giftcard.json')) 15 | 16 | response_body = json_from_file('mocks/responses/StoredValue/issue_giftcard.json') 17 | 18 | url = @shared_values[:client].service_url(@shared_values[:service], 'issue', 19 | @shared_values[:client].stored_value.version) 20 | WebMock.stub_request(:post, url) 21 | .with( 22 | body: request_body, 23 | headers: { 24 | 'x-api-key' => @shared_values[:client].api_key 25 | } 26 | ) 27 | .to_return( 28 | body: response_body 29 | ) 30 | 31 | result = @shared_values[:client].stored_value.issue(request_body) 32 | response_hash = result.response 33 | 34 | expect(result.status) 35 | .to eq(200) 36 | expect(response_hash) 37 | .to eq(JSON.parse(response_body)) 38 | expect(response_hash) 39 | .to be_a Adyen::HashWithAccessors 40 | expect(response_hash) 41 | .to be_a_kind_of Hash 42 | end 43 | end 44 | # rubocop:enable Metrics/BlockLength 45 | -------------------------------------------------------------------------------- /spec/transfers_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'json' 3 | 4 | RSpec.describe Adyen::Transfers, service: 'transfers' do 5 | before(:all) do 6 | @shared_values = { 7 | client: create_client(:api_key), 8 | service: 'Transfers' 9 | } 10 | end 11 | 12 | it 'makes a transfers POST call' do 13 | request_body = JSON.parse(json_from_file('mocks/requests/Transfers/make_transfer.json')) 14 | 15 | response_body = json_from_file('mocks/responses/Transfers/make_transfer.json') 16 | 17 | url = @shared_values[:client].service_url(@shared_values[:service], 'transfers', 18 | @shared_values[:client].transfers.version) 19 | WebMock.stub_request(:post, url) 20 | .with( 21 | body: request_body, 22 | headers: { 23 | 'x-api-key' => @shared_values[:client].api_key 24 | } 25 | ) 26 | .to_return( 27 | body: response_body 28 | ) 29 | 30 | result = @shared_values[:client].transfers.transfers_api.transfer_funds(request_body) 31 | 32 | expect(result.status) 33 | .to eq(200) 34 | end 35 | 36 | it 'makes a transactions GET call' do 37 | response_body = json_from_file('mocks/responses/Transfers/make_transfer.json') 38 | 39 | url = @shared_values[:client].service_url( 40 | @shared_values[:service], 41 | 'transactions?createdUntil=2021-05-30T15%3A07%3A40Z&createdSince=2021-05-30T15%3A07%3A40Z', 42 | @shared_values[:client].transfers.version 43 | ) 44 | WebMock.stub_request(:get, url) 45 | .with( 46 | headers: { 47 | 'x-api-key' => @shared_values[:client].api_key 48 | } 49 | ) 50 | .to_return( 51 | body: response_body 52 | ) 53 | 54 | result = @shared_values[:client].transfers.transactions_api.get_all_transactions( 55 | query_params: { 56 | 'createdUntil' => '2021-05-30T15:07:40Z', 'createdSince' => '2021-05-30T15:07:40Z' 57 | } 58 | ) 59 | 60 | expect(result.status) 61 | .to eq(200) 62 | end 63 | end 64 | # rubocop:enable Metrics/BlockLength 65 | -------------------------------------------------------------------------------- /templates/api-single.mustache: -------------------------------------------------------------------------------- 1 | {{#apiInfo}} 2 | {{#apis}} 3 | require_relative '{{serviceName}}/{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}' 4 | {{/apis}} 5 | {{/apiInfo}} 6 | 7 | module Adyen 8 | 9 | # NOTE: This class is auto generated by OpenAPI Generator 10 | # Ref: https://openapi-generator.tech 11 | # 12 | # Do not edit the class manually. 13 | class {{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}} 14 | attr_accessor :service, :version 15 | 16 | DEFAULT_VERSION = {{version}} 17 | def initialize(client, version = DEFAULT_VERSION) 18 | @service = '{{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}' 19 | @client = client 20 | @version = version 21 | end 22 | 23 | {{#apiInfo}} 24 | {{#apis}} 25 | def {{classFilename}} 26 | @{{classFilename}} ||= Adyen::{{classname}}.new(@client, @version) 27 | end 28 | 29 | {{/apis}} 30 | {{/apiInfo}} 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /templates/api-small.mustache: -------------------------------------------------------------------------------- 1 | require_relative './service' 2 | module Adyen 3 | {{#operations}} 4 | 5 | # NOTE: This class is auto generated by OpenAPI Generator 6 | # Ref: https://openapi-generator.tech 7 | # 8 | # Do not edit the class manually. 9 | class {{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}} < Service 10 | attr_accessor :service, :version 11 | 12 | DEFAULT_VERSION = {{version}} 13 | def initialize(client, version = DEFAULT_VERSION) 14 | super(client, version, '{{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}') 15 | end 16 | 17 | {{#operation}} 18 | # {{{summary}}}{{^summary}}{{operationId}}{{/summary}}{{#isDeprecated}} 19 | # 20 | # Deprecated {{#vendorExtensions.x-deprecatedInVersion}}since {{#appName}}{{{.}}}{{/appName}} v{{.}}{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} 21 | # {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}{{/isDeprecated}} 22 | def {{#lambda.snakecase}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{nickname}}{{/vendorExtensions.x-methodName}}{{/lambda.snakecase}}({{#bodyParams}}request, {{/bodyParams}}{{#requiredParams}}{{^isQueryParam}}{{#lambda.snakecase}}{{paramName}}{{/lambda.snakecase}}, {{/isQueryParam}}{{/requiredParams}}headers: {}{{#queryParams}}{{#-first}}, query_params: {}{{/-first}}{{/queryParams}}) 23 | endpoint = '{{path}}'.gsub(/{.+?}/, '%s') 24 | endpoint = endpoint.gsub(%r{^/}, '') 25 | endpoint = format(endpoint{{#pathParams}}{{#lambda.snakecase}}, {{paramName}}{{/lambda.snakecase}}{{/pathParams}}) 26 | {{#queryParams}}{{#-first}}endpoint += create_query_string(query_params){{/-first}}{{/queryParams}} 27 | action = { method: '{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}', url: endpoint } 28 | {{#bodyParams}} 29 | @client.call_adyen_api(@service, action, request, headers, @version) 30 | {{/bodyParams}} 31 | {{^bodyParams}} 32 | @client.call_adyen_api(@service, action, {}, headers, @version) 33 | {{/bodyParams}} 34 | end 35 | 36 | {{/operation}} 37 | {{/operations}} 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /templates/api.mustache: -------------------------------------------------------------------------------- 1 | require_relative '../service' 2 | module Adyen 3 | {{#operations}} 4 | 5 | # NOTE: This class is auto generated by OpenAPI Generator 6 | # Ref: https://openapi-generator.tech 7 | # 8 | # Do not edit the class manually. 9 | class {{classname}} < Service 10 | attr_accessor :service, :version 11 | 12 | def initialize(client, version = DEFAULT_VERSION) 13 | super(client, version, '{{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}') 14 | end 15 | 16 | {{#operation}} 17 | # {{{summary}}}{{^summary}}{{operationId}}{{/summary}}{{#isDeprecated}} 18 | # 19 | # Deprecated {{#vendorExtensions.x-deprecatedInVersion}}since {{#appName}}{{{.}}}{{/appName}} v{{.}}{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} 20 | # {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}{{/isDeprecated}} 21 | def {{#lambda.snakecase}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{nickname}}{{/vendorExtensions.x-methodName}}{{/lambda.snakecase}}({{#bodyParams}}request, {{/bodyParams}}{{#requiredParams}}{{^isQueryParam}}{{#lambda.snakecase}}{{paramName}}{{/lambda.snakecase}}, {{/isQueryParam}}{{/requiredParams}}headers: {}{{#queryParams}}{{#-first}}, query_params: {}{{/-first}}{{/queryParams}}) 22 | endpoint = '{{path}}'.gsub(/{.+?}/, '%s') 23 | endpoint = endpoint.gsub(%r{^/}, '') 24 | endpoint = format(endpoint{{#pathParams}}, {{#lambda.snakecase}}{{paramName}}{{/lambda.snakecase}}{{/pathParams}}) 25 | {{#queryParams}}{{#-first}}endpoint += create_query_string(query_params){{/-first}}{{/queryParams}} 26 | action = { method: '{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}', url: endpoint } 27 | {{#bodyParams}} 28 | @client.call_adyen_api(@service, action, request, headers, @version) 29 | {{/bodyParams}} 30 | {{^bodyParams}} 31 | @client.call_adyen_api(@service, action, {}, headers, @version) 32 | {{/bodyParams}} 33 | end 34 | 35 | {{/operation}} 36 | {{/operations}} 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /templates/config.yaml: -------------------------------------------------------------------------------- 1 | templateDir: ./templates 2 | files: 3 | api-single.mustache: 4 | folder: api 5 | destinationFilename: api-single.rb 6 | templateType: SupportingFiles 7 | api-small.mustache: 8 | folder: api_small 9 | destinationFilename: -small.rb 10 | templateType: API --------------------------------------------------------------------------------