@charge-after/sdk
v1.4.28
Published
---
Maintainers
Readme
ChargeAfter payment SDK
Installing
npm install --save @charge-after/sdkGetting Started
import { prequalify, checkout } from "@charge-after/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
});;