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
24 changes: 24 additions & 0 deletions lib/adyen/services/foreignExchange.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require_relative 'foreignExchange/rates_api'

module Adyen

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The service name 'ForeignExchange' is not yet supported in Adyen::Client#service_url_base (defined in lib/adyen/client.rb). Any API call to this service will raise an ArgumentError: Invalid service specified. Please ensure Adyen::Client is updated to support the 'ForeignExchange' service base URL.

@client = client
@version = version
end

def rates_api
@rates_api ||= Adyen::RatesApi.new(@client, @version)
end

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

def initialize(client, version = DEFAULT_VERSION)
super(client, version, 'ForeignExchange')
end
Comment on lines +11 to +13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The constant DEFAULT_VERSION is not defined within the RatesApi class or the Adyen module scope, which will result in a NameError: uninitialized constant Adyen::RatesApi::DEFAULT_VERSION when initializing RatesApi without explicitly passing a version. Defining DEFAULT_VERSION = 1 inside the RatesApi class resolves this issue.

    DEFAULT_VERSION = 1

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


# Calculate amount in a different currency
def calculate(request, headers: {})
endpoint = build_endpoint('/rates/calculate')

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

end
end
8 changes: 8 additions & 0 deletions sdk-generation-log/foreignexchange.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"service": "foreignexchange",
"project": "ruby",
"generatedAt": "2026-10-22T14:18:24Z",
"openapiCommitSha": "2c1f3ab1e0385815899db9364a95e5aa5cf5568a",
"automationCommitSha": "b78db5c1f857f1d7d8d45116ce61f6266043fa60",
"libraryCommitSha": "773b42b07b93eceb706d79d666496a2c864f62fe"
}
Loading