Payment Services - The Basics
Payment Services provides an abstraction layer between you and various Payment Service Providers and allows you to facilitate payment processing without your application obtaining the PAN.
Payment Services v1 has been deprecated and is now in break/fix mode. All new enhancements are being added to Payment Services v2.
Process Transaction
The ProcessTransaction method allows you to conduct a transaction with a supported payment gateway or processor using your token. This method facilitates Authorization, Capture, Purchase, Refund, and Void transactions. The specific input parameters to be included with this request are dependent upon the payment gateway or processor you are using. If a field is not required for your gateway, it does not have to be populated.
ProcessTransaction must be invoked by making an HTTPS POST to the ProcessTransaction endpoint.
The complete list of currently-supported gateways, and details of input parameters for each of those gateways, can be found in Gateway Parameters.
(Optional) To inject a CVV that was previously collected by TokenEx, set the value of the gateway specific CVV parameter equal to "cvv". Payment Services will replace that value with the CVV value linked to the token.
URI: https://test-api.tokenex.com/P2PEService.svc/REST/ProcessTransaction
Request Parameters : TokenEx-Specific Parameters
Parameter | Type | Description |
---|---|---|
APIKey | string | |
TokenExID | string | Your TokenEx ID |
TransactionType | string | The type of transaction you wish to conduct. This is where you will stipulate Authorize (1), Capture (2), Purchase (3), Refund (4), Void (5), Reverse (6). |
Request Parameters : Gateway Parameters
To obtain the list of supported parameters for supported payment service providers, please contact Technical Support via the Client Portal.
Response Parameters
Parameter | Type | Description |
---|---|---|
Success | bool | Indicator if TokenEx was able to connect to the gateway. If false, additional information will be provided in the Error field. |
ReferenceNumber | string | Reference number for the TokenEx transaction. |
Error | string | Error Code and human-readable description. |
Authorization | string | The authorization code constructed by TokenEx. This could contain multiple values from the gateway, and is intended to be used in its entirety on follow-up requests pertaining to the same transaction. Specific gateway values are broken out in the Params field. |
Message | string | Additional message(s) that could be generated from your gateway or processor. |
AVS_Result | string | Gateway's address verification result. Properties: Code, Message, PostMatch, StreetMatch. |
CVV_Result | string | Gateway's card verification result. Properties: Code, Message. |
Params | string | Key/Value pair of additional gateway response parameters including authorizations, gateway error_codes & error_body. Refer to specific gateway documentations. |
TransactionResult | bool | Indicator if the request was successfully parsed by the gateway. In most cases true=approved, false=declined. If false, additional information should be available in the Params. |
{
"Error": "",
"ReferenceNumber": "15102913382030662954",
"Success": true,
"AVS_Result": {
"Code": "String content",
"Message": "String content",
"PostalMatch": "String content",
"StreetMatch": "String content"
},
"Authorization": "123456;A",
"CVV_Result": {
"Code": "String content",
"Message": "String content"
},
"Message": "Transaction Approved",
"Params": [
{
"Key": "AuthorizationCode",
"Value": "A"
},
{
"Key": "TransactionID",
"Value": "123456"
}
],
"Test": true,
"TransactionResult": true
}
Process Transaction and Tokenize
The ProcessTransactionAndTokenize method allows you to conduct a transaction with a supported payment gateway or processor using a PAN or encrypted PAN. This process will also tokenize the PAN. This method facilitates Authorization, Capture, Purchase, Refund, and Void transactions. The specific input parameters to be included with this request are dependent upon the payment gateway or processor you are using. If a field is not required for your gateway, it does not have to be populated.
ProcessTransactionAndTokenize must be invoked by making an HTTPS POST to the ProcessTransactionAndTokenize endpoint.
The complete list of currently-supported gateways, and details of input parameters for each of those gateways, can be found in Gateway Parameters.
URI: https://test-api.tokenex.com/P2PEService.svc/REST/ProcessTransactionAndTokenize
Request Parameters : TokenEx-Specific Parameters
Parameter | Type | Description |
---|---|---|
APIKey | string | See Auth Model |
TokenExID | string | Your TokenEx ID |
TransactionType | string | This the type of transaction you wish to conduct. This is where you will stipulate Authorize (1), Capture (2), Purchase (3), Refund (4), Void (5), Reverse (6). |
Encrypted | bool | Indicator if the value supplied is encrypted. If true, value is encrypted. |
TokenScheme | Enum | See Token Schemes |
Request Parameters : Gateway Parameters
To obtain the list of supported fields for your Payment Service Provider, please see the Gateway Parameters section.
Response Parameters
Parameter | Type | Description |
---|---|---|
Success | bool | Indicator if TokenEx was able to connect to the gateway. If false, additional information will be provided in the Error field. |
ReferenceNumber | string | Reference number for the TokenEx transaction. |
Error | string | Error Code and human-readable description. |
Authorization | string | The authorization code constructed by TokenEx. This could contain multiple values from the gateway, and is intended to be used in its entirety on follow-up requests pertaining to the same transaction. Specific gateway values are broken out in the Params field. |
Message | string | Additional message(s) that could be generated from your gateway or processor. |
AVS_Result | string | Gateway's address verification result. Properties: Code, Message, PostMatch, StreetMatch. |
CVV_Result | string | Gateway's card verification result. Properties: Code, Message. |
Params | string | Key/Value pair of additional gateway response parameters including authorizations, gateway error_codes & error_body. Refer to specific gateway documentations. |
Token | string | The token as generated by TokenEx that references the sensitive data. |
TransactionResult | bool | Indicator if the request was successfully parsed by the gateway. In most cases true=approved, false=declined. If false, additional information should be available in the Params. |
{
"Error": "",
"ReferenceNumber": "15102913382030662954",
"Success": true,
"AVS_Result": {
"Code": "String content",
"Message": "String content",
"PostalMatch": "String content",
"StreetMatch": "String content"
},
"Authorization": "123456;A",
"CVV_Result": {
"Code": "String content",
"Message": "String content"
},
"Message": "Transaction Approved",
"Params": [
{
"Key": "AuthorizationCode",
"Value": "A"
},
{
"Key": "TransactionID",
"Value": "123456"
}
],
"Test": true,
"Token": "545454587415454",
"TransactionResult": true
}