Api For Ecpay Channel Documentation: Release 0.2.0-Alpha
Api For Ecpay Channel Documentation: Release 0.2.0-Alpha
Release 0.2.0-alpha
XCHAIN Devs
3 Search 5
i
ii
CHAPTER
ONE
Channel sends Transaction ID, Amount along with another parameter passed as “d” which is a message digest
(SHA256) of the two parameters mentioned. See Message Digest Section
Additional Headers:
name value
Authorization Token <Access Token>
Parameters:
Responses:
Code Description
200 Transaction is Valid
400 Invalid Data. Check params and/or digest
401 Invalid Authorization. Check Headers
404 Payment Not Found
1
API for ECPay Channel Documentation, Release 0.2.0-alpha
1.1.1 Example
Request:
https://<domain>/api/v1/channels/ecpay/?txn_id=PPG7PO5D7&amount=2000.00&
˓→d=d79861cdf0b49a33502e5b2bba0b4dfecc729f643326d9cf643278448b0f40aa
Response:
CODE 200 OK
{
"success": "Transaction valid"
"details": "EA34gFv56LOpwksl12MsdEaC"
}
Message Digest
To create the digest take the txn_id, name_mobile, amount parameters and join/concatenate them using the colon(:) as
delimiter
Example:
PPG7PO5D7:2000.00
import hashlib
digest = hashlib.sha256('PPG7PO5D7:2000.00').hexdigest()
print digest
Output:
af65df80b8dfde27a195f6f882159694235d4d1fd3b9c23e868e612f41fc38ee
TWO
Once transaction has been processed pass the Transaction ID along with the details parameter
URL Endpoint: api/v1/channels/ecpay/
Method: POST
Additional Headers:
name value
Authorization Token <Access Token>
Responses:
Code Description
200 Transaction/Payment Updated
400 Invalid Data.
401 Invalid Authorization. Check Headers
404 Payment Not Found
3
API for ECPay Channel Documentation, Release 0.2.0-alpha
2.1.1 Example
Request:
{
"txn_id": "PPG7PO5D7",
"status": "success",
"remarks": "",
"details": "EA34gFv56LOpwksl12MsdEaC"
}
Response:
Code: 200 OK
{
"msg": "Transaction Updated"
"status": "sucess"
}
THREE
SEARCH
• search