FX Optimizer

Server-Side Implementationanchor

Creating a transactionanchor

When creating a transaction, pass the exchange_rate_quote_id from the Ruby SDK.

The Exchange Rate Quote API is a GraphQL API, and the server-side implementation includes converting the below request passed to the API.

The client-side makes a request by passing the following variables:

  1. Ruby
exchange_rate_quote_input = {
  base_currency: "USD",
  quote_currency: "EUR",
  base_amount: "10.00",
  markup: "2.00"

and invoking the API:

  1. Ruby
request = ExchangeRateQuoteRequest.new(exchange_rate_quote_input)

the response:

  1. Ruby
result = gateway.transaction.sale(:amount => "10.00",
  :payment_method_nonce => nonce_from_the_client,
  :exchange_rate_quote_id => exchangeRateQuoteIdFromTheClient,
  :device_data => device_data_from_the_client,
  :options => { :submit_for_settlement => true })

Next Page: Testing and Go Live