adyen-ruby-api-library 11.2.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -1
- data/.github/workflows/codeql.yml +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/ruby.yml +3 -3
- data/.github/workflows/rubygems_release.yml +1 -1
- data/.github/workflows/stale.yml +1 -1
- data/Gemfile +2 -2
- data/README.md +30 -7
- data/VERSION +1 -1
- data/adyen-ruby-api-library.gemspec +1 -1
- data/lib/adyen/client.rb +10 -16
- data/lib/adyen/deprecation.rb +34 -0
- data/lib/adyen/services/balanceControl/balance_control_api.rb +3 -3
- data/lib/adyen/services/balancePlatform/account_holders_api.rb +14 -18
- data/lib/adyen/services/balancePlatform/authorized_card_users_api.rb +4 -12
- data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +5 -65
- data/lib/adyen/services/balancePlatform/balances_api.rb +5 -15
- data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +1 -3
- data/lib/adyen/services/balancePlatform/card_orders_api.rb +2 -6
- data/lib/adyen/services/balancePlatform/custom_payout_schedules_sweeps_api.rb +56 -0
- data/lib/adyen/services/balancePlatform/direct_debit_mandates_api.rb +48 -0
- data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +3 -3
- data/lib/adyen/services/balancePlatform/grant_offers_api.rb +6 -6
- data/lib/adyen/services/balancePlatform/manage_card_pin_api.rb +3 -9
- data/lib/adyen/services/balancePlatform/manage_sca_devices_api.rb +6 -18
- data/lib/adyen/services/balancePlatform/managed_payout_schedules_api.rb +80 -0
- data/lib/adyen/services/balancePlatform/network_tokens_api.rb +2 -6
- data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +3 -9
- data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +9 -27
- data/lib/adyen/services/balancePlatform/platform_api.rb +3 -9
- data/lib/adyen/services/balancePlatform/recurring_top_ups_api.rb +48 -0
- data/lib/adyen/services/balancePlatform/sca_association_management_api.rb +3 -9
- data/lib/adyen/services/balancePlatform/sca_device_management_api.rb +11 -9
- data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +4 -12
- data/lib/adyen/services/balancePlatform/transfer_limits_balance_account_level_api.rb +6 -18
- data/lib/adyen/services/balancePlatform/transfer_limits_balance_platform_level_api.rb +4 -12
- data/lib/adyen/services/balancePlatform/transfer_routes_api.rb +1 -3
- data/lib/adyen/services/balancePlatform.rb +20 -0
- data/lib/adyen/services/binLookup/bin_lookup_api.rb +2 -6
- data/lib/adyen/services/capital/dynamic_offers_api.rb +40 -0
- data/lib/adyen/services/capital/grant_accounts_api.rb +1 -3
- data/lib/adyen/services/capital/grant_offers_api.rb +4 -8
- data/lib/adyen/services/capital/grants_api.rb +6 -18
- data/lib/adyen/services/capital.rb +5 -0
- data/lib/adyen/services/checkout/donations_api.rb +2 -6
- data/lib/adyen/services/checkout/modifications_api.rb +6 -18
- data/lib/adyen/services/checkout/orders_api.rb +3 -9
- data/lib/adyen/services/checkout/payment_links_api.rb +3 -9
- data/lib/adyen/services/checkout/payments_api.rb +14 -18
- data/lib/adyen/services/checkout/recurring_api.rb +4 -12
- data/lib/adyen/services/checkout/utility_api.rb +6 -12
- data/lib/adyen/services/checkout.rb +1 -1
- data/lib/adyen/services/dataProtection/data_protection_api.rb +1 -3
- data/lib/adyen/services/disputes/disputes_api.rb +5 -15
- data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +4 -12
- data/lib/adyen/services/legalEntityManagement/documents_api.rb +4 -12
- data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +3 -9
- data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +7 -21
- data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +5 -15
- data/lib/adyen/services/legalEntityManagement/tax_e_delivery_consent_api.rb +2 -6
- data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +5 -15
- data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +4 -12
- data/lib/adyen/services/management/account_company_level_api.rb +3 -9
- data/lib/adyen/services/management/account_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/account_store_level_api.rb +8 -24
- data/lib/adyen/services/management/allowed_origins_company_level_api.rb +4 -12
- data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/android_files_company_level_api.rb +6 -18
- data/lib/adyen/services/management/api_credentials_company_level_api.rb +4 -12
- data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/api_key_company_level_api.rb +1 -3
- data/lib/adyen/services/management/api_key_merchant_level_api.rb +1 -3
- data/lib/adyen/services/management/client_key_company_level_api.rb +1 -3
- data/lib/adyen/services/management/client_key_merchant_level_api.rb +1 -3
- data/lib/adyen/services/management/donation_campaigns_api.rb +64 -0
- data/lib/adyen/services/management/my_api_credential_api.rb +6 -18
- data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +6 -18
- data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +5 -15
- data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +9 -27
- data/lib/adyen/services/management/terminal_actions_company_level_api.rb +2 -6
- data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +1 -3
- data/lib/adyen/services/management/terminal_orders_company_level_api.rb +10 -30
- data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +10 -30
- data/lib/adyen/services/management/terminal_settings_company_level_api.rb +4 -12
- data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/terminal_settings_store_level_api.rb +8 -24
- data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +4 -12
- data/lib/adyen/services/management/terminals_terminal_level_api.rb +2 -6
- data/lib/adyen/services/management/users_company_level_api.rb +4 -12
- data/lib/adyen/services/management/users_merchant_level_api.rb +4 -12
- data/lib/adyen/services/management/webhooks_company_level_api.rb +7 -21
- data/lib/adyen/services/management/webhooks_merchant_level_api.rb +7 -21
- data/lib/adyen/services/management.rb +5 -0
- data/lib/adyen/services/payment/modifications_api.rb +10 -24
- data/lib/adyen/services/payment/payments_api.rb +5 -15
- data/lib/adyen/services/paymentsApp/payments_app_api.rb +5 -15
- data/lib/adyen/services/payout/initialization_api.rb +3 -9
- data/lib/adyen/services/payout/instant_payouts_api.rb +1 -3
- data/lib/adyen/services/payout/reviewing_api.rb +2 -6
- data/lib/adyen/services/posMobile/pos_mobile_api.rb +6 -3
- data/lib/adyen/services/posTerminalManagement.rb +10 -0
- data/lib/adyen/services/recurring/recurring_api.rb +10 -18
- data/lib/adyen/services/service.rb +12 -2
- data/lib/adyen/services/sessionAuthentication/session_authentication_api.rb +1 -3
- data/lib/adyen/services/storedValue/stored_value_api.rb +6 -18
- data/lib/adyen/services/transfers/capital_api.rb +9 -9
- data/lib/adyen/services/transfers/cash_out_api.rb +24 -0
- data/lib/adyen/services/transfers/transactions_api.rb +2 -6
- data/lib/adyen/services/transfers/transfers_api.rb +6 -18
- data/lib/adyen/services/transfers.rb +5 -0
- data/lib/adyen/utils/hmac_validator.rb +15 -18
- data/lib/adyen/version.rb +1 -1
- data/sdk-generation-log/balancecontrol.json +8 -0
- data/sdk-generation-log/balanceplatform.json +8 -0
- data/sdk-generation-log/binlookup.json +8 -0
- data/sdk-generation-log/capital.json +8 -0
- data/sdk-generation-log/checkout.json +8 -0
- data/sdk-generation-log/dataprotection.json +8 -0
- data/sdk-generation-log/disputes.json +8 -0
- data/sdk-generation-log/legalentitymanagement.json +8 -0
- data/sdk-generation-log/management.json +8 -0
- data/sdk-generation-log/payment.json +8 -0
- data/sdk-generation-log/paymentsapp.json +8 -0
- data/sdk-generation-log/payout.json +8 -0
- data/sdk-generation-log/posmobile.json +8 -0
- data/sdk-generation-log/recurring.json +8 -0
- data/sdk-generation-log/sessionauthentication.json +8 -0
- data/sdk-generation-log/storedvalue.json +8 -0
- data/sdk-generation-log/transfers.json +8 -0
- data/spec/balance_control_spec.rb +41 -0
- data/spec/balance_platform_spec.rb +609 -4
- data/spec/capital_spec.rb +82 -0
- data/spec/checkout-oauth_spec.rb +220 -10
- data/spec/checkout_spec.rb +245 -10
- data/spec/client_spec.rb +23 -5
- data/spec/deprecation_spec.rb +112 -0
- data/spec/management_spec.rb +184 -0
- data/spec/mocks/requests/BalancePlatform/apply_managed_schedule.json +14 -0
- data/spec/mocks/requests/BalancePlatform/begin_sca_device_registration.json +4 -0
- data/spec/mocks/requests/BalancePlatform/create_recurring_top_up.json +21 -0
- data/spec/mocks/requests/BalancePlatform/create_sweep.json +10 -0
- data/spec/mocks/requests/BalancePlatform/finish_sca_device_registration.json +3 -0
- data/spec/mocks/requests/BalancePlatform/submit_sca_association.json +8 -0
- data/spec/mocks/requests/BalancePlatform/update_balance_account_managed_schedule.json +5 -0
- data/spec/mocks/requests/BalancePlatform/update_mandate.json +14 -0
- data/spec/mocks/requests/BalancePlatform/update_recurring_top_ups.json +3 -0
- data/spec/mocks/requests/BalancePlatform/update_sweep.json +6 -0
- data/spec/mocks/requests/Checkout/amount_updates.json +1 -1
- data/spec/mocks/requests/Checkout/card_details.json +3 -0
- data/spec/mocks/requests/Checkout/create_stored_payment_method.json +10 -0
- data/spec/mocks/requests/Checkout/donation_campaigns.json +4 -0
- data/spec/mocks/requests/Checkout/donations.json +9 -0
- data/spec/mocks/requests/Checkout/orders.json +5 -3
- data/spec/mocks/requests/Checkout/payment-details.json +2 -14
- data/spec/mocks/requests/Checkout/payment_methods_balance.json +5 -2
- data/spec/mocks/requests/Checkout/payments.json +9 -10
- data/spec/mocks/requests/Checkout/paypal_update_order.json +5 -0
- data/spec/mocks/requests/Checkout/reversals.json +3 -0
- data/spec/mocks/requests/Checkout/update_session.json +7 -0
- data/spec/mocks/requests/Management/create_donation_campaign.json +7 -0
- data/spec/mocks/requests/Management/list_nonprofits.json +5 -0
- data/spec/mocks/requests/Management/update_donation_campaign.json +6 -0
- data/spec/mocks/requests/Transfers/initiate_cashout.json +12 -0
- data/spec/mocks/responses/BalancePlatform/apply_managed_schedule.json +17 -0
- data/spec/mocks/responses/BalancePlatform/begin_sca_device_registration.json +8 -0
- data/spec/mocks/responses/BalancePlatform/create_recurring_top_up.json +23 -0
- data/spec/mocks/responses/BalancePlatform/create_sweep.json +12 -0
- data/spec/mocks/responses/BalancePlatform/finish_sca_device_registration.json +7 -0
- data/spec/mocks/responses/BalancePlatform/get_all_sweeps_for_balance_account.json +31 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedule_by_id.json +17 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedules.json +26 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedule_by_id.json +27 -0
- data/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedules.json +31 -0
- data/spec/mocks/responses/BalancePlatform/get_list_of_mandates.json +19 -0
- data/spec/mocks/responses/BalancePlatform/get_mandate_by_id.json +14 -0
- data/spec/mocks/responses/BalancePlatform/get_payout_schedule_executions.json +21 -0
- data/spec/mocks/responses/BalancePlatform/get_recurring_top_ups.json +35 -0
- data/spec/mocks/responses/BalancePlatform/get_sweep.json +12 -0
- data/spec/mocks/responses/BalancePlatform/get_tax_form_summary.json +17 -0
- data/spec/mocks/responses/BalancePlatform/submit_sca_association.json +10 -0
- data/spec/mocks/responses/BalancePlatform/update_balance_account_managed_schedule.json +18 -0
- data/spec/mocks/responses/BalancePlatform/update_recurring_top_ups.json +23 -0
- data/spec/mocks/responses/BalancePlatform/update_sweep.json +12 -0
- data/spec/mocks/responses/Capital/calculate-preliminary-offer-from-dynamic-offer.json +16 -0
- data/spec/mocks/responses/Capital/create-static-offer-from-dynamic-offer.json +9 -0
- data/spec/mocks/responses/Capital/get-all-dynamic-offers.json +18 -0
- data/spec/mocks/responses/Checkout/amount_updates.json +1 -1
- data/spec/mocks/responses/Checkout/card_details.json +5 -0
- data/spec/mocks/responses/Checkout/create_stored_payment_method.json +5 -0
- data/spec/mocks/responses/Checkout/donation_campaigns.json +1 -0
- data/spec/mocks/responses/Checkout/donations.json +5 -0
- data/spec/mocks/responses/Checkout/orders.json +6 -1
- data/spec/mocks/responses/Checkout/orders_cancel.json +1 -1
- data/spec/mocks/responses/Checkout/payment-details.json +2 -13
- data/spec/mocks/responses/Checkout/payment_links.json +3 -0
- data/spec/mocks/responses/Checkout/payment_methods.json +2 -2
- data/spec/mocks/responses/Checkout/payment_methods_balance.json +5 -1
- data/spec/mocks/responses/Checkout/payments.json +4 -94
- data/spec/mocks/responses/Checkout/paypal_update_order.json +4 -0
- data/spec/mocks/responses/Checkout/reversals.json +6 -0
- data/spec/mocks/responses/Checkout/update_session.json +3 -0
- data/spec/mocks/responses/Management/donation_campaign.json +13 -0
- data/spec/mocks/responses/Management/list_donation_campaigns.json +19 -0
- data/spec/mocks/responses/Management/list_nonprofits.json +34 -0
- data/spec/mocks/responses/Transfers/initiate_cashout.json +31 -0
- data/spec/service_spec.rb +40 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/transfers_spec.rb +28 -0
- data/spec/utils/consumer_smoke.rb +23 -0
- data/spec/utils/hmac_validator_spec.rb +55 -0
- data/templates/api-small.mustache +4 -4
- data/templates/api.mustache +4 -4
- metadata +84 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 693741925d32762e26160e80b884e798c099defd6a9c9f6cbcc237c0bb11ed59
|
|
4
|
+
data.tar.gz: cd90bd20010dfe6b74e25286790e7ce5a03e822e9763e26cc2d3d9cb8467d939
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3dd7cfdc8e6d5100689d09906e12450f4c545cb994e55c3e7613ca7b0b179782b9a67d960ed0c4bccb1dade3a7aa0f7c6b49843da675c88047900ac3ffcc2224
|
|
7
|
+
data.tar.gz: eed28c652c5086aed7d9c60a97fa97002070bd8c78d60a885fb5b79776e2debdda38a6f2bb2bb1f60d7756e0a538041fade7a8c1743fde940d3735aff33bd2e5
|
data/.github/CODEOWNERS
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
* @Adyen/
|
|
1
|
+
* @Adyen/api-library-maintainers
|
|
@@ -20,18 +20,18 @@ jobs:
|
|
|
20
20
|
|
|
21
21
|
steps:
|
|
22
22
|
- name: Checkout
|
|
23
|
-
uses: actions/checkout@
|
|
23
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
24
24
|
|
|
25
25
|
- name: Initialize CodeQL
|
|
26
|
-
uses: github/codeql-action/init@
|
|
26
|
+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
|
27
27
|
with:
|
|
28
28
|
languages: ${{ matrix.language }}
|
|
29
29
|
queries: +security-and-quality
|
|
30
30
|
|
|
31
31
|
- name: Autobuild
|
|
32
|
-
uses: github/codeql-action/autobuild@
|
|
32
|
+
uses: github/codeql-action/autobuild@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
|
33
33
|
|
|
34
34
|
- name: Perform CodeQL Analysis
|
|
35
|
-
uses: github/codeql-action/analyze@
|
|
35
|
+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
|
|
36
36
|
with:
|
|
37
37
|
category: "/language:${{ matrix.language }}"
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
pull-requests: write
|
|
29
29
|
runs-on: ubuntu-latest
|
|
30
30
|
steps:
|
|
31
|
-
- uses: actions/checkout@
|
|
31
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
32
32
|
- name: Prepare the next main release
|
|
33
33
|
uses: Adyen/release-automation-action@3e5694d5b365f344a62436e84049511ef318ecf5 # v1.4.0
|
|
34
34
|
with:
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -16,11 +16,11 @@ jobs:
|
|
|
16
16
|
fail-fast: false
|
|
17
17
|
matrix:
|
|
18
18
|
os: [ubuntu-latest]
|
|
19
|
-
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '
|
|
20
|
-
ruby: [
|
|
19
|
+
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '4.0'
|
|
20
|
+
ruby: [3.3, 3.4, '4.0', head]
|
|
21
21
|
runs-on: ${{ matrix.os }}
|
|
22
22
|
steps:
|
|
23
|
-
- uses: actions/checkout@
|
|
23
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
24
24
|
- uses: ruby/setup-ruby@8a836efbcebe5de0fe86b48a775b7a31b5c70c93 # v1
|
|
25
25
|
with:
|
|
26
26
|
ruby-version: ${{ matrix.ruby }}
|
|
@@ -9,7 +9,7 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
13
13
|
- name: Release Gem on RubyGems
|
|
14
14
|
if: contains(github.ref, 'refs/tags/v')
|
|
15
15
|
uses: cadwallion/publish-rubygems-action@94a6f4cd5350581749c569b5001eecc864e3ad0b # v1.1.0
|
data/.github/workflows/stale.yml
CHANGED
|
@@ -7,7 +7,7 @@ jobs:
|
|
|
7
7
|
stale:
|
|
8
8
|
runs-on: ubuntu-latest
|
|
9
9
|
steps:
|
|
10
|
-
- uses: actions/stale@
|
|
10
|
+
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10
|
|
11
11
|
with:
|
|
12
12
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
13
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.'
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -12,23 +12,28 @@ This library supports the following:
|
|
|
12
12
|
| API name | API version | Description | API object |
|
|
13
13
|
|-------------------------------------------------------------------------------------------------------------------------------|:-----------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
|
|
14
14
|
| [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | v54 | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | [BinLookup](lib/adyen/services/binLookup.rb) |
|
|
15
|
-
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/
|
|
16
|
-
| [Capital API](https://docs.adyen.com/api-explorer/capital/1/overview) |
|
|
15
|
+
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/72/overview) | v72 | Our latest integration for accepting online payments. | [CheckoutAPI](lib/adyen/services/checkout.rb) |
|
|
16
|
+
| [Capital API](https://docs.adyen.com/api-explorer/capital/1/overview) | v1 | Provides endpoints for embedding Adyen Capital into your marketplace or platform. | [Capital](lib/adyen/services/capital.rb) |
|
|
17
17
|
| [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | v2 | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | [BalancePlatform](lib/adyen/services/balancePlatform.rb) |
|
|
18
18
|
| [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | v1 | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | [DataProtection](lib/adyen/services/dataProtection.rb) |
|
|
19
|
-
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/
|
|
19
|
+
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/4/overview) | v4 | Manage legal entities that contain information required for verification. | [LegalEntityManagement](lib/adyen/services/legalEntityManagement.rb) |
|
|
20
20
|
| [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | v3 | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](lib/adyen/services/management.rb) |
|
|
21
21
|
| [OpenBanking API](https://docs.adyen.com/api-explorer/open-banking/1/overview) | v1 | Securely share financial data and services with third parties. | [OpenBanking](lib/adyen/services/openBanking.rb) |
|
|
22
22
|
| [SessionAuthentication API](https://docs.adyen.com/api-explorer/sessionauthentication/1/overview) | v1 | The Session authentication API enables you to create and manage the JSON Web Tokens (JWT) required for integrating components. | [SessionAuthentication](lib/adyen/services/sessionAuthentication.rb) |
|
|
23
23
|
| [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | v68 | Our classic integration for online payments. | [Classic Integration API](lib/adyen/services/payment.rb) |
|
|
24
24
|
| [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | v68 | Endpoints for sending funds to your customers. | [Payout](lib/adyen/services/payout.rb) |
|
|
25
|
-
| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) |
|
|
25
|
+
| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | ~~v1~~ | ~~Endpoints for managing your point-of-sale payment terminals.~~ ‼️ **Deprecated**: use instead the [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview) for the management of your terminal fleet. | ~~[TerminalManagement](lib/adyen/services/posTerminalManagement.rb)~~ |
|
|
26
|
+
| [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | v68 | Endpoints for managing saved payment details. | [Recurring](lib/adyen/services/recurring.rb) |
|
|
26
27
|
| [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | v46 | Manage both online and point-of-sale gift cards and other stored-value cards. | [StoredValue](lib/adyen/services/storedValue.rb) |
|
|
27
28
|
| [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview) | v4 | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | [Transfers](lib/adyen/services/transfers.rb) |
|
|
28
29
|
| [Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/terminal-api-reference/) | - | Our point-of-sale integration. | [TerminalCloudAPI](lib/adyen/services/terminalCloudAPI.rb) |
|
|
29
30
|
| [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | v30 | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | [Disputes](lib/adyen/services/disputes.rb) |
|
|
30
|
-
| [POS Mobile API](https://docs.adyen.com/api-explorer/possdk/68/overview) |
|
|
31
|
-
| [Payments App API](https://docs.adyen.com/api-explorer/payments-app/1/overview) |
|
|
31
|
+
| [POS Mobile API](https://docs.adyen.com/api-explorer/possdk/68/overview) | v68 | The POS Mobile API is used in the mutual authentication flow between an Adyen Android or iOS [POS Mobile SDK](https://docs.adyen.com/point-of-sale/ipp-mobile/) and the Adyen payments platform. The POS Mobile SDK for Android or iOS devices enables businesses to accept in-person payments using a commercial off-the-shelf (COTS) device like a phone. For example, Tap to Pay transactions, or transactions on a mobile device in combination with a card reader. | [POS Mobile](lib/adyen/services/posMobile.rb) |
|
|
32
|
+
| [Payments App API](https://docs.adyen.com/api-explorer/payments-app/1/overview) | v1 | The Payments App API is used to Board and manage the Adyen Payments App on your Android mobile devices. | [paymentsApp](lib/adyen/services/paymentsApp.rb) |
|
|
33
|
+
| [Classic Platforms Account API](https://docs.adyen.com/api-explorer/Account/6/overview) | v6 | This API is used for the classic integration. If you are just starting your implementation, refer to our new integration guide instead. | [Marketpay::Account](lib/adyen/services/marketpay.rb) |
|
|
34
|
+
| [Classic Platforms Fund API](https://docs.adyen.com/api-explorer/Fund/6/overview) | v6 | This API is used for the classic integration. If you are just starting your implementation, refer to our new integration guide instead. | [Marketpay::Fund](lib/adyen/services/marketpay.rb) |
|
|
35
|
+
| [Classic Platforms Hosted Onboarding Page API](https://docs.adyen.com/api-explorer/Hop/6/overview) | v6 | This API is used for the classic integration. If you are just starting your implementation, refer to our new integration guide instead. | [Marketpay::Hop](lib/adyen/services/marketpay.rb) |
|
|
36
|
+
| [Classic Platforms Notification Configuration API](https://docs.adyen.com/api-explorer/NotificationConfiguration/6/overview) | v6 | This API is used for the classic integration. If you are just starting your implementation, refer to our new integration guide instead. | [Marketpay::Notification](lib/adyen/services/marketpay.rb) |
|
|
32
37
|
|
|
33
38
|
|
|
34
39
|
|
|
@@ -37,7 +42,7 @@ For more information, refer to our [documentation](https://docs.adyen.com/) or t
|
|
|
37
42
|
## Prerequisites
|
|
38
43
|
- [Adyen test account](https://docs.adyen.com/get-started-with-adyen)
|
|
39
44
|
- [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles).
|
|
40
|
-
- Ruby >=
|
|
45
|
+
- Ruby >= 3.3
|
|
41
46
|
|
|
42
47
|
## Installation
|
|
43
48
|
|
|
@@ -60,6 +65,24 @@ rspec
|
|
|
60
65
|
|
|
61
66
|
Follow the rest of our guides from the [documentation](https://adyen.github.io/adyen-ruby-api-library/) on how to use this library.
|
|
62
67
|
|
|
68
|
+
## Deprecations
|
|
69
|
+
|
|
70
|
+
Deprecated API methods emit Ruby deprecation warnings with the `:deprecated` warning category. These warnings are hidden by default in modern Ruby versions. To see them, enable the category in your application:
|
|
71
|
+
|
|
72
|
+
~~~~ruby
|
|
73
|
+
Warning[:deprecated] = true
|
|
74
|
+
~~~~
|
|
75
|
+
|
|
76
|
+
or run Ruby with the `-w` flag. Each warning names the deprecated method, the version it was deprecated since, and the recommended alternative when available.
|
|
77
|
+
|
|
78
|
+
To silence only this library's deprecation warnings (while keeping the category enabled for the rest of your application), use the attribute or the environment variable:
|
|
79
|
+
|
|
80
|
+
~~~~ruby
|
|
81
|
+
Adyen::Deprecation.silenced = true
|
|
82
|
+
~~~~
|
|
83
|
+
|
|
84
|
+
or set `ADYEN_SILENCE_DEPRECATIONS` to `1`, `true`, or `yes`. Explicitly setting the attribute (`true` or `false`) takes precedence over the environment variable. Silenced warnings never appear, even when the category is enabled.
|
|
85
|
+
|
|
63
86
|
## Using the library
|
|
64
87
|
|
|
65
88
|
### General use with API key
|
data/VERSION
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
12.0.0
|
|
2
2
|
|
|
@@ -3,7 +3,7 @@ require_relative 'lib/adyen/version'
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = 'adyen-ruby-api-library'
|
|
5
5
|
spec.version = Adyen::VERSION
|
|
6
|
-
spec.required_ruby_version = '>=
|
|
6
|
+
spec.required_ruby_version = '>= 3.3.0'
|
|
7
7
|
spec.authors = ['Adyen']
|
|
8
8
|
spec.email = ['support@adyen.com']
|
|
9
9
|
|
data/lib/adyen/client.rb
CHANGED
|
@@ -22,7 +22,7 @@ module Adyen
|
|
|
22
22
|
@ws_password = ws_password
|
|
23
23
|
@api_key = api_key
|
|
24
24
|
@oauth_token = oauth_token
|
|
25
|
-
|
|
25
|
+
self.env = env
|
|
26
26
|
@application_name = application_name
|
|
27
27
|
@adapter = adapter || Faraday.default_adapter
|
|
28
28
|
if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.1')
|
|
@@ -33,25 +33,20 @@ module Adyen
|
|
|
33
33
|
@adapter_options = adapter_options || {}
|
|
34
34
|
end
|
|
35
35
|
@mock_service_url_base = mock_service_url_base || "http://localhost:#{mock_port}"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
timeout: 60
|
|
43
|
-
)
|
|
36
|
+
self.live_url_prefix = live_url_prefix
|
|
37
|
+
# set default timeouts
|
|
38
|
+
@connection_options = connection_options || Faraday::ConnectionOptions.new(
|
|
39
|
+
request: Faraday::RequestOptions.new(
|
|
40
|
+
open_timeout: 30,
|
|
41
|
+
timeout: 60
|
|
44
42
|
)
|
|
45
|
-
|
|
46
|
-
@connection_options = connection_options || Faraday::ConnectionOptions.new
|
|
47
|
-
end
|
|
48
|
-
|
|
43
|
+
)
|
|
49
44
|
@terminal_region = terminal_region
|
|
50
45
|
end
|
|
51
46
|
|
|
52
47
|
# make sure that env can only be :live, :test, or :mock
|
|
53
48
|
def env=(value)
|
|
54
|
-
raise ArgumentError, "Invalid value for Client.env: '#{value}'
|
|
49
|
+
raise ArgumentError, "Invalid value for Client.env: '#{value}' - must be one of [:live, :test, :mock]" unless %i[
|
|
55
50
|
live test mock
|
|
56
51
|
].include? value
|
|
57
52
|
|
|
@@ -60,8 +55,7 @@ module Adyen
|
|
|
60
55
|
|
|
61
56
|
# remove 'https' from live_url_prefix if necessary
|
|
62
57
|
def live_url_prefix=(value)
|
|
63
|
-
|
|
64
|
-
@live_url_prefix = value
|
|
58
|
+
@live_url_prefix = value.nil? ? value : value.sub('https://', '')
|
|
65
59
|
end
|
|
66
60
|
|
|
67
61
|
# base URL for API given service and @env
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module Adyen
|
|
2
|
+
# Helper module for emitting deprecation warnings for deprecated API methods.
|
|
3
|
+
module Deprecation
|
|
4
|
+
# Set to true to silence all Adyen deprecation warnings, regardless of
|
|
5
|
+
# Warning[:deprecated]. Explicitly setting this attribute (true or false)
|
|
6
|
+
# overrides the ADYEN_SILENCE_DEPRECATIONS environment variable.
|
|
7
|
+
def self.silenced=(value)
|
|
8
|
+
@silenced = value
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# True when deprecation warnings are silenced, either via the attribute or,
|
|
12
|
+
# when the attribute was never set, via the ADYEN_SILENCE_DEPRECATIONS
|
|
13
|
+
# environment variable ("1", "true" or "yes", case-insensitive).
|
|
14
|
+
def self.silenced?
|
|
15
|
+
return @silenced unless @silenced.nil?
|
|
16
|
+
|
|
17
|
+
%w[1 true yes].include?(ENV.fetch('ADYEN_SILENCE_DEPRECATIONS', '').downcase)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Emits a deprecation warning for a deprecated method.
|
|
21
|
+
#
|
|
22
|
+
# @param method_name [Symbol, String] name of the deprecated method
|
|
23
|
+
# @param since [String, nil] e.g. "Adyen Checkout API v67"
|
|
24
|
+
# @param message [String, nil] additional guidance, e.g. the alternative to use
|
|
25
|
+
def self.warn(method_name, since: nil, message: nil)
|
|
26
|
+
return if silenced?
|
|
27
|
+
|
|
28
|
+
text = "[DEPRECATED] `#{method_name}` is deprecated"
|
|
29
|
+
text += " since #{since}" if since
|
|
30
|
+
text += ". #{message}" if message
|
|
31
|
+
Kernel.warn(text, category: :deprecated, uplevel: 2)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -15,10 +15,10 @@ module Adyen
|
|
|
15
15
|
# Start a balance transfer
|
|
16
16
|
#
|
|
17
17
|
# Deprecated since Adyen Balance Control API v1
|
|
18
|
+
# @deprecated
|
|
18
19
|
def balance_transfer(request, headers: {})
|
|
19
|
-
|
|
20
|
-
endpoint =
|
|
21
|
-
endpoint = format(endpoint)
|
|
20
|
+
Adyen::Deprecation.warn(:balance_transfer, since: 'Adyen Balance Control API v1')
|
|
21
|
+
endpoint = build_endpoint('/balanceTransfer')
|
|
22
22
|
|
|
23
23
|
action = { method: 'post', url: endpoint }
|
|
24
24
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Create an account holder
|
|
16
16
|
def create_account_holder(request, headers: {})
|
|
17
|
-
endpoint = '/accountHolders'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint)
|
|
17
|
+
endpoint = build_endpoint('/accountHolders')
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Get an account holder
|
|
26
24
|
def get_account_holder(id, headers: {})
|
|
27
|
-
endpoint = '/accountHolders/{id}'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint, id)
|
|
25
|
+
endpoint = build_endpoint('/accountHolders/{id}', id)
|
|
30
26
|
|
|
31
27
|
action = { method: 'get', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# Get all balance accounts of an account holder
|
|
36
32
|
def get_all_balance_accounts_of_account_holder(id, headers: {}, query_params: {})
|
|
37
|
-
endpoint = '/accountHolders/{id}/balanceAccounts'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint, id)
|
|
33
|
+
endpoint = build_endpoint('/accountHolders/{id}/balanceAccounts', id)
|
|
40
34
|
endpoint += create_query_string(query_params)
|
|
41
35
|
action = { method: 'get', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -44,9 +38,7 @@ module Adyen
|
|
|
44
38
|
|
|
45
39
|
# Get all transaction rules for an account holder
|
|
46
40
|
def get_all_transaction_rules_for_account_holder(id, headers: {})
|
|
47
|
-
endpoint = '/accountHolders/{id}/transactionRules'
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint, id)
|
|
41
|
+
endpoint = build_endpoint('/accountHolders/{id}/transactionRules', id)
|
|
50
42
|
|
|
51
43
|
action = { method: 'get', url: endpoint }
|
|
52
44
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -54,9 +46,15 @@ module Adyen
|
|
|
54
46
|
|
|
55
47
|
# Get a tax form
|
|
56
48
|
def get_tax_form(id, headers: {}, query_params: {})
|
|
57
|
-
endpoint = '/accountHolders/{id}/taxForms'
|
|
58
|
-
endpoint
|
|
59
|
-
|
|
49
|
+
endpoint = build_endpoint('/accountHolders/{id}/taxForms', id)
|
|
50
|
+
endpoint += create_query_string(query_params)
|
|
51
|
+
action = { method: 'get', url: endpoint }
|
|
52
|
+
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Get summary of tax forms for an account holder
|
|
56
|
+
def get_tax_form_summary(id, headers: {}, query_params: {})
|
|
57
|
+
endpoint = build_endpoint('/accountHolders/{id}/taxFormSummary', id)
|
|
60
58
|
endpoint += create_query_string(query_params)
|
|
61
59
|
action = { method: 'get', url: endpoint }
|
|
62
60
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -64,9 +62,7 @@ module Adyen
|
|
|
64
62
|
|
|
65
63
|
# Update an account holder
|
|
66
64
|
def update_account_holder(request, id, headers: {})
|
|
67
|
-
endpoint = '/accountHolders/{id}'
|
|
68
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
69
|
-
endpoint = format(endpoint, id)
|
|
65
|
+
endpoint = build_endpoint('/accountHolders/{id}', id)
|
|
70
66
|
|
|
71
67
|
action = { method: 'patch', url: endpoint }
|
|
72
68
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Create authorized users for a card.
|
|
16
16
|
def create_authorised_card_users(request, payment_instrument_id, headers: {})
|
|
17
|
-
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint, payment_instrument_id)
|
|
17
|
+
endpoint = build_endpoint('/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers', payment_instrument_id)
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Delete the authorized users for a card.
|
|
26
24
|
def delete_authorised_card_users(payment_instrument_id, headers: {})
|
|
27
|
-
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint, payment_instrument_id)
|
|
25
|
+
endpoint = build_endpoint('/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers', payment_instrument_id)
|
|
30
26
|
|
|
31
27
|
action = { method: 'delete', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# Get authorized users for a card.
|
|
36
32
|
def get_all_authorised_card_users(payment_instrument_id, headers: {})
|
|
37
|
-
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint, payment_instrument_id)
|
|
33
|
+
endpoint = build_endpoint('/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers', payment_instrument_id)
|
|
40
34
|
|
|
41
35
|
action = { method: 'get', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -44,9 +38,7 @@ module Adyen
|
|
|
44
38
|
|
|
45
39
|
# Update the authorized users for a card.
|
|
46
40
|
def update_authorised_card_users(request, payment_instrument_id, headers: {})
|
|
47
|
-
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint, payment_instrument_id)
|
|
41
|
+
endpoint = build_endpoint('/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers', payment_instrument_id)
|
|
50
42
|
|
|
51
43
|
action = { method: 'patch', url: endpoint }
|
|
52
44
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,49 +14,15 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Create a balance account
|
|
16
16
|
def create_balance_account(request, headers: {})
|
|
17
|
-
endpoint = '/balanceAccounts'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint)
|
|
17
|
+
endpoint = build_endpoint('/balanceAccounts')
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
23
21
|
end
|
|
24
22
|
|
|
25
|
-
# Create a sweep
|
|
26
|
-
def create_sweep(request, balance_account_id, headers: {})
|
|
27
|
-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps'.gsub(/{.+?}/, '%s')
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint, balance_account_id)
|
|
30
|
-
|
|
31
|
-
action = { method: 'post', url: endpoint }
|
|
32
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Delete a sweep
|
|
36
|
-
def delete_sweep(balance_account_id, sweep_id, headers: {})
|
|
37
|
-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}'.gsub(/{.+?}/, '%s')
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint, balance_account_id, sweep_id)
|
|
40
|
-
|
|
41
|
-
action = { method: 'delete', url: endpoint }
|
|
42
|
-
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# Get all sweeps for a balance account
|
|
46
|
-
def get_all_sweeps_for_balance_account(balance_account_id, headers: {}, query_params: {})
|
|
47
|
-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps'.gsub(/{.+?}/, '%s')
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint, balance_account_id)
|
|
50
|
-
endpoint += create_query_string(query_params)
|
|
51
|
-
action = { method: 'get', url: endpoint }
|
|
52
|
-
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
23
|
# Get all transaction rules for a balance account
|
|
56
24
|
def get_all_transaction_rules_for_balance_account(id, headers: {})
|
|
57
|
-
endpoint = '/balanceAccounts/{id}/transactionRules'
|
|
58
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
59
|
-
endpoint = format(endpoint, id)
|
|
25
|
+
endpoint = build_endpoint('/balanceAccounts/{id}/transactionRules', id)
|
|
60
26
|
|
|
61
27
|
action = { method: 'get', url: endpoint }
|
|
62
28
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -64,9 +30,7 @@ module Adyen
|
|
|
64
30
|
|
|
65
31
|
# Get a balance account
|
|
66
32
|
def get_balance_account(id, headers: {})
|
|
67
|
-
endpoint = '/balanceAccounts/{id}'
|
|
68
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
69
|
-
endpoint = format(endpoint, id)
|
|
33
|
+
endpoint = build_endpoint('/balanceAccounts/{id}', id)
|
|
70
34
|
|
|
71
35
|
action = { method: 'get', url: endpoint }
|
|
72
36
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -74,39 +38,15 @@ module Adyen
|
|
|
74
38
|
|
|
75
39
|
# Get payment instruments linked to a balance account
|
|
76
40
|
def get_payment_instruments_linked_to_balance_account(id, headers: {}, query_params: {})
|
|
77
|
-
endpoint = '/balanceAccounts/{id}/paymentInstruments'
|
|
78
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
79
|
-
endpoint = format(endpoint, id)
|
|
41
|
+
endpoint = build_endpoint('/balanceAccounts/{id}/paymentInstruments', id)
|
|
80
42
|
endpoint += create_query_string(query_params)
|
|
81
43
|
action = { method: 'get', url: endpoint }
|
|
82
44
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
83
45
|
end
|
|
84
46
|
|
|
85
|
-
# Get a sweep
|
|
86
|
-
def get_sweep(balance_account_id, sweep_id, headers: {})
|
|
87
|
-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}'.gsub(/{.+?}/, '%s')
|
|
88
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
89
|
-
endpoint = format(endpoint, balance_account_id, sweep_id)
|
|
90
|
-
|
|
91
|
-
action = { method: 'get', url: endpoint }
|
|
92
|
-
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
93
|
-
end
|
|
94
|
-
|
|
95
47
|
# Update a balance account
|
|
96
48
|
def update_balance_account(request, id, headers: {})
|
|
97
|
-
endpoint = '/balanceAccounts/{id}'
|
|
98
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
99
|
-
endpoint = format(endpoint, id)
|
|
100
|
-
|
|
101
|
-
action = { method: 'patch', url: endpoint }
|
|
102
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
# Update a sweep
|
|
106
|
-
def update_sweep(request, balance_account_id, sweep_id, headers: {})
|
|
107
|
-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}'.gsub(/{.+?}/, '%s')
|
|
108
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
109
|
-
endpoint = format(endpoint, balance_account_id, sweep_id)
|
|
49
|
+
endpoint = build_endpoint('/balanceAccounts/{id}', id)
|
|
110
50
|
|
|
111
51
|
action = { method: 'patch', url: endpoint }
|
|
112
52
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Create a balance webhook setting
|
|
16
16
|
def create_webhook_setting(request, balance_platform_id, webhook_id, headers: {})
|
|
17
|
-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint, balance_platform_id, webhook_id)
|
|
17
|
+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings', balance_platform_id, webhook_id)
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Delete a balance webhook setting by id
|
|
26
24
|
def delete_webhook_setting(balance_platform_id, webhook_id, setting_id, headers: {})
|
|
27
|
-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
|
|
25
|
+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}', balance_platform_id, webhook_id, setting_id)
|
|
30
26
|
|
|
31
27
|
action = { method: 'delete', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -34,9 +30,7 @@ module Adyen
|
|
|
34
30
|
|
|
35
31
|
# Get all balance webhook settings
|
|
36
32
|
def get_all_webhook_settings(balance_platform_id, webhook_id, headers: {})
|
|
37
|
-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings'
|
|
38
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
39
|
-
endpoint = format(endpoint, balance_platform_id, webhook_id)
|
|
33
|
+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings', balance_platform_id, webhook_id)
|
|
40
34
|
|
|
41
35
|
action = { method: 'get', url: endpoint }
|
|
42
36
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -44,9 +38,7 @@ module Adyen
|
|
|
44
38
|
|
|
45
39
|
# Get a balance webhook setting by id
|
|
46
40
|
def get_webhook_setting(balance_platform_id, webhook_id, setting_id, headers: {})
|
|
47
|
-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'
|
|
48
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
49
|
-
endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
|
|
41
|
+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}', balance_platform_id, webhook_id, setting_id)
|
|
50
42
|
|
|
51
43
|
action = { method: 'get', url: endpoint }
|
|
52
44
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -54,9 +46,7 @@ module Adyen
|
|
|
54
46
|
|
|
55
47
|
# Update a balance webhook setting by id
|
|
56
48
|
def update_webhook_setting(request, balance_platform_id, webhook_id, setting_id, headers: {})
|
|
57
|
-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'
|
|
58
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
59
|
-
endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
|
|
49
|
+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}', balance_platform_id, webhook_id, setting_id)
|
|
60
50
|
|
|
61
51
|
action = { method: 'patch', url: endpoint }
|
|
62
52
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Validate a bank account
|
|
16
16
|
def validate_bank_account_identification(request, headers: {})
|
|
17
|
-
endpoint = '/validateBankAccountIdentification'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint)
|
|
17
|
+
endpoint = build_endpoint('/validateBankAccountIdentification')
|
|
20
18
|
|
|
21
19
|
action = { method: 'post', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
|
@@ -14,9 +14,7 @@ module Adyen
|
|
|
14
14
|
|
|
15
15
|
# Get card order items
|
|
16
16
|
def get_card_order_items(id, headers: {}, query_params: {})
|
|
17
|
-
endpoint = '/cardorders/{id}/items'
|
|
18
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
19
|
-
endpoint = format(endpoint, id)
|
|
17
|
+
endpoint = build_endpoint('/cardorders/{id}/items', id)
|
|
20
18
|
endpoint += create_query_string(query_params)
|
|
21
19
|
action = { method: 'get', url: endpoint }
|
|
22
20
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|
|
@@ -24,9 +22,7 @@ module Adyen
|
|
|
24
22
|
|
|
25
23
|
# Get a list of card orders
|
|
26
24
|
def list_card_orders(headers: {}, query_params: {})
|
|
27
|
-
endpoint = '/cardorders'
|
|
28
|
-
endpoint = endpoint.gsub(%r{^/}, '')
|
|
29
|
-
endpoint = format(endpoint)
|
|
25
|
+
endpoint = build_endpoint('/cardorders')
|
|
30
26
|
endpoint += create_query_string(query_params)
|
|
31
27
|
action = { method: 'get', url: endpoint }
|
|
32
28
|
@client.call_adyen_api(@service, action, {}, headers, @version)
|