Skip to content
Open
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
20 changes: 20 additions & 0 deletions lib/adyen/services/balancePlatform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
require_relative 'balancePlatform/payment_instrument_groups_api'
require_relative 'balancePlatform/payment_instruments_api'
require_relative 'balancePlatform/platform_api'
require_relative 'balancePlatform/sca_association_management_api'
require_relative 'balancePlatform/sca_device_management_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 @@ -87,10 +91,26 @@ def platform_api
@platform_api ||= Adyen::PlatformApi.new(@client, @version)
end

def sca_association_management_api
@sca_association_management_api ||= Adyen::SCAAssociationManagementApi.new(@client, @version)
end

def sca_device_management_api
@sca_device_management_api ||= Adyen::SCADeviceManagementApi.new(@client, @version)
end

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
@@ -0,0 +1,46 @@
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 SCAAssociationManagementApi < Service
attr_accessor :service, :version

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

# Approve a pending approval association
def approve_association(request, www_authenticate, headers: {})
endpoint = '/scaAssociations'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint)

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

# Get a list of devices associated with an entity
def list_associations(headers: {}, query_params: {})
endpoint = '/scaAssociations'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint)
endpoint += create_query_string(query_params)
action = { method: 'get', url: endpoint }
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Delete association to devices
def remove_association(request, www_authenticate, headers: {})
endpoint = '/scaAssociations'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint)

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

end
end
46 changes: 46 additions & 0 deletions lib/adyen/services/balancePlatform/sca_device_management_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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 SCADeviceManagementApi < Service
attr_accessor :service, :version

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

# Begin SCA device registration
def begin_sca_device_registration(request, headers: {})
endpoint = '/scaDevices'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint)

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

# Finish registration process for a SCA device
def finish_sca_device_registration(request, device_id, headers: {})
endpoint = '/scaDevices/{deviceId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, device_id)

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

# Create a new SCA association for a device
def submit_sca_association(request, device_id, headers: {})
endpoint = '/scaDevices/{deviceId}/scaAssociations'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, device_id)

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

end
end
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, approve_transfer_limit_request, 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, create_transfer_limit_request, 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(transfer_limit_id, id, headers: {})
endpoint = '/balanceAccounts/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, transfer_limit_id, 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(transfer_limit_id, id, headers: {})
endpoint = '/balanceAccounts/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, transfer_limit_id, 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, create_transfer_limit_request, 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(transfer_limit_id, id, headers: {})
endpoint = '/balancePlatforms/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, transfer_limit_id, 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(transfer_limit_id, id, headers: {})
endpoint = '/balancePlatforms/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, transfer_limit_id, 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
2 changes: 1 addition & 1 deletion lib/adyen/services/checkout/donations_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def donation_campaigns(request, headers: {})
@client.call_adyen_api(@service, action, request, headers, @version)
end

# Start a transaction for donations
# Make a donation
def donations(request, headers: {})
endpoint = '/donations'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand Down
10 changes: 10 additions & 0 deletions lib/adyen/services/checkout/utility_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,15 @@ def updates_order_for_paypal_express_checkout(request, headers: {})
@client.call_adyen_api(@service, action, request, headers, @version)
end

# Validates shopper Id
def validate_shopper_id(request, validate_shopper_id_request, headers: {})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The method validate_shopper_id includes an unused parameter validate_shopper_id_request. This makes the method signature confusing and should be removed to align with the other methods in this class.

    def validate_shopper_id(request, headers: {})

endpoint = '/validateShopperId'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint)
Comment on lines +49 to +51

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The construction of the endpoint string can be simplified. Since '/validateShopperId' is a static string with no path parameters, the calls to gsub and format are redundant.

      endpoint = 'validateShopperId'


action = { method: 'post', url: endpoint }
@client.call_adyen_api(@service, action, request, headers, @version)
end
Comment on lines +47 to +55

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new validate_shopper_id method is not covered by any tests. Please add unit tests for this new functionality in spec/checkout_spec.rb to verify its behavior and prevent future regressions.


end
end
2 changes: 1 addition & 1 deletion lib/adyen/services/legalEntityManagement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Adyen
class LegalEntityManagement
attr_accessor :service, :version

DEFAULT_VERSION = 3
DEFAULT_VERSION = 4
def initialize(client, version = DEFAULT_VERSION)
@service = 'LegalEntityManagement'
@client = client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def create_rule(request, merchant_id, split_configuration_id, headers: {})
@client.call_adyen_api(@service, action, request, headers, @version)
end

# Create a split configuration
# Create a split configuration profile
def create_split_configuration(request, merchant_id, headers: {})
endpoint = '/merchants/{merchantId}/splitConfigurations'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand All @@ -32,7 +32,7 @@ def create_split_configuration(request, merchant_id, headers: {})
@client.call_adyen_api(@service, action, request, headers, @version)
end

# Delete a split configuration
# Delete a split configuration profile
def delete_split_configuration(merchant_id, split_configuration_id, headers: {})
endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand All @@ -42,7 +42,7 @@ def delete_split_configuration(merchant_id, split_configuration_id, headers: {})
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Delete a split configuration rule
# Delete a rule
def delete_split_configuration_rule(merchant_id, split_configuration_id, rule_id, headers: {})
endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand All @@ -52,7 +52,7 @@ def delete_split_configuration_rule(merchant_id, split_configuration_id, rule_id
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Get a split configuration
# Get a split configuration profile
def get_split_configuration(merchant_id, split_configuration_id, headers: {})
endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand All @@ -62,7 +62,7 @@ def get_split_configuration(merchant_id, split_configuration_id, headers: {})
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Get a list of split configurations
# Get a list of split configuration profiles
def list_split_configurations(merchant_id, headers: {})
endpoint = '/merchants/{merchantId}/splitConfigurations'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand All @@ -72,7 +72,7 @@ def list_split_configurations(merchant_id, headers: {})
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# Update split conditions
# Update the split conditions
def update_split_conditions(request, merchant_id, split_configuration_id, rule_id, headers: {})
endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand All @@ -82,7 +82,7 @@ def update_split_conditions(request, merchant_id, split_configuration_id, rule_i
@client.call_adyen_api(@service, action, request, headers, @version)
end

# Update split configuration description
# Update the description of the split configuration profile
def update_split_configuration_description(request, merchant_id, split_configuration_id, headers: {})
endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
Expand Down