Google Pay™ – is a fast and easy way to pay by card without the necessity to enter payment details for each transaction. Card data is securely stored in Google and a unique encrypted number is used instead. This payment method is available for all devices (mobile phones or computers), regardless of operating system and web browser.

1. Connection method through the Ukrgasbank Checkout payment page.
This requires:
- to sign an Agreement with JSB UKRGASBANK
- to accept GOOGLE PAY API TERMS OF SERVICE at the following link https://payments.developers.google.com/terms/sellertos

The Google Pay button will be displayed on the Ukrgasbank Checkout payment page. Payment management is described in UGB_GooglePay_checkout_v*.doc, which will be provided by the bank employee (customer service manager).
Checkout page screen example: 

Mobirise

2. Google Pay API connection method
This requires:
- to sign up to use the Google Pay API.
- the website must use HTTPS in its web address and support TLS.
In order to setup Google Pay for the website or mobile app, use the following instructions (references):

• Documentation:
1. For mobile apps at the link https://developers.google.com/pay/api/android/overview
2. For websites at the link https://developers.google.com/pay/api/web/overview


• Branding requirements
1. For mobile apps at the link https://developers.google.com/pay/api/android/guides/brand-guidelines
2. For websites at the link https://developers.google.com/pay/api/web/guides/brand-guidelines





Interaction scheme 

Mobirise


1. Request from the Merchant's application to receive encrypted payment data.
2. Google Pay returns encrypted payment data after customer authentication.
3. Encrypted payment data is sent to Backend.
4. You send a request with encrypted data to Ukrgasbank
5. Ukrgasbank sends you payment result.
6. Merchant notifies the buyer about the result.


Google Pay integration
Step 1. Integrate Google Pay API at the link https://developers.google.com/pay/api/ in order to obtain PaymentData.
Settings:
- allowPaymentMethods : CARD
- tokenizationSpecification = { "type": "PAYMENT_GATEWAY"}
- allowedCardNetworks = ['MASTERCARD', 'VISA'];
- allowedCardAuthMethods = ['PAN_ONLY', 'CRYPTOGRAM_3DS'];
- gateway = ukrgasbankpay
- gatewayMerchantId – Unique merchant ID. Provided while connected to Ukrgasbank system.



Google Pay data example:

token" : {
"intermediateSigningKey": {
"signatures": [
"MEUCIF5lDgdqKcRj6H+/vqJkMEwV5scrBs/8zsxDgohLILL2AiEAxr6jRqsHjDX+/31jJLCsO5HyI+cyYLbFRhpbtYC9g0c="
],
"signedKey": "{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/QkuBRMnh00PH8RyLjaZxFDQ91qz1NsmgSQ8FyErjGY//504jBKyrwLTSHjFjV/JvwG69gFXONkZGymtqi/biw==\",\"keyExpiration\":\"1634049827237\"}"
},
"protocolVersion": "ECv2",
"signature": "MEUCIQCGvikh5rdnhHwAY+jZOlfHmsIu7kjQeF1HHZteLwV3ogIgHhTk84IaO+O4tMdS8DGaaBgkPxbntQKBiXY32xIBiGU=",
"signedMessage": "{\"encryptedMessage\":\"u7DscBlGXxP5hrhy6+GT9/MMCIye9EjuzX+1xFcZyQgpxbpY5YRHGIJPN/Zeu+Ov7S2c4MQgFXapzAoMfKq4aKow/GI3l+bPvjZ/g22mzmtgRZ13hHIHlHRi5yGzbyOGhiXYDwYLEqcq/xH4cI8/+LscauGT2PZD3spCh5l4IiO9/kv97hQ6L2mztp505l3oU7JsU9CHnrWAkRzXB5rELpUEk0lyNi9B9yCnTAcKvHyLhcbYSbF4I+o2EV1cSqand5LaRUAVssoiT4WXZAj87ooenftoRPP62QarED0HpNizQoslqV9qXy4izHfBiQFrC11WecAh4S+v8kpIK4A7Vn6nr6Rq6gKBfktkRouwsiFBjBf9HGChUUWc+VStP2OdCl4Kk8gYT2BYuIecdlV1R04tbPt0wCdEwhE8FkRmT49mTNy3BOa8WyxpCzseFy2tIcvAivf49uzWTzfHdA9EGbw/bdAsnHB/NFJ7uSWm5TgZrkeNmI+iRApYJMFLENEn3b58XRqwmHfraOtrnkSSfAmfgeGsWXH0hrsnX5K7cbqPaRds0SYPhNXr7giIVzXFk1ZPSX8aC+sW\",\"ephemeralPublicKey\":\"BKO1TpD5dUBlUf5SjaOBALgyL0GiyG12m2Z9hlF3AgiY0C8OQRtYhAMRZ6axG8OKFKybZkCYgvjSWpmEJM+z+7s=\",\"tag\":\"g0smNCYWfgQYCtXb1vP2rKq1vnsrg1c7tw8GhywGRAg=\"}"
}


