sayswitch-payment-sdk
v1.0.25
Published
SDK for accepting sayswitch merchant payments on react native apps
Downloads
11
Readme
Sayswitch React Native SDK for Mobile Apps
Index
1. Description
This React Native package provides an SDK to add Sayswitch Payments to your React Native applications.
2. Installation
You can pull in sayswitch-payment-sdk via npm:
npm install sayswitch-payment-sdk --save
OR
yarn add sayswitch-payment-sdk
3. Versioning
React Native <= 0.70.5.
4. Using the SDK
This gives a run down of how to make use of the Sayswitch React-Native SDK
import { PaymentSDK } from "sayswitch-payment-sdk";
<PaymentSDK
first_name={"John"}
last_name={"Doe"}
phone_number={"+23480123456789"}
email={"[email protected]"}
amount={100}
currency="NGN"
isOpen={isModalOpen} //create a local state to toggle modal
toggle={setIsModalOpen} //set local state to toggle modal
notClosable={false}
apiKey="PA-PUbtest-000111222333444555666777" // API key provided from the sayswitch merchant dashboard
encryptionKey="ebub838rh3bu38h438b48b83n83nff8aewe83r83847BBCJSJUCNWEKAAUEBFU237273823UCBBEC" //encryption key provided from the sayswitch merchant dashboard
/>;
5. Request Props
| Argument | Type | Required | | ------------- | :------: | :---------------------------------------- | | first_name | string | Yes | | last_name | string | Yes | | phone_number | string | Yes | | amount | number | Yes | | isOpen | boolean | Yes | | toggle | function | yes {typically setState for isOpen state} | | notClosable | boolean | No | | apiKey | string | yes | | encryptionKey | string | yes | | onSuccess | function | No | | onFailure | function | No |