FX Optimizer
Server-Side Implementation
Creating a transaction
When creating a transaction, pass the ExchangeRateQuoteIdfrom
from the .NET 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:
- C#
var request = new ExchangeRateQuoteRequest();
request.AddExchangeRateQuoteInput(new ExchangeRateQuoteInput("USD", "EUR", "12.19", "12.14"));
and invoking the API:
- C#
var response = gateway.ExchangeRateQuote.Generate(request);
the response:
- C#
TransactionRequest request = new TransactionRequest {
Amount = 10.00M,
PaymentMethodNonce = nonceFromTheClient,
ExchangeRateQuoteId = exchangeRateQuoteIdFromTheClient,
DeviceData = deviceDataFromTheClient,
Options = new TransactionOptionsRequest {
SubmitForSettlement = true
}
};
Result<transaction> result = gateway.Transaction.Sale(request);