up-payment-service-sdk
v0.0.3
Published
SDK for UrbanPiper Payment service
Downloads
2
Maintainers
Readme
payment-service-sdk
SDK for integrating UrbanPiper payment service into your application
Installation
Run npm install up-payment-service-sdk
in your terminal
Usage
- First initialize the SDK
import PgService from 'up-payment-service-sdk';
PgService.init(params: PgServiceConfig);
- Get the list of gateways associated for your account
const resp = await PgService.gateways();
- Process the payment with your gateway of choice e.g. Razorpay
import PgService, { RazorpayService } from 'up-payment-service-sdk';
// init payment
const resp = await PgService.initPayment(params: InitPayment);
// init razorpay class
const rzp = new RazorpayService(params: RazorpayServiceConstructor);
// open pg
const resp = await rzp.openPG(params: OpenPG);
// capture payment
const resp = await rzp.capturePayment();