@snag-solutions/payments-sdk v0.1.1-alpha.0
Snag Solutions Payments SDK
Install
npm i @snag-solutions/payments-sdk
Usage
To create a checkout session and redirect user for a payment
await new PaymentSDK().checkout({
name: '', // Name of the item
description: '', // Description of the item
images: [''], // Array of urls of image of the item
amount: 0, // Amount in cents
currency: 'usd', // Currency shortcut name
shippingRate: '', // Shipping Rate ID
successUrl: '', // Where to redirect on success
cancelUrl: '', // Where to redirect on failure
tokenId: 1, // Id of the token
})
To get the details from the sessionId returned on each success/failure (it will be returned in query as session_id)
await new PaymentSDK().sessionDetails(sessionId)
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago