-
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
51 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
## Seamlesss Integration with Node.js | ||
|
||
### Pre-Requisite | ||
1. Node Js installed(preferably latest version) | ||
2. Install package md5 | ||
3. Install package request | ||
4. Install package express | ||
5. Install package body-pareser | ||
6. MOLPay Development or Production ID. | ||
7. MOLPay General API. | ||
|
||
For ease of use, a demo version has been uploaded along with a sample html file and all required node modules in a zip file. | ||
If there is any trouble in using the uploaded package modules, the packages can be easily installed on windows via npm install <packagename> | ||
or you can just refer here https://www.npmjs.com/ . | ||
|
||
|
||
### Installation | ||
1. Download the app.js file | ||
2. Put app.js file in same directory with your project files. | ||
3. Open command prompt terminal,locate destination of app.js. | ||
4. Remember to change name inside app.js of 'index.html' to your own html page. (There is only 1 line with index.html) | ||
5. Run 'node app.js' to execute file. | ||
6. Open localhost based on given localhost server to access your web page. | ||
|
||
### Set Environment | ||
Set which type of enviroment to use with either sandbox or production | ||
```Javascript | ||
var enviroment = "sandbox" or "production" | ||
``` | ||
For the html demo, set the environment using the following links. | ||
|
||
For sandbox: | ||
```html | ||
<script src="https://sandbox.molpay.com/MOLPay/API/seamless/latest/js/MOLPay_seamless.deco.js"></script> | ||
``` | ||
|
||
For production | ||
```html | ||
<script src="https://www.onlinepayment.com.my/MOLPay/API/seamless/3.17/js/MOLPay_seamless.deco.js"> | ||
``` | ||
### Usage | ||
Insert values into these parameters: | ||
```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 | ||
Please request merchant ID and vkey from Merchant Technical Support / Customer Care : [email protected] . The order ID can be anything. |