Authorize Payment
9. Authorize Payment
The authorize payment request is used to authorize a payment. The API is available at the following path:
End point |
[Velocity URL]/mpoint/authorize-payment |
Format |
text/xml |
Authentication |
HTTP basic access authentication |
9.1 Authorize Request
The payment authorize request is initiated using the payment token returned by Apple Pay after a card is selected for completing the transaction by the user. The expected format of <token>
is base-64 encoded string.
Sample Token from Apple Pay after base-64 encode: paymentMethodToken:token:
The following authorize payment request is an example of making payment:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<authorize-payment account="[integer]" client-id="[integer]" >
<transaction type-id="40" id="[CELLPOINT DIGITAL-TXNID]">
<card network="visa" type-id="15">
<address country-id="200">
<first-name>Harish</first-name>
<last-name>Chandra</last-name>
<street>1131 Meadow Creek Dr.</street>
<postal-code>75086</postal-code>
<city>Irving</city><state>KY</state>
<contact-details>
</contact-details>
</address>
<amount currency-id="[integer]" country-id="[integer]">100</amount>
<token>[token]</token>
</card>
</transaction><client-info version="10.02" app-version="10.02" sdk-version="2.3.1" language="gb" platform="iOS/15.5"><device-id>087E575D-92BD-483A-B1AA-C4F9CDCA5674</device-id></client-info></authorize-payment></root>
The Authorize Request parameters are listed in the table below:
Parameter |
Type |
Mandatory |
Description |
||||||||||||||||||||
Authorize-payment Parameters |
|||||||||||||||||||||||
account |
Integer |
No |
The number for a sub-account with which a payment transaction is associated. The account ID is an integer greater than 100000 and account number is an integer smaller than 1000. The payment transaction is associated with the default sub-account if merchants do not provide this parameter. |
||||||||||||||||||||
client-id |
Integer |
Yes |
The unique ID of a merchant. |
||||||||||||||||||||
Transaction Parameters |
|||||||||||||||||||||||
id |
Integer |
Yes |
The ID of the transaction. |
||||||||||||||||||||
type-id |
Integer |
Yes |
A unique transaction identification number. |
||||||||||||||||||||
card network |
Enum |
No |
A list to identify the card network from which the token was obtained. It takes one of the following values:
|
||||||||||||||||||||
Card Parameters |
|||||||||||||||||||||||
currency-id |
Integer |
Yes |
The country currency code of a currency. |
||||||||||||||||||||
country-id |
Integer |
Yes |
The CellPoint Digital-specific country code, which is made available to merchants on request. |
||||||||||||||||||||
token |
String |
No |
The base64 encoded cryptogram for a third-party wallet such as Apple Pay™. |
||||||||||||||||||||
hmac |
String |
No |
The Message Authentication Code (MAC). It is calculated
by creating a sha-512 hash comprising the following
input fields in the listed order:
Note: CELLPOINT DIGITAL provides the salt value to merchants. MAC calculation secures the information sent by the merchant to Velocity by applying the SHA-512 encryption algorithm on key parts of the information sent to protect against tampering. The “salt” is the merchant's shared secret string used to ensure that MAC is unique. |
||||||||||||||||||||
Address Parameters |
|||||||||||||||||||||||
country-id |
Integer |
Yes |
The CellPoint Digital-specific country code, which is made available to merchants on request. |
||||||||||||||||||||
full-name |
String |
Yes |
The full name of a customer. |
||||||||||||||||||||
street |
String |
Yes |
The full address of a customer with street name and street number. |
||||||||||||||||||||
postal-code |
String |
Yes |
The postal code of a customer. |
||||||||||||||||||||
city |
String |
Yes |
The city in which a customer resides. |
||||||||||||||||||||
state |
String |
No |
The state in which a customer resides. Customers enter this parameter only if their country of residence is divided onto states. |
||||||||||||||||||||
country-id |
Integer |
Yes |
The CellPoint Digital-specific country code, which is made available to merchants on request. |
||||||||||||||||||||
Client Information Parameters |
|||||||||||||||||||||||
language |
String |
Yes |
The language that Velocity uses as default when translating the payment pages. Note: Velocity language codes are based upon the ISO- 639-1 standard. Refer to https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes for details. |
||||||||||||||||||||
version |
String |
Yes |
The version of an API or application that sends the request. |
||||||||||||||||||||
platform |
String |
Yes |
The platform from which the request is sent. For example, web, iOS, Android, B2B, and B2C. |
||||||||||||||||||||
mobile operator-id |
Integer |
Yes |
The ID of a customer’s mobile network operator. CellPoint Digital recommends including this parameter in the request to ensure Velocity correctly interacts with the operator. |
||||||||||||||||||||
|
String |
No |
The email address of a customer. If a customer provides this parameter, the Email input field on the Send Email Receipt page is automatically populated with this value. |
9.2 Authorize Response
The Velocity server sends the response informing if the transaction authorization was a success or a failure. The following example shows that a payment request was authorized successfully:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<status code="2000">Payment authorized</status>
</root>
The Authorize Response parameters are listed in the table below.
Parameter |
Type |
Mandatory |
Description |
Status |
String |
Yes |
Describes the status code. |
Code |
Integer |
Yes |
Status code for the authorizing processes. |
Updated 5 months ago