@chargeafter/payment-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.4.20 • Public • Published

ChargeAfter payment SDK


Installing

npm install --save @chargeafter/payment-sdk

Getting Started

import { prequalify, checkout } from "@chargeafter/payment-sdk";

// open modal to obtain available credit
prequalify({
    config: {
        env: {
            name?: "production" | "sandbox", // defaults to "production"
            apiKey: "<your api key>",
        }
    },
    ...
}).then((result: CompletionApplyData)  => {
    // Fires when apply flow finished
}).catch((ex: { code: String, message: string, data: CompletionApplyData }) => {
    // Fires when apply flow finishes un-successfully
});

// open modal to perform full checkout
checkout({
    config: {
        env: {
            name?: "production" | "sandbox", // defaults to "production"
            apiKey: "<your api key>",
        }
    },
    cartDetails: ...
    ...
}).then((result: CompletionCheckoutData)  => {
    // Fires when apply flow finished
}).catch((ex: { code: String, message: string, data: CompletionCheckoutData }) => {
    // Fires when apply flow finishes un-successfully
});;

Check Docs for detailed callback interface for apply and checkout

Package Sidebar

Install

npm i @chargeafter/payment-sdk

Weekly Downloads

177

Version

1.4.20

License

none

Unpacked Size

37.6 kB

Total Files

22

Last publish

Collaborators

  • kostat