Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ This library supports the following:
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | v71 | Our latest integration for accepting online payments. | [CheckoutAPI](lib/adyen/services/checkout.rb) |
| [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) |
| [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) |
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | v3 | Manage legal entities that contain information required for verification. | [LegalEntityManagement](lib/adyen/services/legalEntityManagement.rb) |
| [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) |
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | v4 | Manage legal entities that contain information required for verification. | [LegalEntityManagement](lib/adyen/services/legalEntityManagement.rb) |
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |
| [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)~~ || [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | v68 | Endpoints for managing saved payment details. | [Recurring](lib/adyen/services/recurring.rb) |
Expand Down Expand Up @@ -89,11 +91,6 @@ response = adyen.checkout.payments_api.payments({
})
~~~~

- Change API Version
~~~~ruby
adyen.checkout.version = 69
~~~~

### Example integration

For a closer look at how our Ruby library works, clone our [example integration](https://github.com/adyen-examples/adyen-rails-online-payments). This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
Expand Down Expand Up @@ -231,9 +228,6 @@ adyen.oauth_token = "oauth_token"

The APIs available to use through OAuth in this library depend on the [OAuth Scopes](https://docs.adyen.com/development-resources/oauth/scopes/) defined when [Registering your OAuth client](https://docs.adyen.com/development-resources/oauth/integration/#step-1-register-your-client).

## Feedback
We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas.

## Contributing

We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements.
Expand Down
5 changes: 4 additions & 1 deletion lib/adyen-ruby-api-library.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
require_relative 'adyen/services/transfers'
require_relative 'adyen/services/management'
require_relative 'adyen/services/storedValue'
require_relative 'adyen/services/balanceControlService'
require_relative 'adyen/services/terminalCloudAPI'
require_relative 'adyen/services/posMobile'
require_relative 'adyen/services/openBanking'
require_relative 'adyen/services/sessionAuthentication'
require_relative 'adyen/services/balanceControl'

19 changes: 14 additions & 5 deletions lib/adyen/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def service_url_base(service)
when 'Account', 'Fund', 'Notification', 'Hop'
url = "https://cal-#{@env}.adyen.com/cal/services/#{service}"
supports_live_url_prefix = false
when 'Recurring', 'Payment', 'Payout', 'BinLookup', 'StoredValue', 'BalanceControlService'
when 'Recurring', 'Payment', 'Payout', 'BinLookup', 'StoredValue', 'BalanceControl'
url = "https://pal-#{@env}.adyen.com/pal/servlet/#{service}"
supports_live_url_prefix = true
when 'PosTerminalManagement'
Expand Down Expand Up @@ -292,10 +292,6 @@ def stored_value
@stored_value ||= Adyen::StoredValue.new(self)
end

def balance_control_service
@balance_control_service ||= Adyen::BalanceControlService.new(self)
end

def terminal_cloud_api
@terminal_cloud_api ||= Adyen::TerminalCloudAPI.new(self)
end
Expand All @@ -304,6 +300,19 @@ def pos_mobile
@pos_mobile ||= Adyen::PosMobile.new(self)
end

def open_banking
@open_banking ||= Adyen::OpenBanking.new(self)
end

def session_authentication
@open_banking ||= Adyen::SessionAuthentication.new(self)
end

def balance_control
@balance_control ||= Adyen::BalanceControl.new(self)
end


private

def auth_header(auth_type, faraday)
Expand Down
24 changes: 24 additions & 0 deletions lib/adyen/services/balanceControl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require_relative 'balanceControl/balance_control_api'

module Adyen

# NOTE: This class is auto generated by OpenAPI Generator
# Ref: https://openapi-generator.tech
#
# Do not edit the class manually.
class BalanceControl
attr_accessor :service, :version

DEFAULT_VERSION = 1
def initialize(client, version = DEFAULT_VERSION)
@service = 'BalanceControl'
@client = client
@version = version
end

def balance_control_api
@balance_control_api ||= Adyen::BalanceControlApi.new(@client, @version)
end

end
end
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
require_relative './service'
require_relative '../service'
module Adyen

# NOTE: This class is auto generated by OpenAPI Generator
# Ref: https://openapi-generator.tech
#
# Do not edit the class manually.
class BalanceControlService < Service
class BalanceControlApi < Service
attr_accessor :service, :version

DEFAULT_VERSION = 1
def initialize(client, version = DEFAULT_VERSION)
super(client, version, 'BalanceControlService')
super(client, version, 'BalanceControl')
end

# Start a balance transfer
#
# Deprecated since Adyen Balance Control API v1
def balance_transfer(request, headers: {})
endpoint = '/balanceTransfer'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand Down
10 changes: 10 additions & 0 deletions lib/adyen/services/balancePlatform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
require_relative 'balancePlatform/payment_instruments_api'
require_relative 'balancePlatform/platform_api'
require_relative 'balancePlatform/transaction_rules_api'
require_relative 'balancePlatform/transfer_limits_balance_account_level_api'
require_relative 'balancePlatform/transfer_limits_balance_platform_level_api'
require_relative 'balancePlatform/transfer_routes_api'

module Adyen
Expand Down Expand Up @@ -91,6 +93,14 @@ def transaction_rules_api
@transaction_rules_api ||= Adyen::TransactionRulesApi.new(@client, @version)
end

def transfer_limits_balance_account_level_api
@transfer_limits_balance_account_level_api ||= Adyen::TransferLimitsBalanceAccountLevelApi.new(@client, @version)
end

def transfer_limits_balance_platform_level_api
@transfer_limits_balance_platform_level_api ||= Adyen::TransferLimitsBalancePlatformLevelApi.new(@client, @version)
end

def transfer_routes_api
@transfer_routes_api ||= Adyen::TransferRoutesApi.new(@client, @version)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(client, version = DEFAULT_VERSION)
end

# Create authorized users for a card.
def create_authorised_card_users(request, payment_instrument_id, authorised_card_users, headers: {})
def create_authorised_card_users(request, payment_instrument_id, headers: {})
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, payment_instrument_id)
Expand Down Expand Up @@ -43,7 +43,7 @@ def get_all_authorised_card_users(payment_instrument_id, headers: {})
end

# Update the authorized users for a card.
def update_authorised_card_users(request, payment_instrument_id, authorised_card_users, headers: {})
def update_authorised_card_users(request, payment_instrument_id, headers: {})
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, payment_instrument_id)
Expand Down
4 changes: 2 additions & 2 deletions lib/adyen/services/balancePlatform/balances_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(client, version = DEFAULT_VERSION)
end

# Create a balance webhook setting
def create_webhook_setting(request, balance_platform_id, webhook_id, balance_webhook_setting_info, headers: {})
def create_webhook_setting(request, balance_platform_id, webhook_id, headers: {})
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, balance_platform_id, webhook_id)
Expand Down Expand Up @@ -53,7 +53,7 @@ def get_webhook_setting(balance_platform_id, webhook_id, setting_id, headers: {}
end

# Update a balance webhook setting by id
def update_webhook_setting(request, balance_platform_id, webhook_id, setting_id, balance_webhook_setting_info_update, headers: {})
def update_webhook_setting(request, balance_platform_id, webhook_id, setting_id, headers: {})
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
require_relative '../service'
module Adyen

# NOTE: This class is auto generated by OpenAPI Generator
# Ref: https://openapi-generator.tech
#
# Do not edit the class manually.
class TransferLimitsBalanceAccountLevelApi < Service
attr_accessor :service, :version

def initialize(client, version = DEFAULT_VERSION)
super(client, version, 'BalancePlatform')
end

# Approve pending transfer limits
def approve_pending_transfer_limits(request, id, headers: {})
endpoint = '/balanceAccounts/{id}/transferLimits/approve'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id)