Received data in GooglePay token parameter, must be sent by API request to ECOM Ukrgasbank system using token parameter of ECOM system (see Appendix 1 Token ECOM use description)

The Merchant registers the transaction in the ECOM system by sending the request with payload data at the Bank's URL:
Request method: POST
Content type: application/json
Prod URL: https://ecom.ukrgasbank.com/api/v1/purchase_gpay
Test URL : https://ecom.dev.ukrgasaws.com/api/v1/purchase_gpay

Request example:
https://ecom.dev.ukrgasaws.com/api/v1/purchase_gpay ' -H 'x-auth-token: token’ (see token creation description below)

Note that while creating ECOM system token in payload - token GPAY is not used. See ECOM token creation example.


Payload for ECOM token example:
{
"order_id": "1631546152",
"merchant_name": "test_merchant",
"amount": "10.21",
"notification_url": "https://google.com",
"description": "zakaz351",
"currency": "UAH",
"browser_ip": "213.109.233.249",
"browser_timezone": "-180",
"browser_language": "en-GB",
"browser_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:88.0) Gecko/20100101 Firefox/88.0",
"browser_accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"browser_screen_width": "1792",
"browser_screen_height": "1120",
"browser_color_depth": "24",
"browser_java_enabled": "false",
}


In payload request to ECOM systemit is used according to payload parameters description table.
Table: Payload parameters description:
 

    
Parameter    
    
Description    
    
Required (yes/no)    
   
merchant_name   
   
Merchant   name   
   
yes   
   
Token   
   
Google Pay   Token parameters received by merchant   
   
yes   
   
OrderID   
   
Order/Invoice   in online store   
   
yes   
   
Amount   
   
Payment   amount. Dot separated. For example: "10.21"   
   
yes   
   
currency   
   
Transaction   currency (constant value=UAH)   
   
yes   
   
notification_url   
   
The URL to which will be redirected if the final result of the   transaction is received   
   
yes   
   
Description   
   
Order/purpose   of payment. Up to 250 characters   
   
no   
   
Browser parameters   
   
Browser parameters:
   
"browser_ip",
   
"browser_timezone",
   
"browser_language",
   
"browser_user_agent",
   
"browser_accept_header",
   
"browser_screen_width",
   
"browser_screen_height",
   
"browser_color_depth",
   
"browser_java_enabled"   
   
yes   

