-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,14 +38,35 @@ For production | |
```html | ||
<script src="https://www.onlinepayment.com.my/MOLPay/API/seamless/3.17/js/MOLPay_seamless.deco.js"> | ||
``` | ||
### Set variables | ||
Insert values into these variables: | ||
```Javascript | ||
var merchant_id = "";//Insert merchant id here | ||
var orderid = ""; // Order ID should be random generated by merchant function | ||
var vkey = "**************"; //Replace ********** with your MOLPay verification_Key | ||
``` | ||
Note: orderid should be defined by merchant function. Hardcoding method is used for convenience of testing | ||
*Note: orderid should be defined by merchant function. Hardcoding method is used for convenience of testing | ||
### Prepare Payment object detail | ||
```Javascript | ||
status = true;// Set True to proceed with MOLPay | ||
mpsmerchantid = merchant_id; | ||
mpschannel = req.body.payment_options; | ||
mpsamount = req.body.total_amount; | ||
mpsorderid = orderid; //Order ID should be a random generated value by merchant | ||
mpsbill_name = req.body.billingFirstName + " " + req.body.billingLastName; | ||
mpsbill_email = req.body.billingEmail; | ||
mpsbill_mobile = req.body.billingMobile; | ||
mpsbill_desc = req.body.billingAddress; | ||
mpscountry = "MY"; | ||
mpsvcode = md5(req.body.total_amount + merchant_id + orderid + vkey); | ||
mpscurrency = req.body.currency; | ||
mpslangcode = "en"; | ||
mpstimer = req.body.molpaytimer; | ||
mpstimerbox = "#counter"; | ||
mpsreturnurl = "http://127.0.0.1:8080/returnurl"; // Enter your return url here | ||
mpscancelurl = "http://127.0.0.1:8080/cancelurl"; // Enter your cancel url here | ||
mpsapiversion = "latest"; //**NOTE: For production use '3.17' / Sandbox use 'latest' | ||
``` | ||
Please request merchant ID and vkey from Merchant Technical Support / Customer Care : [email protected] . The order ID can be anything. |