百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

React-Native-Paystack-WebView

> 前端框架
开源

该套件允许您使用 paystack 收取付款,而且最棒的是,不需要绑定! 只需安装即可开始使用

198 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

该套件允许您使用 paystack 收取付款,而且最棒的是,不需要绑定! 只需安装即可开始使用

React Native Paystack WebView (v5)

Modern, hook-based, Paystack-powered payments in React Native apps using WebViews — now streamlined with Provider architecture & fully customizable.

Endorsed by Paystack, so you know you’re in good hands. Payment processing has never been this easy!


Installation

bash
npm install react-native-paystack-webview
# or
yarn add react-native-paystack-webview

Peer Dependency

bash
yarn add react-native-webview

# iOS
cd ios && pod install

# Expo
npx expo install react-native-webview

⚡ Quick Start

Wrap your app with the Provider

typescript
import { PaystackProvider } from 'react-native-paystack-webview';

  

Use in a component

…

Features

  • ✅ Simple checkout() or newTransaction() calls
  • ✅ Global callbacks with onGlobalSuccess or onGlobalCancel
  • ✅ Debug logging with debug prop
  • ✅ Fully typed params for transactions
  • ✅ Works seamlessly with Expo & bare React Native
  • ✅ Full test coverage
  • ✅ Zap integration

API Reference

PaystackProvider

Prop Type Default Description
publicKey string — Your Paystack public key
currency string — Currency code (optional)
defaultChannels string[] ['card'] Payment channels
deepLinkHosts (string | RegExp)[] [] Extra hosts to hand off to the OS instead of loading in the WebView (see Deep linking)
debug boolean false Show debug logs
onGlobalSuccess func — Called on all successful transactions
onGlobalCancel func — Called on all cancelled transactions

popup.checkout() / popup.newTransaction()

Param Type Required Description
email string ✅ Customer email
amount number ✅ Amount in Naira (not kobo)
reference string — Custom reference (optional)
metadata object — Custom fields / additional info
plan string — Paystack plan code (for subscriptions)
invoice_limit number — Max charges during subscription
subaccount string — Subaccount code for split payment
split_code string — Multi-split identifier
split object — Dynamic split object
onSuccess (res) => void ✅ Called on successful payment
onCancel () => void ✅ Called on cancellation
onLoad (res) => void — Triggered when transaction view loads
onError (err) => void — Triggered on WebView or script error

Meta Props

Name Description Required? Default Value
cart_id A unique identifier for the cart. Can be either a string or a number. NO undefined
custom_fields An array of custom fields for adding additional metadata to the transaction. If not passed, a default custom field is created using the firstName, lastName, and billingName. NO [{ display_name: '${firstName + ' ' + lastName}', variable_name: '${billingName}', value: '' }]
cancel_action A string specifying the action to take if a transaction is canceled. NO undefined
custom_filters Custom filters to restrict or specify transaction options, such as: NO undefined
- recurring: A boolean to indicate if the transaction is recurring.
- banks: An array of bank codes for supported banks.
- card_brands: Supported card brands, e.g., 'verve', 'visa', 'mastercard'.
- supported_mobile_money_providers: Supported mobile money providers, e.g., 'mtn', 'atl', 'vod'.

Dynamic Multi-Split Payment Object structure

Name use/description required?
type Dynamic Multi-Split type. Value can be flat or percentage YES
bearer_type Defines who bears the charges. Value can be all, all-proportional, account or subaccount YES
subaccounts An array of subaccount object as defined below. e.g. {"subaccount": 'ACCT_xxxxxx', "share": 60} YES
bearer_subaccount Subaccount code of the bearerof the transaction. It should be specified if bearer_type is subaccount NO
reference Unique reference of the split. Can be defined by the user NO

Dynamic Multi-Split Payment Sub-Account Object structure

Name use/description required?
subaccount Specify subaccount code generated from the Paystack Dashboard or API to enable Split Payment on the transaction. Here's an example of usage: subaccount: "SUB_ACCOUNTCODE" YES
share Defines the amount in percentage (integer) or value (decimal allowed) depending on the type of multi-split defined YES

Deep linking

Some payment channels need to hand off to a partner app. For example, the Zap channel renders a universal link to https://joinzap.com/app/... that should open the Zap app.

WKWebView on iOS does not perform universal-link handoff or custom-scheme dispatch for navigations that originate inside the WebView, so tapping such a link would otherwise just load it as a web page. To fix this, the provider intercepts these navigations and forwards them to the OS via Linking.openURL, which triggers the universal-link handoff (iOS) or App Links / `Int

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptarchivedmobilepaymentpayment-gateway

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架