An open API service indexing awesome lists of open source software.

https://github.com/seerbit/seerbit-react-native


https://github.com/seerbit/seerbit-react-native

Last synced: about 1 year ago
JSON representation

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