https://github.com/seerbit/seerbit-react-native
https://github.com/seerbit/seerbit-react-native
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/seerbit/seerbit-react-native
- Owner: seerbit
- License: mit
- Created: 2020-11-23T13:34:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-17T13:30:14.000Z (over 1 year ago)
- Last Synced: 2025-04-08T22:23:06.660Z (about 1 year ago)
- Language: TypeScript
- Size: 106 MB
- Stars: 1
- Watchers: 0
- Forks: 6
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Seerbit React Native WebView SDK
Seerit React Native SDK can be used to integrate the SeerBit payment gateway into your react native application.
## Requirements
Register for a merchant account on [Seerbit Merchant Dashboard](https://dashboard.seerbitapi.com) to get started.
## Installation
```bash
npm install seerbit-react-native
npm install react-native
npm install react-native-webview
```
```bash
yarn add seerbit-react-native
yarn add react-native
yarn add react-native-webview
```
## API Documentation
https://doc.seerbit.com
## Support
If you have any problems, questions or suggestions, create an issue here or send your inquiry to developers@seerbit.com
## Usage
You should already have your API keys, If not, go to Accounts -> Settings Section -> API Keys section on [dashboard.seerbitapi.com](https://dashboard.seerbitapi.com).
```js
import React, { useRef, useState } from 'react';
import Seerbit, { ISeerbit } from 'seerbit-react-native'
import { View } from 'react-native';
export default function App() {
const [amount, setAmount] = useState('20');
const seerBitCheckoutRef = useRef(null);
const startPay = () => {
seerBitCheckoutRef.current?.startPayment();
}
const paymentSuccessful = (resp: any) => {
//RETURNS A RESPONSE OBJECT
// {
// code: '00',
// message: 'APPROVED',
// payments: {},
// reference: {},
// }
//HERE YOU CAN MANAGE CLOSING AND RESTARTING A PAYMENT USING THE seerBitCheckout REFERENCE
//seerBitCheckoutRef.current?.endPayment()
//seerBitCheckoutRef.current?.startPayment()
// THIS CLOSES THE CHECKOUT IMMEDIATELY A PAYMENT IS SUCCESSFUL
seerBitCheckoutRef.current?.endPayment();
// YOU CAN ALSO DELAY AND DO SOME OTHER LOGIC BEFORE CLOSING THE CHECKOUT
// setTimeout(() => {
// seerBitCheckoutRef.current?.endPayment();
// }, 2000);
};
return (
{
paymentSuccessful(response)
}}
onCancel={() => {} }
recurrent={false} // Recurrent Payment
planId="" // Subscription Plan ID
productId="" //Product ID
customization={{
theme: {
border_color: "#000000",
background_color: "#004C64",
button_color: "#0084A0",
},
payment_method: ["card", "account", "transfer", "wallet", 'ussd'],
confetti: true, // default true;
}}
callbackurl={'https://google.com'}
setAmountByCustomer={false}
onError={() => { console.log('onError=++++=') }}
/>
)
}
```
## License
MIT