Payload for ECOM request example:
{
"order_id": "1631546152",
"merchant_name": "test_merchant",
"amount": "10.21",
"notification_url": "https://google.com",
"description": "zakaz351",
"currency": "UAH",
"browser_ip": "213.109.233.249",
"browser_timezone": "-180",
"browser_language": "en-GB",
"browser_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:88.0) Gecko/20100101 Firefox/88.0",
"browser_accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"browser_screen_width": "1792",
"browser_screen_height": "1120",
"browser_color_depth": "24",
"browser_java_enabled": "false",

token" : {
"intermediateSigningKey": {
"signatures": [
"MEUCIF5lDgdqKcRj6H+/vqJkMEwV5scrBs/8zsxDgohLILL2AiEAxr6jRqsHjDX+/31jJLCsO5HyI+cyYLbFRhpbtYC9g0c="
],
"signedKey": "{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/QkuBRMnh00PH8RyLjaZxFDQ91qz1NsmgSQ8FyErjGY//504jBKyrwLTSHjFjV/JvwG69gFXONkZGymtqi/biw==\",\"keyExpiration\":\"1634049827237\"}"
},
"protocolVersion": "ECv2",
"signature": "MEUCIQCGvikh5rdnhHwAY+jZOlfHmsIu7kjQeF1HHZteLwV3ogIgHhTk84IaO+O4tMdS8DGaaBgkPxbntQKBiXY32xIBiGU=",
"signedMessage": "{\"encryptedMessage\":\"u7DscBlGXxP5hrhy6+GT9/MMCIye9EjuzX+1xFcZyQgpxbpY5YRHGIJPN/Zeu+Ov7S2c4MQgFXapzAoMfKq4aKow/GI3l+bPvjZ/g22mzmtgRZ13hHIHlHRi5yGzbyOGhiXYDwYLEqcq/xH4cI8/+LscauGT2PZD3spCh5l4IiO9/kv97hQ6L2mztp505l3oU7JsU9CHnrWAkRzXB5rELpUEk0lyNi9B9yCnTAcKvHyLhcbYSbF4I+o2EV1cSqand5LaRUAVssoiT4WXZAj87ooenftoRPP62QarED0HpNizQoslqV9qXy4izHfBiQFrC11WecAh4S+v8kpIK4A7Vn6nr6Rq6gKBfktkRouwsiFBjBf9HGChUUWc+VStP2OdCl4Kk8gYT2BYuIecdlV1R04tbPt0wCdEwhE8FkRmT49mTNy3BOa8WyxpCzseFy2tIcvAivf49uzWTzfHdA9EGbw/bdAsnHB/NFJ7uSWm5TgZrkeNmI+iRApYJMFLENEn3b58XRqwmHfraOtrnkSSfAmfgeGsWXH0hrsnX5K7cbqPaRds0SYPhNXr7giIVzXFk1ZPSX8aC+sW\",\"ephemeralPublicKey\":\"BKO1TpD5dUBlUf5SjaOBALgyL0GiyG12m2Z9hlF3AgiY0C8OQRtYhAMRZ6axG8OKFKybZkCYgvjSWpmEJM+z+7s=\",\"tag\":\"g0smNCYWfgQYCtXb1vP2rKq1vnsrg1c7tw8GhywGRAg=\"}"
}



The merchant receives a response depending on the authentication method obtained by the ECOM system when decoding the GooglePay token.

Method 1:
allowedCardAuthMethods='CRYPTOGRAM_3DS' :
Response parameters: 

   
Parameter   
   
Description   
   
Value   
   
error_code   
   
ECOM system response code    
   
See list of response codes in Appendix 2   
   
error_code   
   
Need3DS   
   
Additional 3DS verification required    
   
error_description   
   
ECOM system response description    
   
See list of response codes in Appendix 2   
   
order_id   
   
unique merchant request/order ID   
   
   
   
payment_status   
   
ECOM system status    
   
"success", "error",   "processing", "created"   
   
type   
   
Transaction type   
   
purchase_gpay   
   
isNeed3DS   
   
Requirement to pass 3D Secure   verification procedure   
   
