General integration steps
These are the general integration steps; the integration methods differ only in the input fields.
Source demo:
Integration Keys:
Signature Salt (SHA256)
GALAXY PAY will provide
Use for Signature
API Key
GALAXY PAY will provide
Use for Authenticate
Note:
API Key and Salt Signature will differ between UAT and PRODUCTION environment.
Message structure:
Service: REST API
HTTP Method: POST
Content Type: application/json
The Request structure:
1
Header
APIKey
Key for authentication request.
Provided by GALAXY PAY.
Signature
Request signature, created with SHA256 & Salt
Accept
Accept encoding: application/json
Content-Type
Request content type: application/json
2
Body
JSON content
General integration steps
Step 1: APIKey & Salt:
APIKey: Use for Authentication
Salt: Use for Signature
GALAXY PAY will provide. If you don’t have an API Key & Salt, use: https://uat-demo.galaxypay.vn/documents#auth
Step 2: Signature Algorithm:
Apply hash algorithm SHA256 with Salt.
Signature = SHA256(SignData + Salt)
Sample Code
// JavaScript Example
var salt = "GO@2021";
// JSON Data (JSON Object)
var request =
{
"requestID": "14653fa1-2f69-4f4f-9d4b-240e1bebbdf3",
"requestDateTime": 20220426083322,
"requestData": {
"apiOperation": "PAY",
"orderID": "2a43e4b9-c5df-49e6-8b18-42af9bcd150e",
"orderNumber": 205249008064,
"orderAmount": 100000,
"orderCurrency": "VND",
"orderDateTime": 20220426083322,
"orderDescription": "DEMO TRANSACTION",
"paymentMethod": "DOMESTIC",
"sourceType": "970400",
"language": "vi"
}
};
// JSON String (JSON Serialized as string)
// {"requestID":"14653fa1-2f69-4f4f-9d4b-240e1bebbdf3","requestDateTime":20220426083322,"requestData":{"apiOperation":"PAY","orderID":"2a43e4b9-c5df-49e6-8b18-42af9bcd150e","orderNumber":205249008064,"orderAmount":100000,"orderCurrency":"VND","orderDateTime":20220426083322,"orderDescription":"DEMO TRANSACTION","paymentMethod":"DOMESTIC","sourceType":"970400","language":"vi"}}
var signData = JSON.stringify(request);
// require('crypto-js');
// signature = SHA256(signData + salt)
// b4b7cb5596680bb343f399922fc32e63fd69191c573e83c0383fd734531eab03
var signature = crypto.SHA256(signData + salt).toString();
You can test Signature in API Playground
Step 3: Send request message
View the request fields for each integration method here
Step 4: Receive response message
View the response fields for each integration method here
Last updated