Seemless Payment Request
The below API use for create seemless payment request by Http POST Method, Content-Type application/x-www-form-urlencoded
Then merchant can based on response CheckoutUrl integrate by iframe.
| Environment | URL |
|---|---|
| Staging | https://stagingpayment.share-commerce.com/seemlesspayment |
| Production | https://payment.share-commerce.com/seemlesspayment |
Request
| Field Name | Data Type (Len) | M/O | Description |
|---|---|---|---|
| MerchantID | String (50) | M | Unique merchant ID assigned to each merchant by Share Commerce |
| CurrencyCode | String (5) | M | Transaction currency |
| TxnAmount | Decimal (18,2) | M | Transaction amount |
| MerchantOrderNo | String (50) | M | Unique Order no generated in merchant system |
| MerchantOrderDesc | String (1000) | M | Order description |
| MerchantRef1 | String (100) | O | Merchant reference |
| MerchantRef2 | String (100) | O | Merchant reference |
| MerchantRef3 | String (100) | O | Merchant reference |
| CustReference | String (50) | O | Customer reference |
| CustName | String (150) | O | Customer name |
| CustEmail | String (150) | O | Customer email |
| CustPhoneNo | String (50) | O | Customer phone number |
| CustAddress1 | String (100) | O | Customer address line 1 |
| CustAddress2 | String (100) | O | Customer address line 2 |
| CustCountryCode | String (10) | O | Customer country code |
| CustAddressState | String (150) | O | Customer state |
| CustAddressCity | String (150) | O | Customer city |
| RedirectUrl | String (1000) | M | Merchant return URL once the transaction completed/failed |
| PaymentMethod | String (100) | O | Specify the payment option, thus it will redirect directly to Bank page. (Refer to Appendix 2 - Payment Method) |
| Versioning | Integer | O | API Versioning. Hard code 7. |
| SCSign | M | Message sign (Refer to below SCSign Calculation section) |
Request Sample
MerchantID=BRYAN57328&CurrencyCode=MYR&TxnAmount=1.50&MerchantOrderNo=M1734657848&MerchantOrderDesc=Perfume&MerchantRef1=mref1&MerchantRef2=mref2&MerchantRef3=mref3&CustReference=ctRefIC111&CustName=Bryan NG&CustEmail=&CustPhoneNo=&CustAddress1=&CustAddress2=&CustCountryCode=&CustAddressState=&CustAddressCity=&RedirectUrl=https://httpbin.org/anything&PaymentMethod=&Versioning=7&SCSign=a82ebd04a085c92473abfb46887f12e3ad19d6289be6deb1243f3b0e1f5d2dfd
Response (Json)
Merchant Server shall examine field RespCode to determine the actual processing response of the request.
| Field Name | Data Type (Len) | M/O | Description |
|---|---|---|---|
| RespCode | String (50) | M | Payment response code. (Refer to Appendix 1 - Response code) |
| RespMessage | String (2000) | M | Result description of seemless payment transaction. |
| MerchantID | String | M | Merchant ID |
| MerchantOrderNo | String | M | Merchant order number |
| GatewayTxnRefNo | String | M | GatewayTxnRefNo |
| CheckoutUrl | String | M | Payment checkout page url |
Response Sample
{
"RespCode": "00",
"RespMessage": "success",
"MerchantID": "BRYAN57328",
"MerchantOrderNo": "M1734657848",
"GatewayTxnRefNo": "F24C83D002A258A299",
"CheckoutUrl": "https://sandbox-checkout.share-commerce.com/Checkout/Card?CheckoutCode=e03bf325-5f12-4220-aba1-7d644b099e3b",
"Signature": "5842903c65a2b3af926510c4a1136de0ceeb828d3809d3d5690c6eafefab5a81"
}
SCSign Calculation
SCSign signature calculation, will sign with whole json string, and calculate with HMACSHA256 algorithm.
Secret Key : o4q1VRXDfBok71119uQjtS1f
Sign String (Example)
BRYAN57328MYR1.50M1734657848Perfumemref1mref2mref3ctRefIC111Bryan NGhttps://httpbin.org/anything7
SCSign (Calculated Value)
a82ebd04a085c92473abfb46887f12e3ad19d6289be6deb1243f3b0e1f5d2dfd
Post Message
Post Message Event Key: seemlesspayment86DNZK
Once the iframe retrieve response, it will post message. Merchants can retrieve the message in the following format:
Sample 1:
{"key": "seemlesspayment86DNZK", "status": "SUCCESS", "RedirectUrl": "https://httpbin.org/anything?RespCode=00&RespDesc=&MerchantID=BRYAN57328&TxnRefNo=F30B2691ECF55A85D1&CurrencyCode=USD&TxnAmount=10.00&MerchantOrderNo=1734682798250116554&MerchantOrderDesc=Perfume&MerchantRef1=&MerchantRef2=&MerchantRef3=&CustReference=&CustName=&CustEmail=&CustPhoneCountryCode=&CustPhoneNo=&CustAddress1=&CustAddress2=&CustAddressPostcode=&CustCountryCode=&CustAddressState=&CustAddressCity=&PaymentMethod=HOSTED_CARD&MaskedPAN=414901%2A%2A%2A%2A%2A%2A0527&Versioning=7&SCSign=807301a8cf8d7dd386c5d3666d341cb827219b83772bab49dd6005374cf4adad"}
Sample 2:
{"key": "seemlesspayment86DNZK", "status": "FAILED", "RedirectUrl": "https://httpbin.org/anything?RespCode=00&RespDesc=&MerchantID=BRYAN57328&TxnRefNo=F30B2691ECF55A85D1&CurrencyCode=USD&TxnAmount=10.00&MerchantOrderNo=1734682798250116554&MerchantOrderDesc=Perfume&MerchantRef1=&MerchantRef2=&MerchantRef3=&CustReference=&CustName=&CustEmail=&CustPhoneCountryCode=&CustPhoneNo=&CustAddress1=&CustAddress2=&CustAddressPostcode=&CustCountryCode=&CustAddressState=&CustAddressCity=&PaymentMethod=HOSTED_CARD&MaskedPAN=414901%2A%2A%2A%2A%2A%2A0527&Versioning=7&SCSign=807301a8cf8d7dd386c5d3666d341cb827219b83772bab49dd6005374cf4adad"}