("Y" – it is necessary to pass the 3D   Secure verification procedure, "N" – additional actions are not   required   

Example of Success response:
{"data":{"error_code":"000","isNeed3DS":" N","error_description":"","order_id":"1631546152","payment_status":"success","type":"purchase_gpay"},"result":"ok"}
Example of Decline response:
{"data":{"error_code":"116","isNeed3DS":" N","error_description":"Suspected card","order_id":"1631546152","payment_status":"error","type":"purchase_gpay"},"result":"error"}

This means that ECOM system has completed the purchase operation by itself.
The request procedure is complete!!!


Method 2:
allowedCardAuthMethods='PAN_ONLY':

In this case 3D2.0 validation must be performed.

ECOM system response will be received from parameter "isNeed3DS" with "Y" value as follows:

{
"data": {
"isNeed3DS":" Y",
"acsChallengeMandated":"Y",
"acsTransID":"b0296eb6-990d-4343-8970-a1a9df665e16",
"acsURL":"https://acs2.ukrgasbank.com:443/browser",
"authenticationType":"02",
"dsTransID":"4fea3d76-a9b6-4c40-a1a2-a8a3dd327a63",
"html":"$html",
"protocolType":"mc",
"protocolVersion":"2.1.0",
"threeDSServerTransID":"aeec6c6a-b445-46d9-81da-52d1e73c42ee",
"transStatus":"C",
"xid":"ruxsarRFRtmB2lLR5zxC7jNEUzI="},
"result":"ok"
}

Received "html":"$html" page should be uploaded into client’s browser to pass 3D2.0 validation procedure.


After passing client validation procedure response Success ("transStatus":"Y") or Decline("transStatus":"N)" will be sent to "notification_url": https://google.com:

{"threeDSSessionData":"oktxRlSESBOYS53wAqowsjNEUzI=",
"cres":"eyJhY3NUcmFuc0lEIjoiMGYyMzMyMzItZTc1Ni00MGQ2LThjYjgtNDg0ODY0ZDY0YTgzIiwibWVzc2FnZVR5cGUiOiJDUmVzIiwibWVzc2FnZVZlcnNpb24iOiIyLjEuMCIsInRocmVlRFNTZXJ2ZXJUcmFuc0lEIjoiYTI0YjcxNDYtNTQ4NC00ODEzLTk4NGItOWRmMDAyYWEzMGIyIiwidHJhbnNTdGF0dXMiOiJZIn0"}

"cres" value must be decoded with Base64

Attention!!!
"cres" value at the end can be without «=», with «=» or «= =».

If you have problems with decoding by standard method, «=» should be added at the end of "cres" value.

After decoding "cres" value is as follows: {"acsTransID":"0f233232-e756-40d6-8cb8-484864d64a83",
"messageType":"CRes",
"messageVersion":"2.1.0",
"threeDSServerTransID":"a24b7146-5484-4813-984b-9df002aa30b2",
"transStatus":"Y"}






To complete the purchase_gpay operation, the following request should be done :
Request method: POST
Content type: application/json
Prod URL: https://ecom.ukrgasbank.com/api/v1/complete_gpay
Test URL : https://ecom.dev.ukrgasaws.com/api/v1/complete_gpay

Payload parameters for Сomplete_gpay request: 

   
threeds_transaction_id   
   
string   
   
"threeDSServerTransID"   response value   
   
xid   
   
string   
   
"xid”   response value   
   
OrderID   
   
string   
   
Order/Invoice in online store   
   
merchant_name   
   
string   
   
Merchant name   

Payload example:
{
"xid": "ruxsarRFRtmB2lLR5zxC7jNEUzI=",
"order_id": "1623239162",
"merchant_name": "test_merchant",
"threeds_transaction_id": "aeec6c6a-b445-46d9-81da-52d1e73c42ee"},
}
Merchant receives a response with following parameters: 

   
Parameter   
   
Description   
   
Value   
   
error_code   
   
ECOM system response code    
   
See list of response codes in Appendix 2   
   
error_code   
   
Need3DS   
   
Additional 3DS verification required    
   
error_description   
   
ECOM system response description    
   
See list of response codes in Appendix 2   
   
order_id   
   
unique merchant request/order ID   
   
   
   
payment_status   
   
ECOM system status    
   
"success", "error",   "processing", "created"   
   
type   
   
Transaction type   
   
purchase_gpay   

Example of Success response:
{"data":{"error_code":"000","error_description":"","order_id":"1631546152","payment_status":"success","type":"purchase_gpay"},"result":"ok"}
Example of Decline response:
{"data":{"error_code":"116","isNeed3DS":" N","error_description":"Suspected card","order_id":"1631546152","payment_status":"error","type":"purchase_gpay"},"result":"error"}


This means that ECOM system has completed the purchase operation by itself.
The request procedure is complete!!!




Appendix 1
Token ECOM use description:
1. For working with Ecom a merchant generates token using PrivateKey provided by the Bank and JWT sha256 sign, which must be sent with URL "-H 'x-auth-token: token’"
Example:
Example of implementation:
// To create JSONWebToken npm package must be installed .
// For example: jsonwebtoken

// npm install jsonwebtoken

// PrivateKey = "-----BEGIN RSA PRIVATE KEY-----\nMIIBOQIBAAJBANxz3BO52O+f4fLxZwzKImrso0UUz2dEprUm/+UGza8iDWa63958\n+umScgENVFJvKcP1WouCqSbRr5MEjY5UeX8CARECQGe+DTZ1k0OWiHJTe8nIiKrJ\ntj6gYZoCMFU/h3rWBnCHnyqBcvCNCHVW6n/MSpNOkZd7quGukyRUGjvrGpf8f/EC\nIQDw/eS2P8D/Qc6cgo1ULhbBw3hZYzUQZMVq040wYaWlDwIhAOougxVfkEmuayMu\n7eGrUXKeljYIuqAU2Y0AI8SptkSRAiEAjcKGiVKtw1Pi8qcl9UhJnyewNJS1zWh0\nILitZ8D4Br0CIFKnARaaMuzUJdAurk+l4ILOj15dbwtSpyK0wVR4IjZRAiEAvprZ\nkLukrTm3dNpEDX4NLbinuIh1c5Rk3HCO1oq8J7A=\n-----END RSA PRIVATE KEY-----\n\n";

function createToken(){
var PrivateKey = fs.readFileSync('private.key');
// var Timestamp = new Date().getTime();
var Timestamp = "1603972119171";

var Payload = {
"order_id" : "1532654879654698",
"redirect_url" : "https://google.com",
"version" : "1"
"amount" : "10.00",
"currency" : "UAH",
"action": : "purchase",
"description" : "",
"merchant_name" : "kyky",
"language" : "ru",
"ts": : "1603972119171"
};
var Token = jwt.sign( Payload, PrivateKey, { algorithm: 'RS256'} );

// var Token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmRlcl9pZCI6IjE1MzI2NTQ4Nzk2NTQ2OTgiLCJyZWRpcmVjdF91cmwiOiJodHRwczovL2dvb2dsZS5jb20iLCJ2ZXJzaW9uIjoiMSIsImFtb3VudCI6IjEwLjAwIiwiY3VycmVuY3kiOiJVQUgiLCJhY3Rpb24iOiJwdXJjaGFzZSIsImRlc2NyaXB0aW9uIjoiIiwibWVyY2hhbnRfbmFtZSI6Imt5a3kiLCJsYW5ndWFnZSI6InJ1IiwidHMiOiIxNjAzOTcyMTE5MTcxIn0.qKM89Ay7pNMaiI4cF2opFMg985_0QVlHeFHVR8Q_dVWQuoF5uD78wnrfi8GXl4TFFjHVFbMtuEAKZroK0dH6Ug"

var Options = {
method : "POST",
headers : {
"X-Auth-Token" : Token,
"Content-Type" : "application/json"
},
body : JSON.stringify( delete Payload.timestamp )
}

let Response = await fetch( "https://ecom.dev.ukrgasaws.com/ api/v1/purchase_apay", Options );
}

Resources with implementation examples:
https://github.com/auth0/java-jwt
https://github.com/auth0/java-jwt/blob/master/lib/src/test/java/com/auth0/jwt/JWTCreatorTest.java
https://github.com/firebase/php-jwt






Appendix 2
Action Code Ecom system 

   
error_code   
   
message   
   
Значення   
   
<<"10">>   
   
define(METHOD_NOT_ALLOWED,{200,[
   {<<"result">>, <<"error">>},
   {<<"message">>, <<"Method you have been   reqeusted not allowed.">>},
   {<<"type">>, <<"api_error">>},
   {<<"error_code">>, <<"10">>},
   {<<"data">>, [{}]}
   ]}).   
   
перелік кодів відповідей см. Табл.2   
   
<<"11">>   
   
define(WRONG_REQUEST_DATA,{200,[
   {<<"result">>, <<"error">>},
   {<<"message">>, <<"Wrong Content-Type in   request. Should be application/json.">>},
   {<<"type">>, <<"api_error">>},
   {<<"error_code">>, <<"11">>},
   {<<"data">>, [{}]}
   ]})   
   
Потрібна додаткова перевірка 3DS   
   
<<"12">>   
   
define(PATH_NOT_ALLOWED,{200,[
   {<<"result">>, <<"error">>},
   {<<"message">>, <<"API that u have been call   not exists or not allowed.">>},
   {<<"type">>, <<"api_error">>},
   {<<"error_code">>, <<"12">>},
   {<<"data">>, [{}]}
   ]})   
   
перелік відповідей см. Табл.2   
   
<<"20">>   
   
define(KEYS_ERROR(Keys),   {200,[
   {<<"result">>, <<"error">>},
   {<<"type">>, <<"validation">>},
   {<<"error_code">>, <<"20">>},
   {<<"message">>, list_to_binary( lists:foldl( fun
   ( Key, [] ) ->
   "Wrong request. Keys [ " ++ binary_to_list(Key);
   ( Key, Acc ) ->
   Acc ++ ", " ++ binary_to_list(Key)
   end, [], Keys ) ++ " ] are missing." ) },
   {<<"data">>, [{<<"keys">>,Keys}]}
   ]})   
   
   
   
<<"21">>   
   
define(TYPE_ERROR(Keys),   {200,[
   {<<"result">>, <<"error">>},
   {<<"error_code">>, <<"21">>},
   {<<"type">>, <<"validation">>},
   {<<"message">>, list_to_binary( lists:foldl( fun
   ( {Key, Type}, [] ) ->
   "Wrong request. Keys [ " ++ binary_to_list(Key)
   ++ "(" ++ atom_to_list( Type ) ++ ")";
   ( {Key, Type}, Acc ) ->
   Acc ++ ", " ++ binary_to_list(Key)
   ++ "(" ++ atom_to_list( Type ) ++ ")"
   end, [], Keys ) ++ " ] has wrong_type." ) },
   {<<"data">>, [{<<"keys">>,Keys}]}
   ]})   
   
"success", "error", "processing", "creatad"   
   
<<"22">>   
   
define(REQUIRED_ERROR(Keys),   {200,[
   {<<"result">>, <<"error">>},
   {<<"error_code">>, <<"22">>},
   {<<"type">>, <<"validation">>},
   {<<"message">>, list_to_binary( lists:foldl( fun
   ( Key, [] ) ->
   "Wrong request. Values [ " ++ binary_to_list(Key);
   ( Key, Acc ) ->
   Acc ++ ", " ++ binary_to_list(Key)
   end, [], Keys ) ++ " ] are required." )},
   {<<"data">>, [{<<"keys">>,Keys}]}
   ]})   
   
purchase_gpay   
   
<<"23">>   
   
define(REGEXP_ERROR(Keys),   {200,[
   {<<"result">>, <<"error">>},
   {<<"error_code">>, <<"23">>},
   {<<"type">>, <<"validation">>},
   {<<"message">>, list_to_binary( lists:foldl( fun
   ( Key, [] ) ->
   "Wrong request. Keys [ " ++ binary_to_list(Key);
   ( Key, Acc ) ->
   Acc ++ ", " ++ binary_to_list(Key)
   end, [], Keys ) ++ " ] contains wrong values." )},
   {<<"data">>, [{<<"keys">>,Keys}]}
   ]})   
   
<<"31">>   
   
define(NO_PROCESS_FUN,{200,[
   {<<"result">>, <<"error">>},
   {<<"message">>, <<"Processing function   doesn't exists.">>},
   {<<"type">>, <<"processing">>},
   {<<"error_code">>, <<"31">>},
   {<<"data">>, [{}]}
   ]})   
   
<<"32">>   
   
define(SERVER_ERROR,{200,[
   {<<"result">>, <<"error">>},
   {<<"message">>, <<"Somthing went wrong.   Please try again later.">>},
   {<<"type">>, <<"processing">>},
   {<<"error_code">>, <<"32">>},
   {<<"data">>, [{}]}
   ]})   
   
<<"34">>   
   
{200, #{   <<"result">> =>   <<"error">>,
   <<"message">> =>   <<"Invalid merchant name. Merchant does not exists.">>,
   <<"type">> =>   <<"processing">>,
   <<"error_code">> =>   <<"34">>,
   <<"data">> => [{}]
   }};   
   
