Skip to content

Pubkey standard init #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<p align="center">
<img title="Flutterwave" height="200" src="https://flutterwave.com/images/logo-colored.svg" width="50%"/>
<img title="Flutterwave" height="200" src="https://flutterwave.com/images/logo-colored.svg" width="50%"/>
</p>


# React Native Flutterwave
Easily implement Flutterwave for payments in your React Native appliction. This library supports both Android and iOS, and use the Flutterwave's V3 API
Easily implement Flutterwave for payments in your React Native appliction. This library supports both Android and iOS, and use the Flutterwave's V3 API.

[![V2 API](https://img.shields.io/badge/API-V3-brightgreen)](https://developer.flutterwave.com/docs) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

Expand All @@ -19,6 +19,7 @@ Easily implement Flutterwave for payments in your React Native appliction. This
- [Installation](#installation)
- [Dependencies](#dependencies)
- [Activity Indicator (Android)](#activity-indicator-only-needed-for-android)
- [Merchant Piblic Key](#fire-merchant-public-key-fire)
- [Important Information](#fire-important-information-fire)
- Usage
- [PayWithFlutterwave ](#flutterwave-button)
Expand Down Expand Up @@ -70,6 +71,9 @@ dependencies {
}
````

### :fire: MERCHANT PUBLIC KEY :fire:
In order to use this library you are required to use your merchant public key and not the secret key. See how to get your API Keys [here](https://developer.flutterwave.com/v3.0/docs/api-keys)

### :fire: IMPORTANT INFORMATION :fire:
If the `options` property on [PayWithFlutterwave](#paywithflutterwaveprops-interface) changes, when next the user taps on the button a new payment will be initialized whether the last one was successful or not.

Expand All @@ -94,7 +98,7 @@ import {PayWithFlutterwave} from 'flutterwave-react-native';
onRedirect={handleOnRedirect}
options={{
tx_ref: transactionReference,
authorization: '[merchant secret key]',
authorization: '[merchant public key]',
customer: {
email: 'customer-email@example.com'
},
Expand Down Expand Up @@ -159,7 +163,7 @@ try {
// initialize payment
const paymentLink = await FlutterwaveInit({
tx_ref: generateTransactionRef(),
authorization: '[your merchant secret Key]',
authorization: '[your merchant public Key]',
amount: 100,
currency: 'USD',
customer: {
Expand All @@ -183,7 +187,7 @@ try {
[See Interface](#flutterwaveinitoptions-interface)
| Name | Required | Type | Default | Description |
| --------- | --------- | ---- | ------- | ----------- |
| authorization | Yes | string | **REQUIRED** | Your merchant secret key, see how to get your [API Keys](https://developer.flutterwave.com/v3.0/docs/api-keys)|
| authorization | Yes | string | **REQUIRED** | Your merchant public key, see how to get your [API Keys](https://developer.flutterwave.com/v3.0/docs/api-keys)|
| tx_ref | Yes | string | **REQUIRED** | Your transaction reference. This MUST be unique for every transaction.|
| amount | Yes | string | **REQUIRED** | Amount to charge the customer. |
| currency | No | string | NGN | Currency to charge in. Defaults to NGN. |
Expand Down
2 changes: 1 addition & 1 deletion dist/PaywithFlutterwaveBase.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/configs.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* V# API Standard initialization endpoint
*/
export declare const STANDARD_URL = "https://api.flutterwave.com/v3/payments";
export declare const STANDARD_URL = "https://api.flutterwave.com/v3/sdkcheckout/payments";
/**
* Redirect URL used in V3 FlutterwaveButton
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/configs.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/configs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* V# API Standard initialization endpoint
*/
export var STANDARD_URL = 'https://api.flutterwave.com/v3/payments';
export var STANDARD_URL = 'https://api.flutterwave.com/v3/sdkcheckout/payments';
/**
* Redirect URL used in V3 FlutterwaveButton
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/utils/CustomPropTypesRules.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export declare const PaymentOptionsPropRule: (options: Array<string>) => (props: {
export declare const PaymentOptionsPropRule: (options: string[]) => (props: {
[k: string]: any;
}, propName: string) => Error | null;
//# sourceMappingURL=CustomPropTypesRules.d.ts.map
2 changes: 1 addition & 1 deletion dist/utils/CustomPropTypesRules.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/AbortingPaymentInitialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MyCart extends React.Component {
const paymentLink = await FlutterwaveInit(
{
tx_ref: generateTransactionRef(),
authorization: '[merchant secret key]',
authorization: '[merchant public key]',
amount: 100,
currency: 'USD',
customer: {
Expand Down
2 changes: 1 addition & 1 deletion src/configs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* V# API Standard initialization endpoint
*/
export const STANDARD_URL = 'https://api.flutterwave.com/v3/payments';
export const STANDARD_URL = 'https://api.flutterwave.com/v3/sdkcheckout/payments';

/**
* Redirect URL used in V3 FlutterwaveButton
Expand Down