How to Integrate
Integration is super easy and can be done within minutes. Yes, it's true. You'll be provided with app_id and app_secret once you've signed up as merchant in our dashboard.
Step 01
Use app_secret to sign the JWT token for your transaction
Step 02
Call https://paymal.cc/payment/payment_providers?app_id=your_app_id&token=your_generated_token and now your application is ready to accept all the supported payments.
Alternately, https://paymal.cc/payment/payment_providers/type_or_code?app_id=your_app_id&token=your_generated_token to go directly into specific payment.
Generating token
Sign the following JSON as JWT token using the app_secret provided
{
"iat": "current_time_stamp",
"exp": "expiry_time",
"app_id": "app_id",
"order_id": "your_order_id",
"amount": 1000,
"country_code": "mm",
"amount_info": {
"mm" : 1000,
"th" : 10,
"my" : 2
},
"title": "Your IAP Title",
"additional_info": "Any%2SEncoded%2SString",
"signature": "ForExtraSecurity"
}
iat: Current time stamp in 10 digits format Eg: 1686414265
exp: Expiry time stamp in 10 digits format. Eg: 1687414272
app_id: app_id provided from us for your application
order_id: Unique random string that must have at-least 12 characters in length
amount: Main amount information to be shown in the main page
country_code: Default country code to be shown as default currency
amount_info: Multi-currency information if you're targeting more than one countries
title: Title of your In App Purchase
additional_info: Any additional info about your order. Note: Special characters must be encoded
signature: HMAC SHA256 signature (Using app_secret key) of all fields values sorted alphabetically by the field names. (Optional)
Example Signature keys: additional_info + amount + app_id + country_code + exp + iat + order_id + title
Note: You can use HMAC Generator online at https://codebeautify.org/hmac-generator to test the HMAC hash generator for signature field.
Sample JWT Token. You can use https://jwt.io to see live data of your JSON in JWT Token format.
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNjkzOTI0ODc5IiwiZXhwIjoiMTY5NDkyNDg3OSIsImFwcF9pZCI6Ik5KSjgwNTMiLCJvcmRlcl9pZCI6Im9yZGVyMDAxIiwiYW1vdW50IjoxMDAwLCJjb3VudHJ5X2NvZGUiOiJtbSIsImFtb3VudF9pbmZvIjp7Im1tIjoxMDAwLCJ0aCI6MTAsIm15IjoyfSwidGl0bGUiOiJJdGVtIiwiYWRkaXRpb25hbF9pbmZvIjoiYXBwbGljYXRpb25faWQlMlM2NGI1NjQzNWU4ZTllMzAyZjgzZDhhNDciLCJzaWduYXR1cmUiOiI5YmVkYzE1ZGRkNmViZWU2YjcyZjU0NDA3YzJkMTk4ZTc2NGY5NzhhYTQxYWRlOGFkZWM5N2IzYWVmMDU5ODEwIn0.QD-hvfO-k0V2sQlHqb--P9C0cdwP247CBgHEBtuWeBE