FX Optimizer

Server-Side Implementation

Important
Your integration may be impacted by upcoming certificate changes. Visit our best practices guide to learn more.

Creating a transactionAnchorIcon

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 })

If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more