0.0.3 • Published 1 year ago

up-payment-service-sdk v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

payment-service-sdk

SDK for integrating UrbanPiper payment service into your application

Installation

Run npm install up-payment-service-sdk in your terminal

Usage

  1. First initialize the SDK
import PgService from 'up-payment-service-sdk';

PgService.init(params: PgServiceConfig);
  1. Get the list of gateways associated for your account
const resp = await PgService.gateways();
  1. 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();