Request
The Payment Request is acceptable with HTTPS GET or POST method.
Staging URL: https://stagingpayment.share-commerce.com/payment
Production URL: https://payment.share-commerce.com/payment
| 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 | M | API Versioning. Hard code 7. |
| SCSign | M | Message sign (Refer to below SCSign Calculation section) |
Legend:
M: Mandatory field.
O: Optional field. Value can be empty, but parameter must exist.
Request Sample (Http POST)
<html>
<body>
<form method="POST" name="payment" action="https://stagingpayment.share-commerce.com/payment" >
<input type="hidden" name="MerchantID" value="MID00001">
<input type="hidden" name="CurrencyCode" value="MYR">
<input type="hidden" name="TxnAmount" value="101.50">
<input type="hidden" name="MerchantOrderNo" value="POST0001">
<input type="hidden" name="MerchantOrderDesc" value="perfume">
<input type="hidden" name="MerchantRef1" value="mref1">
<input type="hidden" name="MerchantRef2" value="mref2">
<input type="hidden" name="MerchantRef3" value="mref3">
<input type="hidden" name="CustReference" value="ctRefIC111">
<input type="hidden" name="CustName" value="TomTom">
<input type="hidden" name="CustEmail" value="[email protected]">
<input type="hidden" name="CustPhoneNo" value="01938668396">
<input type="hidden" name="CustAddress1" value="add1">
<input type="hidden" name="CustAddress2" value="add2">
<input type="hidden" name="CustCountryCode" value="MY">
<input type="hidden" name="CustAddressState" value="semenyih">
<input type="hidden" name="CustAddressCity" value="selangor">
<input type="hidden" name="RedirectUrl" value="https://www.MerchantRedirectURL.com">
<input type="hidden" name="PaymentMethod" value="CARD">
<input type="hidden" name="Versioning" value="6">
<input type="hidden" name="SCSign" value="9a07b085345f78949ebbdcc936f6b3cd97a17f7083e2c94617914b30a59a7bc4">
<input type="submit" value="Submit">
</form>
</body>
</html>
Request Sample (Http GET)
https://stagingpayment.share-commerce.com/Payment
?MerchantID=MID00001
&CurrencyCode=MYR
&TxnAmount=101.50
&MerchantOrderNo=POST0001
&MerchantOrderDesc=Perfume
&MerchantRef1=mref1
&MerchantRef2=mref2
&MerchantRef3=mref3
&CustReference=ctRefIC111
&CustName=TomTom
&CustEmail=tomt%40email.com
&CustPhoneNo=01938668396
&CustAddress1=add1
&CustAddress2=add2
&CustCountryCode=MY
&CustAddressState=semenyih
&CustAddressCity=Selangor
&RedirectUrl=https%3A%2F%2Fwww.MerchantRedirectURL.com
&PaymentMethod=CARD
&Versioning=6
&SCSign=9a07b085345f78949ebbdcc936f6b3cd97a17f7083e2c94617914b30a59a7bc4
*Note, above is one line string url.
SCSign Calculation
SCSign generation will concat all the above Table Field's value (in sequence), with HMACSHA256.
*IMPORTANT - the sign string is NOT the same length for every merchant. PaymentMethod and Versioning are only included in the concatenation when the request's own Versioning value is high enough. If your Versioning is omitted or below the threshold, DROP that field from the string entirely - do not include it as an empty value, and do not skip a position; the field is simply not part of the string at all.
Your Versioning value |
Is PaymentMethod in the sign string? |
Is Versioning in the sign string? |
|---|---|---|
| Omitted, 0, or 1 | No | No |
| 2 | No | Yes |
| 3 or higher (6 recommended for this page's classic flow) | Yes | Yes |
Concat all the value (refer to Sample) - this example uses Versioning 6, so both
PaymentMethodandVersioningare included:String to sign :
MID00001MYR101.50POST0001perfumemref1mref2mref3ctRefIC111TomTomtomt@email.com01938668396add1add2MYsemenyihselangorhttps://www.MerchantRedirectURL.comCARD6
Calculate with HMACSHA256
Secret Key : mSuE3Ttn5B8vJhe5ncMutMLV
SCSign : 9a07b085345f78949ebbdcc936f6b3cd97a17f7083e2c94617914b30a59a7bc4
Worked examples for older/legacy Versioning values
Same field values as above, but showing exactly what changes in the sign string as Versioning drops below 3.
Versioning omitted, 0, or 1 -
PaymentMethodANDVersioningare both dropped from the string entirely:
MID00001MYR101.50POST0001perfumemref1mref2mref3ctRefIC111TomTomtomt@email.com01938668396add1add2MYsemenyihselangorhttps://www.MerchantRedirectURL.com
SCSign : 7cc5dd56354aeddb89a4123b2f163d87bbade4f79f59b36105475fdc218f4930
Versioning = 2 -
Versioningis included,PaymentMethodis still dropped:
MID00001MYR101.50POST0001perfumemref1mref2mref3ctRefIC111TomTomtomt@email.com01938668396add1add2MYsemenyihselangorhttps://www.MerchantRedirectURL.com2
SCSign : b8feaa620ce67fa176ccf87e8b483f1ce8af02d51d131bce77f6b4f84431bdf2
Response
Refer to the section PAYMENT > Response Redirect / Callback > 1. Response Sample (Redirect)