Skip to main content

Web/Mobile Payment Transaction

note
  • Used by e-commerce and SaaS businesses for one-time purchases.

  • Demo Web Payment (Version 3): Click Here

  • Web Payment Sequence Diagram

Example of Web Payment

image

Example of Mobile Web Payment


Method : POST
URL : https://open.revenuemonster.my/v3/payment/online
Sandbox URL : https://sb-open.revenuemonster.my/v3/payment/online

note
  • To create a unified payment checkout page for your website and Mobile.
  • Data object needs to be sorted, the Nested object also needs to be sorted.

Request Parameters

ParameterTypeRequiredDescriptionExample
orderObjectYesObject of order(Refer to explanation below)
method[]StringYesRM currently supported method["WECHATPAY_MY","WECHATPAY_CN"
,"PRESTO_MY","BOOST_MY","TNG_MY" , "ALIPAY_CN","GRABPAY_MY","RAZER_MY", GOBIZ_MY]
typeStringYesObejct of type(Refer to explanation below)
storeIdStringYesID of the store to create QR code"10946114768247530"
paymentOrders[]StringOptionalSequence of the payment method tabs["WALLET","ONLINE_BANKING","CARD",
"PAY_LATER"]
redirectUrlStringYesURL to redirect after payment is made"https://google.com"
notifyUrlStringYesThis is a notify URL or callback URL to inform server on transaction status after payment made."https://google.com"
layoutVersionStringOptionalSelect layout for Web paymentV1 / V2 (Supported Credit Card)

Order object (order):
ParameterTypeRequiredDescriptionExample
titleStringYesOrder title, max: 32"Sales"
detailStringYesOrder detail, max: 600"1 x iPhone X; 2 x SAMSUNG S8"
additionalDataStringYesOrder description"Sales"
amountUintYesAmount of order in cent. Only required when "isPrefillAmount" = true. (min RM 0.10 or amount: 10)100
currencyTypeStringYesCurrency notation (currently only support MYR)"MYR"
idStringOrder ID"6170506694335521334"

Customer object (customer):
ParameterTypeRequiredDescriptionExample
userIdStringYesif tokenization enable need userId"13245876"
emailStringOptionalCustomer Email""
countryCodeStringOptionalCustomer Country Code""
phoneNumberStringOptionalCustomer Phone Number""

Type Object (type):
ParameterTypeRequiredExample
typeStringYes"WEB_PAYMENT"
typeStringYes"MOBILE_PAYMENT"

For MOBILE_PAYMENT only, please apply at application.

SDK for MOBILE_PAYMENT :-

Example Request

curl --location --request POST "{{open_base_path}}/v3/payment/online" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer {{clientToken}}" \
--header "X-Nonce-Str: XAYZRZNLGCKSTURRFKBIGYALUKLCLJOG" \
--header "X-Signature: sha256 YTTV0p1XJUllLNwAC/m430ZbteZhdBmUm3aVnKH4XEZU2yfl7liCPzEI40VqTwFcmMLByJ0mRyzc97gzVn1XZVIr1DaPpW3LUv/on82hIDhLue4uJzKg+vS8/CKJC4+SJ1NpL4rDQEg/hdq4mrNIckTN5+UCFbM4tLCDN8FanSoI3SxcfmvfBwuOc5ro4WWStJlr/LxLJWHRdI8ZpTc1gmNkzRKA9YXJI6iACrkg4cUtMkQ0nii9dHu+brKtK2gCtZ6kdPxgiykDlJuPcpHBGsG+wjNGXLxNeeZjbIl6m40dtdwwyiDbdsk/ZelN0J8Xw1rti7a7dHY/vNnN4W+tUA==" \
--header "X-Timestamp: 1547643342" \
--data "{
\"order\": {
\"title\": \"hello\",
\"detail\": \"hello\",
\"additionalData\": \"world\",
\"amount\": 100,
\"currencyType\": \"MYR\",
\"id\": \"13234353336\"
},
\"customer\": {
\"userId\": \"13245876\",
\"email\": "",
\"countryCode\": "",
\"phoneNumber\": "",
},
\"method\": [],
\"type\": \"WEB_PAYMENT\",
\"storeId\": \"977596145540933417\",
\"redirectUrl\": \"https://google.com\",
\"notifyUrl\": \"https://google.com\",
\"layoutVersion\": \"v3\"
}"

Response Parameters

ParameterTypeDescriptionExample
itemObjectitem object(Refer to explanation below)
codeStringSuccessfully call this endpoint. If fail, will return error code object (Refer Appendix 1: Error Codes)"SUCCESS"

item Object (item):
ParameterTypeDescriptionExample
checkoutIdStringCode to identify web payment url"1548316308361173347"
urlStringExample to form checkout URL. Note: to change base URL to desired URL."https://sb-pg.revenuemonster.my/checkout?checkoutId=1548316308361173347"

Example Response

{
"item": {
"checkoutId": "1548316308361173347",
"url": "https://sb-pg.revenuemonster.my/checkout?checkoutId=1548316308361173347"
},
"code": "SUCCESS"
}

Advance Options

Create individual payment checkout

After you get the url from response API, you can append a query String

Example:
https://sb-pg.revenuemonster.my/checkout?checkoutId=1548316308361173347&method=TNG_MY