FX Optimizer

Server-Side Implementation

Creating a transactionAnchorIcon

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:

  1. C#
var request = new ExchangeRateQuoteRequest();
request.AddExchangeRateQuoteInput(new ExchangeRateQuoteInput("USD", "EUR", "12.19", "12.14"));

and invoking the API:

  1. C#
var response = gateway.ExchangeRateQuote.Generate(request);

the response:

  1. 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);

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