<<"34">>   
   
{200, #{   <<"result">> =>   <<"error">>,
   <<"message">> =>   <<"Invalid authorization token.">>,
   <<"type">> =>   <<"processing">>,
   <<"error_code">> =>   <<"34">>,
   <<"data">> => [{}]
   }}.   
   
<<"36">>   
   
{200, #{   <<"data">> => [{}],
   <<"type">> =>   <<"processing">>,
   <<"result">> =>   <<"error">>,
   <<"message">> =>   <<"Not unique transaction order_id.">>,
   <<"error_code">> =>   <<"36">>
   }}   
   
Format response   
   
   
   
Response   for request purchase   
   
Positive:
   
QData = #{   <<"result">> =>   <<"ok">>,
   <<"data">> => #{
   <<"action">> =>   <<"purchase">>,
   <<"error_code">> =>   <<"000">>,
   <<"error_description">>   => <<"Approved">>
   }
   },
   
Negative:
   
QData = #{   <<"result">> =>   <<"error">>,
   <<"data">> => #{
   <<"type">> =>   <<"processing">>,
   <<"error_code">> =>   maps:get( <<"error_code">>, RData,   <<"-1">> ),
   <<"error_description">>   =>   maps:get(<<"error_description">>,RData,<<"Unknown   Error.">>)
   }
   }   

