FX Optimizer
Server-Side Implementation
Creating a transaction
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:
- 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;
});