Foreign Exchange Service

Velocity Android Software Development Kit Integration Guide

Foreign Exchange Service (FX) provides an omnichannel solution for facilitating the payment of products and/or services in multiple currencies. The service helps to reduce the rate of drop-offs as customers can make payment in the currency they prefer.

The SDK fetches the amount in available card currency, which enables customers to see the option to make payment in multiple currencies. The FX API is called after the initialize API is successful.

🚧

Note: FX is available for Mastercard and Visa card transactions only for customers of merchants who subscribe to this service.

The following diagram shows how to integrate FX with the assumption that the communication with Velocity backend is successful.


To retrieve all available currencies of a card, use the getForeignExchangeOffer method. To use this method, refer to the following code sample.

var  saleAmount: mPointAmountInfo = mPointAmountInfo().setCurrency(currency).setPrice(amount)

Use the following code sample to create the mPointExchangeOfferCriteria object for making payment with a new card:

var offerCriteria = mPointExchangeOfferCriteria()
                    .setOrderNumber(orderId)
                    .setCardNumber(cardnumber.toString())
                    .setCardType(cardtype)
.setCountry(CountryConfig.COUNTRY_CODES.getValues()
                               .get(countryid))
                    .setSaleAmount(saleAmount)
                    .setTransactionId(_mPoint.txnInfo.id)
.setClientId(CLIENT_ID)
                    .setAccountId(ACCOUNT_ID)
                    .setClientInfo(clientInfo)
_mPoint.getForeignExchangeOffer(offerCriteria)

To handle the response of exchange offer, override the displayForeignExchangeOffers method and implement the mPointForeignExchangeDelegate interface as follows:

override fun displayForeignExchangeOffers (offer: mPointExchangeOffer?, mpoint: mPoint?) {
}

To consume a specific mPointExchangeOffer, use this exchange offer and create mPointForeignExchangeInfo as shown in the following code sample:

var foreignExchangeInfo
   = mPointForeignExchangeInfo()
   .setId(offer?.foreignExchangeOfferId!!)
   .setExchangeAmount(offer.paymentCurrencyOffers[0]
                           .exchangeAmount.price)
.setExchangeCurrencyId(offer.paymentCurrencyOffers[0]
                               .exchangeCurrency.isoNumericCode)
.setSaleCurrencyId(offer.paymentCurrencyOffers[0]
                           .saleCurrency.isoNumericCode)
.setSaleAmount(offer.paymentCurrencyOffers[0]
                       .saleAmount.price)
   .setConversionRate(offer.paymentCurrencyOffers[0]
                           .offeredExchangeRate)
   .setHmac(offer.paymentCurrencyOffers[0].validationHmac)