Skip to content

Commit 567eda2

Browse files
committed
chore: Updated README, CHANGELOG and pubspsec to reflect changes for 1.0.4
1 parent 0c1dd91 commit 567eda2

File tree

3 files changed

+15
-43
lines changed

3 files changed

+15
-43
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.0.4
2+
* Implemented support for V2 Android embedding
3+
* Removed instances of deprecated Flutter APIs
4+
* Updated dependencies
5+
* Fixed issues #47 and #48
6+
* Deprecated callbacks in the `chargeCard` function.
7+
8+
19
## 1.0.3+1
210
* Fixed issue with wrong plugin class in pubspec.yaml (#45)
311
* Added spaces to initial string for card number field

README.md

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -97,56 +97,20 @@ You can then create a `Charge` object with the access code and card details. The
9797
expiryMonth: expiryMonth,
9898
expiryYear: expiryYear,
9999
);
100-
101-
// Using Cascade notation (similar to Java's builder pattern)
102-
// return PaymentCard(
103-
// number: cardNumber,
104-
// cvc: cvv,
105-
// expiryMonth: expiryMonth,
106-
// expiryYear: expiryYear)
107-
// ..name = 'Segun Chukwuma Adamu'
108-
// ..country = 'Nigeria'
109-
// ..addressLine1 = 'Ikeja, Lagos'
110-
// ..addressPostalCode = '100001';
111-
112-
// Using optional parameters
113-
// return PaymentCard(
114-
// number: cardNumber,
115-
// cvc: cvv,
116-
// expiryMonth: expiryMonth,
117-
// expiryYear: expiryYear,
118-
// name: 'Ismail Adebola Emeka',
119-
// addressCountry: 'Nigeria',
120-
// addressLine1: '90, Nnebisi Road, Asaba, Deleta State');
121100
}
122101
123-
_chargeCard(String accessCode) {
102+
_chargeCard(String accessCode) async {
124103
var charge = Charge()
125104
..accessCode = accessCode
126105
..card = _getCardFromUI();
127106
128-
PaystackPlugin.chargeCard(context,
129-
charge: charge,
130-
beforeValidate: (transaction) => handleBeforeValidate(transaction),
131-
onSuccess: (transaction) => handleOnSuccess(transaction),
132-
onError: (error, transaction) => handleOnError(error, transaction));
133-
}
134-
135-
handleBeforeValidate(Transaction transaction) {
136-
// This is called only before requesting OTP
137-
// Save reference so you may send to server if error occurs with OTP
138-
}
139-
140-
handleOnError(Object e, Transaction transaction) {
141-
// If an access code has expired, simply ask your server for a new one
142-
// and restart the charge instead of displaying error
143-
}
144-
145-
146-
handleOnSuccess(Transaction transaction) {
147-
// This is called only after transaction is successful
107+
final response = await PaystackPlugin.chargeCard(context, charge: charge);
108+
// Use the response
148109
}
149110
```
111+
The transaction is successful if `response.status` is true. Please, see the documentation
112+
of [CheckoutResponse](https://pub.dev/documentation/flutter_paystack/latest/flutter_paystack/CheckoutResponse-class.html)
113+
for more information.
150114

151115

152116

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_paystack
22
description: A Flutter plugin for making payments via Paystack Payment Gateway. Completely supports Android and iOS.
3-
version: 1.0.3+1
3+
version: 1.0.4
44
author: Wilberforce Uwadiegwu <faradaywilly@gmail.com>
55
homepage: https://github.com/wilburt/flutter_paystack
66

0 commit comments

Comments
 (0)