0.0.2-development • Published 1 year ago

@urbanpiper-engineering/payment-service-sdk v0.0.2-development

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

payment-service-sdk

SDK for integrating UrbanPiper payment service into your application

Get Started

  1. Run npm install in your terminal
  2. Then run npm run build

Usage

  1. First initialize the SDK
import PgService from '@urbanpiper-engineering/payment-service-sdk';

PgService.init(params: PgService);
  1. Get the list of gateways associated for your account
const resp = await PgService.gateways();
  1. Initiate the payment with your gateway of choice e.g. Razorpay
import PgService, { RazorpayService } from '@urbanpiper-engineering/payment-service-sdk';

const resp = await PgService.initiatePayment();
const resp = await RazorpayService.openPG();
  1. Capture the payment
const resp = await RazorpayService.capturePayment();