Authorize Payment

Velocity Android Software Development Kit Integration Guide

To retrieve specific mPoint cardinfoobject, use the following method. You must provide the card number that your customer enters in the text field; it is an on-click event. This cardinfoobject gives information regarding the card type, such as Visa, Mastercard, and American Express, as well as maximum and minimum length of the card and card verification value (CVV) number. Based on this information, add validation and modification on your payment screen.

var cardtype = _mPoint.getCardFromPrefix(java.lang.Long.valueOf(cardNumer)!!)

FX Opt-in Transaction

An opt-in transaction is when a customer is making a payment with a new card and selects a card currency other than the original sale currency. The flow of an opt-in transaction is as follows:

  1. Complete the initialize payment successfully.
  2. Consume the FX API successfully.
  3. Finalize the payment offer and invoke the auth API.
    1. Customers opted to make payment in currency other than the sale currency.
    2. Send Opt-in as a Boolean flag as true.
    3. Send standard authorize parameters.

๐Ÿ“˜

Note: The Opt-in and SetDccOpted depends on a merchantโ€™s requirement.

Refer to Dynamic Currency Conversion to create the mPointForeignExchangeInfo object. For opt-in transactions, refer to the following code:

foreignExchangeInfo?.setDccOpted(true)

To support FX-based routing, send the service-type-id field in the foreign-exchange info node as it enables you to offer various services such as FX and PCC. Send the following ID in service-type-id field.

foreignExchangeInfo?.serviceTypeId =
mPointForeignExchangeInfo.SERVICE_TYPE_ID.DCC_OPT_IN

FX Opt-out Transaction

In opt-out transactions, the customer has the option to make payment in available card currencies,
but chooses to make payment in the sale currency. The flow of an opt-out transaction is as follows:

  1. Complete the initialize payment successfully.
  2. Consume the FX API successfully.
  3. Finalize the payment offer and invoke the auth API.
    1. Customers opted to make payment using sale currency.
    2. Send Opt-in as a Boolean flag as false.
    3. Send standard authorize parameters.

Refer to Dynamic Currency Conversion to create the mPointForeignExchangeInfo object. For opt-in transactions, refer to the following code:

foreignExchangeInfo?.setDccOpted(false)

For FX opt-out transactions, send the following ID in the service-type-id field:

foreignExchangeInfo?.serviceTypeId =
mPointForeignExchangeInfo.SERVICE_TYPE_ID.DCC_OPT_OUT

ID Values

The values for service-type-id field ID used for a transaction are double-digit numbers - XY in which:

  • X represents the exchange service applicable for a transaction.
  • Y represents the any one of the following types of exchange:
    • 1, which means Opted
    • 2, which means Not-opted

The following table shows the possible values of service-type-id number and how it is derived.

ID (XY)Service (X)Opted (Y)
11FXOpted
12FXNot opted
41PCCOpted
42PCCNot opted

Authorize the payment for a transaction for a card by invoking the authorize method of SDK as shown in the following code sample:

_mPoint.authorize(mPointAuthorizeInfo(cardtype)
.setCardNo(java.lang.Long.valueOf(cardNumer))
.setCardExpMonth(Integer.parseInt(expiryMonth))
.setCardExpYear(Integer.parseInt(expiryYear))
.setCvc(tempCvv.toString())
.setNameOnCard(cardName)
.setStoreCard(isSaveCard)
.setCardValidFromMonth(validMonth.toInt())
.setCardValidFromYear(validYear.toInt())
.setClientInfo(clientInfo)
.setAddressInfo(addressInfo))
.setForeignExchangeOffer(foreignExchangeInfo)

.setViaAuthToken(true).setPassword(authToken)

๐Ÿ“˜

Note: The setViaAuthToken parameter is required only if the authToken parameter is sent in request.

Sending FX Indicator

When the FX API gives an error, a status tag is returned in handleStatus method. As per regulatory requirements, send this status code in authorize API request.

Refer to the following code sample to fetch the status codes in handleStatus method:

var additionalData: RecordMap<String, String>? = null
โ€ฆ.
override fun handleStatus(statusInfo: mPointStatusInfo?, client: Client?, p2: mPoint?) {
runOnUiThread {
if(statusInfo.statuses.size > 0 && statusInfo.statuses[0].containsKey("status")){
    val status = statusInfo.statuses[0]["status"] as RecordMap<*, *>
    val code : String = status["@code"] as String
additionalData = RecordMap()
    additionalData!!["cfx_status_code"] = code
}
 	   }
}

Refer to the following code sample to send FX indicator in authorize API request:

_mPoint.authorize(mPointAuthorizeInfo(cardtype)
.setCardNo(java.lang.Long.valueOf(cardNumer))
.setCardExpMonth(Integer.parseInt(expiryMonth))
.setCardExpYear(Integer.parseInt(expiryYear))
.setCvc(tempCvv.toString())
.setNameOnCard(cardName)
.setStoreCard(isSaveCard)
.setCardValidFromMonth(validMonth.toInt())
.setCardValidFromYear(validYear.toInt())
.setClientInfo(clientInfo)
.setAddressInfo(addressInfo))
.setForeignExchangeOffer(foreignExchangeInfo)
.addAdditionalData(additionalData))
.setViaAuthToken(true).setPassword(authToken)

๐Ÿ“˜

Note: The setViaAuthToken parameter is required only if the authToken parameter is sent in request.