@asyncpay/checkout-react-native

中文文档
0.0.5发布于 2026/07/03BSL-1.0TypeScriptESM + CJS近 30 天下载 2.2万

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.

原始使用文档
文档目录6 节
  1. Demo
  2. Requirements
  3. Steps for Integrating this SDK
  4. Available Checkout Options
  5. Available Customer Object Options
  6. Support

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. Install the SDK and its peer dependencies:
$ npm install @asyncpay/checkout-react-native react-native-webview

OR

$ yarn add @asyncpay/checkout-react-native react-native-webview

Note: react-native-webview is a required peer dependency. If you use Expo, it is included in the Expo SDK; otherwise run npx pod-install after installing on iOS.

  1. The SDK exports a Customizable button Component
import { CheckoutButton } from '@asyncpay/checkout-react-native';

<CheckoutButton
  publicKey="${YOUR_ASYNC_PAY_PUBLIC_KEY}"
  amount={10000}
  currency={'NGN'}
  customer={{
    email: '[email protected]',
    first_name: 'John',
    last_name: 'Doe',
  }}
/>;
  1. The SDK exports a custom hook
import { useCheckout } from '@asyncpay/checkout-react-native';
import { StyleSheet, Text, TouchableOpacity } from 'react-native';

const Checkout = () => {
  const { _handleCheckout, Modal } = useCheckout({
    amount: 10000,
    currency: 'NGN',
    customer: {
      email: '[email protected]',
    },
    publicKey: '${YOUR_ASYNC_PAY_PUBLIC_KEY}',
  });

  return (
    <>
      <TouchableOpacity
        style={styles.buttonContainer}
        onPress={_handleCheckout}
      >
        <Text style={styles.text}>Press me</Text>
      </TouchableOpacity>
      <Modal />
    </>
  );
};

const styles = StyleSheet.create({
  buttonContainer: {
    width: '90%',
    height: heightPercentageToDP(5),
    backgroundColor: '#1059bc',
    alignItems: 'center',
    justifyContent: 'center',
    borderRadius: 10,
    marginVertical: heightPercentageToDP(5),
  },
  text: {
    color: '#fff',
    fontSize: 16,
    fontWeight: 'bold',
  },
});

Available Checkout Options

Listed below are the available config options for the AsyncpayCheckout button and hook.

publicKey, amount, description, customer_email, customer_uuid, subscription_plan_uuid, customer, paymentChannel, onError, onSuccess, logo, buttonStyle, buttonTextStyle, buttonTitle

NameRequiredDescription
publicKeytrueThe public key of your business gotten from the Asyncpay dashboard.
amounttrue but not considered when subscription_plan_uuid is presentThe amount you want to charge the user.
currencyfalse but not considered when subscription_plan_uuid is presentThe amount you want to charge the user.
descriptionfalse but not considered when subscription_plan_uuid is presentThe description of the transaction.
customer_emailrequired if customer_uuid and customer is absentThe email of the customer you want to charge.
customer_uuidrequired if customer_email and customer is absentThe UUID of the customer you want to charge.
subscription_plan_uuidfalse prohibits amount, currency and descriptionThe UUID of the subscription plan you want to subscribe your customer to.
customerrequired if customer_email and customer_uuid is absentThe customer object of the customer. Using this option would create a customer on the user.
metadatafalseAn object that can be used to add metadata to the checkout. It expects an object whose keys and values are strings.
save_payment_methodfalseThis flag determines whether the payment method used for this checkout should be saved on Asyncpay. Saving this method for the customer allows you to initiate a charge later on the saved payment method.
referencefalseA uniquely generated reference to be tied to the payment request for your checkout session.
payment_channelfalseThe 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.
buttonStylefalseFor Styling the checkout button.
buttonTextStylefalseFor styling the checkout text .
onCancelfalseA javascript function to call after the user cancels the checkout page.
buttonTitlefalseSet The a custom title for the checkout button.
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
first_nametrue
last_nametrue
emailtrue
phone_codeRequired if email is absent
phone_numberRequired if email is absent
address_line_1false
address_line_2false
cityfalse
statefalse
countryfalse
zipfalse

Support

Feel free to send a message to [email protected] for any support regarding using this SDK or create an issue on Github

版本与发布记录

@asyncpay/checkout-react-native 共发布 5 个版本,首次发布于 2024/12/28;过去 12 个月发布了 2 个版本。

版本发布日期距今
0.0.5latest2026/07/034 个月前
0.0.42026/06/274 个月前
0.0.32025/03/261.6 年前
0.0.22025/03/261.6 年前
0.0.12024/12/281.9 年前

关于 @asyncpay/checkout-react-native 的常见问题

@asyncpay/checkout-react-native 是什么?

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.

如何安装 @asyncpay/checkout-react-native?

在项目目录运行 npm install @asyncpay/checkout-react-native,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、react-native(*)、react-native-webview(>=13.12.5)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@asyncpay/checkout-react-native 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@asyncpay/checkout-react-native 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@asyncpay/checkout-react-native 可以商用吗?

@asyncpay/checkout-react-native 使用 BSL-1.0 许可。声明的许可为 BSL-1.0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@asyncpay/checkout-react-native 的下载量有多少?

根据 npm 官方下载统计,@asyncpay/checkout-react-native 在 2026/10/07 – 2026/11/05 这 30 天内被下载 21,560 次,日均约 719 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@asyncpay/checkout-react-native 还在维护吗?

最新版本 0.0.5 发布于 2026/07/03(4 个月前);至今共发布 5 个版本,其中过去 12 个月发布了 2 个;首次发布于 2024/12/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。