0.0.35 • Published 4 days ago

@asyncpay/checkout v0.0.35

Weekly downloads
-
License
BSL-1.0
Repository
github
Last release
4 days ago

Asyncpay Checkout SDK

This SDK allows you to seamlessly connect to multiple payment channels such as Flutterwave, Paystack and Stripe and create a checkout experience with only one integration.

Demo

You can see a demo of our checkout experience here: https://asyncpay.io/demo

Requirements

  1. An Asyncpay account - Head to Asyncpay to create an account and gain access to your dashboard.
  2. Connect your payment Channels - The dashboard provides you a means to connect your multiple payment channels to your business. Create accounts on the payment channels you wish to integrate and provide your keys on the dashboard.
  3. Integrate this SDK - After connecting the payment channels you can initialize payments with the Asyncpay public key found on your dashboard.

Steps for Integrating this SDK

  1. To install this SDK, run the npm command
$ npm install @asyncpay/checkout
  1. The SDK exports a function that can be invoked at anytime to load a checkout experience.
import {AsyncpayCheckout} from "@asyncpay/checkout";

AsyncpayCheckout({
    publicKey:
        "async_skt_960e42272225b293eb0ebb2d4d164f12ee12f78d5ed3b2deb75d065a7bef",
    email: "info@asyncpay.io",
    amount: 450,
});

You can trigger the function on the click of a button or the submission of a form to initiate the checkout experience.

Available Checkout Options

Listed below are the available config options for the AsyncpayCheckout function exported by the checkout SDK.

publicKey, amount, description, customerEmail, customerUUID, subscriptionPlanUUID, customer, paymentChannel, successURL, cancelURL, onCancel, onError, onSuccess, logo,

NameRequiredDescription
publicKeytrueThe public key of your business gotten from the Asyncpay dashboard.
amounttrue but not considered when subscriptionPlanUUID is presentThe amount you want to charge the user.
currencyfalse but not considered when subscriptionPlanUUID is presentThe amount you want to charge the user.
descriptionfalse but not considered when subscriptionPlanUUID is presentThe description of the transaction.
customerEmailrequired if customerUUID and customer is absentThe email of the customer you want to charge.
customerUUIDrequired if customerEmail and customer is absentThe UUID of the customer you want to charge.
subscriptionPlanUUIDfalse prohibits amount, currency and descriptionThe UUID of the subscription plan you want to subscribe your customer to.
customerrequired if customerEmail and customerUUID is absentThe customer object of the customer. Using this option would create a customer on the user.
referencefalseA uniquely generated reference to be tied to the payment request for your checkout session.
paymentChannelfalseThe payment channel you want to route the payment to. If you set a value here, the checkout goes staright to that payment channel without giving the user a choice.
successURLfalseThe url to redirect the user to after a successful payment.
cancelURLfalseThe url to redirect the customer to if the user cancels the checkout page.
onCancelfalseA javascript function to call after the user cancels the checkout page.
onClosefalseA javascript function to call whenever the checkout page closes irrespective of why the checkout page closed.
onErrorfalseA javascript function to call whenever there is an error during the checkout process. An argument with a type of Error would be supplied to describe the error.
onSuccessfalseA javascript function to call after the user has successfully completed checkout.
logofalseThe logo to show up on the payment page if you want to override the logo set on the dashboard.

Available Customer Object Options

The table below shows the properties that can be attached to a customer object if you choose to use that to initialize a payment request with the SDK.

NameRequired
firstNametrue
lastNametrue
emailtrue
phoneCodeRequired if email is absent
phoneNumberRequired if email is absent
addressLine1false
addressLine2false
cityfalse
statefalse
countryfalse
zipfalse

Support

Feel free to send a message to info@asyncpay.io for any support regarding using this SDK or create an issue on Github

0.0.34

4 days ago

0.0.35

4 days ago

0.0.33

7 months ago

0.0.30

7 months ago

0.0.31

7 months ago

0.0.32

7 months ago

0.0.26

9 months ago

0.0.27

9 months ago

0.0.28

7 months ago

0.0.29

7 months ago

0.0.20

12 months ago

0.0.21

12 months ago

0.0.22

12 months ago

0.0.23

12 months ago

0.0.24

11 months ago

0.0.25

11 months ago

0.0.19

12 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

12 months ago

0.0.13

12 months ago

0.0.12

12 months ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago