Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilberforce Uwadiegwu authored Mar 14, 2021
1 parent 3fbf5bd commit b62bcc7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import 'package:flutter_paystack/flutter_paystack.dart';
class _PaymentPageState extends State<PaymentPage> {
var publicKey = '[YOUR_PAYSTACK_PUBLIC_KEY]';
final plugin = PaystackPlugin();
@override
void initState() {
PaystackPlugin.initialize(
publicKey: publicKey);
plugin.initialize(publicKey: publicKey);
}
}
```
Expand Down Expand Up @@ -57,7 +57,7 @@ There are two ways of making payment with the plugin.
..reference = _getReference()
// or ..accessCode = _getAccessCodeFrmInitialization()
..email = '[email protected]';
CheckoutResponse response = await PaystackPlugin.checkout(
CheckoutResponse response = await plugin.checkout(
context context,
method: CheckoutMethod.card, // Defaults to CheckoutMethod.selectable
charge: charge,
Expand All @@ -67,11 +67,11 @@ There are two ways of making payment with the plugin.
Please, note that an `accessCode` is required if the method is
`CheckoutMethod.bank` or `CheckoutMethod.selectable`.

`PaystackPlugin.checkout()` returns the state and details of the
`plugin.checkout()` returns the state and details of the
payment in an instance of `CheckoutResponse` .


It is recommended that when `PaystackPlugin.checkout()` returns, the
It is recommended that when `plugin.checkout()` returns, the
payment should be
[verified](https://developers.paystack.co/v2.0/reference#verify-transaction)
on your backend.
Expand All @@ -86,7 +86,7 @@ You can choose to initialize the payment locally or via your backend.
on your backend.

1.b If everything goes well, the initialization request returns a response with an `access_code`.
You can then create a `Charge` object with the access code and card details. The `charge` is in turn passed to the ` PaystackPlugin.chargeCard()` function for payment:
You can then create a `Charge` object with the access code and card details. The `charge` is in turn passed to the `plugin.chargeCard()` function for payment:

```dart
PaymentCard _getCardFromUI() {
Expand All @@ -104,7 +104,7 @@ You can then create a `Charge` object with the access code and card details. The
..accessCode = accessCode
..card = _getCardFromUI();
final response = await PaystackPlugin.chargeCard(context, charge: charge);
final response = await plugin.chargeCard(context, charge: charge);
// Use the response
}
```
Expand All @@ -115,7 +115,7 @@ for more information.


#### 2. Initialize Locally
Just send the payment details to `PaystackPlugin.chargeCard`
Just send the payment details to `plugin.chargeCard`
```dart
// Set transaction params directly in app (note that these params
// are only used if an access_code is not set. In debug mode,
Expand Down

0 comments on commit b62bcc7

Please sign in to comment.