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 transaction
When creating a transaction, pass the exchange_rate_quote_id
from the Python 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:
- Python
attribute1 = {
"base_currency": "USD",
"quote_currency": "EUR",
"base_amount": "12.19",
"markup": "12.14"
}
request = ExchangeRateQuoteRequest().add_exchange_rate_quote_input(attribute1).done()
and invoking the API:
- Python
response = self.get_gateway().exchange_rate_quote.generate(request)
the response:
- Python
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
}
}
)