NodeJs
#
Run from demo code- Install nodejs on you computer.
- Check your nodejs working with your computer by using
- clone Ksher nodejs repository by
- cd into clone source code and Install dependencies package by
- Change configuration
host
andtoken
by edit at path/example/setting.json
- Start server by
note
Demo code is base on KOA Framework
you can learn more from https://github.com/koajs/koa
- Enter http://localhost:3000/demo.html will display demo website
Alterative way you can call API localhost over postman by
POST over http://localhost:3000/api/orderCreate
with Request Body
#
Advance Config Running Code#
1. Install only SDKYou can use package manager to install ksher-pay SDK.
#
1.1. npmVisit our npm at here https://www.npmjs.com/package/ksher-pay
#
1.2. yarn#
2. configuration data#
2.1 Prepare the configuration data#
2.2. Import the SDK#
3. Redirect API#
3.1. Initialize redirect SDK#
3.2. Redirect API Create new order#
3.3. Redirect API Query order status#
3.4. Redirect Refund#
4. alipay miniapp API#
4.1. Initialize miniapp SDK#
4.2. Create new order for alipay miniapp#
4.2.1. Get orderStr#
4.2.2. Pay in alipay miniapp#
5. C scan B API#
5.1. Initialize C scan B SDK#
5.2. C scan B API Create new order#
5.3. C scan B API Query order status#
5.4. C scan B Refund#
6. B scan C API#
6.1. Initialize B scan C SDK#
6.2. B scan C API Create new order#
6.3. B scan C API Query order status#
6.4. B scan C Refund#
7. Verify signatureVerify signature from the webhook request
#
8. ReferenceThe source code of the SDK is hosted in github, you are welcome to raise issue and PR.