action = { method: 'post', url: endpoint }
@client.call_adyen_api(@service, action, request, headers, @version)
end

# Create a transfer limit
def create_transfer_limit(request, id, headers: {})
endpoint = '/balanceAccounts/{id}/transferLimits'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id)

action = { method: 'post', url: endpoint }
@client.call_adyen_api(@service, action, request, headers, @version)
end

# Delete a scheduled or pending transfer limit
def delete_pending_transfer_limit(id, transfer_limit_id, headers: {})
endpoint = '/balanceAccounts/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id, transfer_limit_id)

action = { method: 'delete', url: endpoint }
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Get all current transfer limits
def get_current_transfer_limits(id, headers: {}, query_params: {})
endpoint = '/balanceAccounts/{id}/transferLimits/current'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id)
endpoint += create_query_string(query_params)
action = { method: 'get', url: endpoint }
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Get the details of a transfer limit
def get_specific_transfer_limit(id, transfer_limit_id, headers: {})
endpoint = '/balanceAccounts/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id, transfer_limit_id)

action = { method: 'get', url: endpoint }
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Filter and view the transfer limits
def get_transfer_limits(id, headers: {}, query_params: {})
endpoint = '/balanceAccounts/{id}/transferLimits'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id)
endpoint += create_query_string(query_params)
action = { method: 'get', url: endpoint }
@client.call_adyen_api(@service, action, {}, headers, @version)
end

end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
require_relative '../service'
module Adyen

# NOTE: This class is auto generated by OpenAPI Generator
# Ref: https://openapi-generator.tech
#
# Do not edit the class manually.
class TransferLimitsBalancePlatformLevelApi < Service
attr_accessor :service, :version

def initialize(client, version = DEFAULT_VERSION)
super(client, version, 'BalancePlatform')
end

# Create a transfer limit
def create_transfer_limit(request, id, headers: {})
endpoint = '/balancePlatforms/{id}/transferLimits'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id)

action = { method: 'post', url: endpoint }
@client.call_adyen_api(@service, action, request, headers, @version)
end

# Delete a scheduled or pending transfer limit
def delete_pending_transfer_limit(id, transfer_limit_id, headers: {})
endpoint = '/balancePlatforms/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id, transfer_limit_id)

action = { method: 'delete', url: endpoint }
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Get the details of a transfer limit
def get_specific_transfer_limit(id, transfer_limit_id, headers: {})
endpoint = '/balancePlatforms/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id, transfer_limit_id)

action = { method: 'get', url: endpoint }
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Filter and view the transfer limits
def get_transfer_limits(id, headers: {}, query_params: {})
endpoint = '/balancePlatforms/{id}/transferLimits'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id)
endpoint += create_query_string(query_params)
action = { method: 'get', url: endpoint }
@client.call_adyen_api(@service, action, {}, headers, @version)
end

end
end
Loading