Appendix 3

Host Action Code
000 Approved Approved
001 Approved with ID Approved, honour with identification
002 Approved Approved for partial amount
003 Approved Approved for VIP
004 Approved Approved, update track 3
005 Approved Approved, account type specified by card issuer
006 Approved Approved for partial amount, account type specified by card issuer
007 Approved Approved, update ICC
080 Approved Approved, ATC check in ContactLess Magstripe transaction
100 Decline Decline (general, no comments)
101 Decline Decline, expired card
102 Decline Decline, suspected fraud
103 Decline Decline, card acceptor contact acquirer
104 Decline Decline, restricted card
105 Decline Decline, card acceptor call acquirer's security department
106 Decline Decline, allowable PIN tries exceeded
107 Decline Decline, refer to card issuer
108 Decline Decline, refer to card issuer's special conditions
109 Decline Decline, invalid merchant
110 Decline Decline, invalid amount
111 Decline Decline, invalid card number
112 Decline Decline, PIN data required
113 Decline Decline, unacceptable fee
114 Decline Decline, no account of type requested
115 Decline Decline, requested function not supported
116 Decline, no funds Decline, not sufficient funds
117 Decline Decline, incorrect PIN
118 Decline Decline, no card record
119 Decline Decline, transaction not permitted to cardholder
120 Decline Decline, transaction not permitted to terminal
121 Decline Decline, exceeds withdrawal amount limit
122 Decline Decline, security violation
123 Decline Decline, exceeds withdrawal frequency limit
124 Decline Decline, violation of law
125 Decline Decline, card not effective
126 Decline Decline, invalid PIN block
127 Decline Decline, PIN length error
128 Decline Decline, PIN key synch error
129 Decline Decline, suspected counterfeit card
180 Decline Decline, by cardholders wish
199 Decline Decline, invalid Date of Births
200 Pick-up Pick-up (general, no comments)
201 Pick-up Pick-up, expired card
202 Pick-up Pick-up, suspected fraud
203 Pick-up Pick-up, card acceptor contact card acquirer
204 Pick-up Pick-up, restricted card
205 Pick-up Pick-up, card acceptor call acquirer's security department
206 Pick-up Pick-up, allowable PIN tries exceeded
207 Pick-up Pick-up, special conditions
208 Pick-up Pick-up, lost card
209 Pick-up Pick-up, stolen card
210 Pick-up Pick-up, suspected counterfeit card
300 Call acquirer Status message: file action successful
(reserved for future use in file management messages)
301 Call acquirer Status message: file action not supported by receiver
(reserved for future use in file management messages)
302 Call acquirer Status message: unable to locate record on file
(reserved for future use in file management messages)
303 Call acquirer Status message: duplicate record, old record replaced
(reserved for future use in file management messages)
304 Call acquirer Status message: file record field edit error
(reserved for future use in file management messages)
305 Call acquirer Status message: file locked out
(reserved for future use in file management messages)
306 Call acquirer Status message: file action not successful
(reserved for future use in file management messages)
307 Call acquirer Status message: file data format error
(reserved for future use in file management messages)
308 Call acquirer Status message: duplicate record, new record rejected
(reserved for future use in file management messages)
309 Call acquirer Status message: unknown file
(reserved for future use in file management messages)
400 Accepted Accepted (for reversal)
499 Approved Approved (for reversals), no original message data
500 Call acquirer Status message: reconciled, in balance
501 Call acquirer Status message: reconciled, out of balance
502 Call acquirer Status message: amount not reconciled, totals provided
503 Call acquirer Status message: totals for reconciliation not available
504 Call acquirer Status message: not reconciled, totals provided
600 Accepted Accepted (for administrative info)
(reserved for future use in administrative messages)
601 Call acquirer Status message: impossible to trace back original transaction
(reserved for future use in administrative messages)
602 Call acquirer Status message: invalid transaction reference number
(reserved for future use in administrative messages)
603 Call acquirer Status message: reference number/PAN incompatible
(reserved for future use in administrative messages)
604 Call acquirer Status message: POS photograph is not available
(reserved for future use in administrative messages)
605 Call acquirer Status message: requested item supplied
(reserved for future use in administrative messages)
606 Call acquirer Status message: request cannot be fulfilled – required documentation is not available
(reserved for future use in administrative messages)
680 List ready List ready
(reserved for future use in administrative messages)
681 List not ready List not ready
(reserved for future use in administrative messages)
700 Accepted Accepted (for fee collection)
(reserved for future use in fee collection messages)
800 Accepted Accepted (for network management)
900 Accepted Advice acknowledged, no financial liability accepted
901 Accepted Advice acknowledged, financial liability accepted
902 Call acquirer Decline reason message: invalid transaction
903 Call acquirer Status message: re-enter transaction
904 Call acquirer Decline reason message: format error
905 Call acquirer Decline reason message: acquirer not supported by switch
906 Call acquirer Decline reason message: cutover in process
907 Call acquirer Decline reason message: card issuer or switch inoperative
908 Call acquirer Decline reason message: transaction destination cannot be found for routing
909 Call acquirer Decline reason message: system malfunction
910 Call acquirer Decline reason message: card issuer signed off
911 Call acquirer Decline reason message: card issuer timed out
912 Call acquirer Decline reason message: card issuer unavailable
913 Call acquirer Decline reason message: duplicate transmission
914 Call acquirer Decline reason message: not able to trace back to original transaction
915 Call acquirer Decline reason message: reconciliation cutover or checkpoint error
916 Call acquirer Decline reason message: MAC incorrect
917 Call acquirer Decline reason message: MAC key sync error
918 Call acquirer Decline reason message: no communication keys available for use
919 Call acquirer Decline reason message: encryption key sync error
920 Call acquirer Decline reason message: security software/hardware error - try again
921 Call acquirer Decline reason message: security software/hardware error - no action
922 Call acquirer Decline reason message: message number out of sequence
923 Call acquirer Status message: request in progress
950 Not accepted Decline reason message: violation of business arrangement
0Y1 Approved Approved in Offline. Used only in advices (1120, 1220)
0Y3 Approved Tried to go Online, not succeed, Approved in Offline. Used only in advices (1120, 1220)

Develop your own site - Click here