├── .gitignore ├── images ├── demo.png ├── duitnow-logo.png ├── duitnow-values.png └── massage-chair.jpeg ├── .env.example ├── package.json ├── readme.md ├── index.html └── app.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .env 3 | .DS_Store 4 | package-lock.json -------------------------------------------------------------------------------- /images/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natsu90/duitnowqr-razer/HEAD/images/demo.png -------------------------------------------------------------------------------- /images/duitnow-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natsu90/duitnowqr-razer/HEAD/images/duitnow-logo.png -------------------------------------------------------------------------------- /images/duitnow-values.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natsu90/duitnowqr-razer/HEAD/images/duitnow-values.png -------------------------------------------------------------------------------- /images/massage-chair.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/natsu90/duitnowqr-razer/HEAD/images/massage-chair.jpeg -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | 2 | DUITNOW_VENDOR=890087 3 | DUITNOW_ACCOUNT= 4 | DUITNOW_MERCHANT_CATEGORY=7372 5 | DUITNOW_MERCHANT_NAME="DUITNOW.SS.MY" # to display in bank statement 6 | DUITNOW_REF82= 7 | 8 | RAZER_SECRET_KEY= -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "duitnowqr-razer", 3 | "version": "1.0.0", 4 | "description": "DuitNow QR Realtime Notification Demo", 5 | "main": "app.js", 6 | "scripts": { 7 | "start": "node app.js" 8 | }, 9 | "author": "Sulaiman Sudirman", 10 | "license": "MIT", 11 | "dependencies": { 12 | "dotenv": "^16.3.1", 13 | "duitnow-js": "gist:f45dc88b38a037325ad9095163b82b42", 14 | "easyqrcodejs-nodejs": "^4.4.5", 15 | "ejs": "^3.1.9", 16 | "express": "^4.18.2", 17 | "express-formidable": "^1.2.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## DuitNow QR Realtime Notification Demo 3 | 4 | Proof of concept of Gintell Rest N Go massage chair transaction using DuitNow QR 5 | 6 |  7 | 8 | ### Demo 9 | 10 | [http://duitnow.ss.my](http://duitnow.ss.my) 11 | 12 |  13 | 14 | 1. A unique order ID is assigned to the webpage each time it is loaded. 15 | 16 | 2. A DuitNow QR code is dynamically generated with the order ID imprinted. 17 | 18 | 3. The IPN webhook will try to catch any DuitNow payment that matched the order ID. 19 | 20 | 4. If there is any payment with the matched order ID, the webhook will pass a necesary message and trigger a popup to the opened webpage earlier. 21 | 22 | ### Prerequisites 23 | 24 | 1. SSM Company Registration Number 25 | 2. [Razer Merchant Account](https://booster.merchant.razer.com) 26 | 27 | ### Installation 28 | 29 | 1. `npm install` 30 | 31 | 2. `cp .env.example .env` 32 | 33 | 3. Fill up `.env` 34 | 35 | ``` 36 | DUITNOW_ACCOUNT= 37 | DUITNOW_REF82= 38 | RAZER_SECRET_KEY= 39 | ``` 40 | 41 | 4. `npm run start` 42 | 43 | 5. Set Notification URL to `http://your-app-url/ipn`, and tick Enable Instant Payment Notification (IPN) checkbox in [Razer Merchant Portal](https://portal.merchant.razer.com) in Transactions > Settings 44 | 45 | ### Getting DUITNOW_ACCOUNT & DUITNOW_REF82 value 46 | 47 | 1. Login to [Razer Merchant Portal](https://portal.merchant.razer.com) 48 | 49 | 2. Go to Payment Link > Generate Static QR-Code 50 | 51 | 3. Fill up Channel (DuitNow QR Offline), Currency (MYR), & Order ID / Item ID (any value does not matter but keep it in mind), then click Generate Preview 52 | 53 | 4. Scan the generated QR code with a QR reader app 54 | 55 | 5. Paste the QR string into a notepad 56 | 57 | 6. Grab `DUITNOW_ACCOUNT` value between `0014A000000615000101068900870228` and `5204737253034585802MY` (in my case it is `0000000000000000000000091507`) 58 | 59 | 7. Grab `DUITNOW_REF82` value between your Order ID / Item ID value earlier + `8232` and last 8 characters (in my case it is `47FCECA2796DDB8C0D63753C1131BD85`) 60 | 61 |  62 | 63 | ### Limitations 64 | 65 | 1. Money is not credited directly to bank account 66 | 67 | 2. Minimum RM100 settlement 68 | 69 | 3. Transaction fee 0.85% 70 | 71 | 4. Annual fee RM99/year, waived 1st year 72 | 73 | ### License 74 | 75 | Licensed under the [MIT license](http://opensource.org/licenses/MIT) 76 | 77 | 78 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |Order ID: <%= refid %>
22 |