
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-native-paystack-popup
Advanced tools
A super simple and lightweight react-native package for accepting payments using paystack. Doesn't require any form of linking, just install and start using.
Add React-Native-Paystack-Popup to your project by running:
npm install react-native-paystack-popup
or
yarn add react-native-paystack-popup
This package is dependent on react-native-webview. Install the dependency by running the following command on your terminal:
yarn add react-native-webview
or
npm install react-native-webview
import React, { useRef } from 'react';
import {
View,
Button,
} from 'react-native';
import PaystackWebView from 'react-native-paystack-popup';
const App = () => {
const ref = useRef(null);
const [showPayment, setShowPayment] = React.useState(false);
return (
<View style={{ flex: 1, alignItems:"center", justifyContent:"center" }}>
{!showPayment && <Button onPress={()=>{
setShowPayment(true)
}} title="Checkout" />}
{showPayment && <PaystackWebView
ref={ref}
onError={() => {
setShowPayment(false);
alert("Failed...")
}}
metadata={{ custom_fields: [{ display_name: "Demo Checkout" }] }}
onDismissed={() => {
ref.current.reload(); //reload if dismissed.
}}
onSuccess={(response) => {
setShowPayment(false);
alert(`Transaction successful: ${response.reference}`)
}}
paystackKey={"pk_xxxx-xxxx-xxxx-xxxx"} customerEmail={"abel@example.com"} amount={6000 * 100} />}
</View>
);
};
| Property | Required | Description |
|---|---|---|
| paystackKey | Yes | Paystack Public Key |
| customerEmail | Yes | Customer email address |
| amount | Yes | Amount (in the lowest currency value - kobo, pesewas or cent) |
| currency | No | Currency charge should be performed in. It defaults to NGN |
| label | No | String that replaces customer email as shown on the checkout form |
| metadata | No | Object containing any extra information you want recorded with the transaction. Fields within the custom_field object will show up on customer receipt and within the transaction information on the Paystack Dashboard. |
| channels | No | An array of payment channels to control what channels you want to make available to the user to make a payment with. Available channels include; ['card', 'bank', 'ussd', 'qr', 'mobile_money', 'bank_transfer'] |
| transactionRef | No | Unique case sensitive transaction reference. Only -,., =and alphanumeric characters allowed. If you do not pass this parameter, Paystack will generate a unique reference for you. |
| onError | No | Error callback function - failed loading paystack |
| onDismissed | No | Callback function for when user dismisses / cancels the payment |
| onSuccess | No | Callback function with a response parameter when payment was successfully completed. |
| indicatorColor | No | Color name for the default loading indicator |
| renderIndicator | No | Override this function and return a component to change the default loading indicator |
This project is actively maintained by the following developers:
For more information and usage guidelines, check the Examples App.
If you encounter any problem using this library, open a new issue
If you want to make contribution to this library:
Your PR will reviewed and merged!
FAQs
A simple react-native webview library for paystack
We found that react-native-paystack-popup demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.