FX Optimizer

Server-Side Implementation

Creating a transactionAnchorIcon

When creating a transaction, pass the exchangeRateQuoteId from the Node.js 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. Callback
let exchangeRateQuoteRequest = {
    quotes: [
        {
            baseCurrency: "USD",
            quoteCurrency: "EUR",
            baseAmount: "12.19",
            markup: "12.14"
        },
        {
            baseCurrency: "EUR",
            quoteCurrency: "CAD",
            baseAmount: "15.16",
            markup: "2.64"
        }
    ]
};
specHelper.defaultGateway.exchangeRateQuote.generate(exchangeRateQuoteRequest, (err, response) => {
    let quotes = response.exchangeRateQuotePayload.quotes;
});

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