Skip to content

Commit 828c4ad

Browse files
Merge pull request #68 from Dekunledev/dev
Clean up and updates to dependencies and modification of the Flutterwave.charge() charge
2 parents b91968e + 4fff661 commit 828c4ad

File tree

128 files changed

+4791
-1205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+4791
-1205
lines changed

CHANGELOG.md

+37-16
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,52 @@
1+
## [1.1.0] | 2025-04-10
2+
3+
### Version Changes
4+
5+
- Modified `Flutterwave.charge()` method to accept a BuildContext parameter.
6+
- Added context.mounted checks to prevent setState calls after widget disposal.
7+
- Enhanced success status check logic to handle different status values ("success" and "completed").
8+
- Improved error handling and state management.
9+
- Removed deprecated components: `flutterwave_style.dart` and `standard_webview.dart`.
10+
- Updated SDK requirements to `>=2.17.0`.
11+
- Upgraded dependencies to latest versions.
12+
- Removed unused dependencies: webview_flutter, modal_bottom_sheet and uuid.
13+
114
## [1.0.7] - February, 2023
2-
* Fixed iOS bug where webview couldn't close when close buttons are clicked
3-
* Removed required `name` and `phone number` fields in `Customer` object
15+
16+
- Fixed iOS bug where webview couldn't close when close buttons are clicked
17+
- Removed required `name` and `phone number` fields in `Customer` object
418

519
## [1.0.6] - October, 2022
6-
* Fixed bug where transaction gets stuck after redirecting on webview
7-
* Fixed iOS build bug by removing inAppBrowser library
20+
21+
- Fixed bug where transaction gets stuck after redirecting on webview
22+
- Fixed iOS build bug by removing inAppBrowser library
823

924
## [1.0.5] - October, 2022
10-
* Fixed null when transaction is cancelled.
11-
* Removed modal pop up before launching web view.
12-
* Removed intermediate make payment screen before webview.
13-
* Deprecated FlutterwaveStyle.
14-
* Updated README file.
25+
26+
- Fixed null when transaction is cancelled.
27+
- Removed modal pop up before launching web view.
28+
- Removed intermediate make payment screen before webview.
29+
- Deprecated FlutterwaveStyle.
30+
- Updated README file.
1531

1632
## [1.0.4] - July 4, 2022
17-
* Renamed property `isDebug` to `isTestMode`
18-
* Made property `redirectUrl` required
19-
* Updated README file
33+
34+
- Renamed property `isDebug` to `isTestMode`
35+
- Made property `redirectUrl` required
36+
- Updated README file
2037

2138
## [1.0.3] - October 4, 2021.
22-
* Fixed issue with webview
39+
40+
- Fixed issue with webview
2341

2442
## [1.0.2] - September 23, 2021.
25-
* Fixed bug where cancel payment buttons are not clickable on iOS devices.
43+
44+
- Fixed bug where cancel payment buttons are not clickable on iOS devices.
2645

2746
## [1.0.1] - September 14, 2021.
28-
* Fixed bug where response is not returned to initiating screen when user cancels transaction.
47+
48+
- Fixed bug where response is not returned to initiating screen when user cancels transaction.
2949

3050
## [1.0.0] - September 9, 2021.
31-
* Initial release
51+
52+
- Initial release

README.md

+35-33
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
2-
31
<p align="center">
42
<img title="Flutterwave" height="200" src="https://flutterwave.com/images/logo/full.svg" width="50%"/>
5-
</p>
3+
</p>
64

75
# Flutterwave Flutter SDK (Standard)
86

97
The Flutter library helps you create seamless payment experiences in your dart mobile app. By connecting to our modal, you can start collecting payment in no time.
108

11-
129
Available features include:
1310

14-
- Collections: Card, Account, Mobile money, Bank Transfers, USSD, Barter.
11+
- Collections: Card, Account, Mobile money, Bank Transfers, USSD.
1512
- Recurring payments: Tokenization and Subscriptions.
1613
- Split payments
1714

18-
1915
## Table of Contents
2016

2117
1. [Requirements](#requirements)
@@ -25,26 +21,24 @@ Available features include:
2521
5. [Contribution guidelines](#contribution-guidelines)
2622
6. [License](#license)
2723

28-
2924
## Requirements
3025

3126
1. Flutterwave for business [API Keys](https://developer.flutterwave.com/docs/integration-guides/authentication)
3227
2. Supported Flutter version >= 1.17.0
33-
28+
3. Dart SDK >= 2.17.0
29+
4. For Android: Ensure NDK version >= 27.0.12077973 on your project's android/app/build.gradle.kts file with android { ndkVersion = "27.0.12077973" }
3430

3531
## Installation
3632

37-
1. Add the dependency to your project. In your `pubspec.yaml` file add: `flutterwave_standard: 1.0.7`
33+
1. Add the dependency to your project. In your `pubspec.yaml` file add: `flutterwave_standard: 1.1.0`
3834
2. Run `flutter pub get`
3935

40-
4136
## Usage
4237

4338
### Initializing a Flutterwave instance
4439

4540
To create an instance, you should call the Flutterwave constructor. This constructor accepts a mandatory instance of the following:
4641

47-
- The calling `Context`
4842
- `publicKey`
4943
- `Customer`
5044
- `amount`
@@ -58,41 +52,48 @@ To create an instance, you should call the Flutterwave constructor. This constru
5852

5953
It returns an instance of Flutterwave which we then call the async method `.charge()` on.
6054

61-
_
55+
\_
6256

63-
handlePaymentInitialization() async {
57+
handlePaymentInitialization() async {
6458
final Customer customer = Customer(
6559
name: "Flutterwave Developer",
66-
phoneNumber: "1234566677777",
67-
68-
);
60+
phoneNumber: "1234566677777",
61+
62+
);
6963
final Flutterwave flutterwave = Flutterwave(
70-
context: context, publicKey: "Public Key-here",
71-
currency: "currency-here",
72-
redirectUrl: "add-your-redirect-url-here",
73-
txRef: "add-your-unique-reference-here",
74-
amount: "3000",
75-
customer: customer,
76-
paymentOptions: "ussd, card, barter, payattitude",
64+
publicKey: "Public Key-here",
65+
currency: "currency-here",
66+
redirectUrl: "add-your-redirect-url-here",
67+
txRef: "add-your-unique-reference-here",
68+
amount: "3000",
69+
customer: customer,
70+
paymentOptions: "ussd, card, bank transfer",
7771
customization: Customization(title: "My Payment"),
7872
isTestMode: true );
79-
}
8073

81-
### Handling the response
74+
final ChargeResponse response = await flutterwave.charge(context);
8275

83-
Calling the `.charge()` method returns a `Future` of `ChargeResponse` which we await for the actual response as seen above.
76+
// Handle the response
77+
if (response.success == true) {
78+
// Payment was successful
79+
} else {
80+
// Payment failed or was cancelled
81+
}
82+
}
8483

84+
### Handling the response
8585

86+
Calling the `.charge()` method returns a `Future` of `ChargeResponse` which we await for the actual response as seen above.
8687

87-
final ChargeResponse response = await flutterwave.charge();
88+
final ChargeResponse response = await flutterwave.charge(context);
8889

89-
Call the verify transaction [endpoint](https://developer.flutterwave.com/docs/verifications/transaction) with the `transactionID` returned in `response.transactionId` or the `txRef` you provided to verify transaction before offering value to customer
90+
Call the verify transaction [endpoint](https://developer.flutterwave.com/docs/transaction-verification) with the `transactionID` returned in `response.transactionId` or the `txRef` you provided to verify transaction before offering value to customer
9091

9192
#### Note
9293

9394
- `ChargeResponse` can be null, depending on if the user cancels the transaction by pressing back.
94-
- You need to confirm the transaction is successful. Ensure that the txRef, amount, and status are correct and successful. Be sure to [verify the transaction details](https://developer.flutterwave.com/docs/verifications/transaction) before providing value.
95-
- Some payment methods are not instant, such a `Pay with Bank Transfers, Pay with Bank`, and so you would need to rely on [webhooks](https://developer.flutterwave.com/docs/integration-guides/webhooks) or call the transaction verification service using the [`transactionId`](https://developer.flutterwave.com/reference/endpoints/transactions#verify-a-transaction), or transaction reference you created(`txRef`)
95+
- You need to confirm the transaction is successful. Ensure that the txRef, amount, and status are correct and successful. Be sure to [verify the transaction details](https://developer.flutterwave.com/docs/transaction-verification) before providing value.
96+
- Some payment methods are not instant, such a `Pay with Bank Transfers, Pay with Bank`, and so you would need to rely on [webhooks](https://developer.flutterwave.com/docs/webhooks) or call the transaction verification service using the [`transactionId`](https://developer.flutterwave.com/reference/verify-transaction), or transaction reference you created(`txRef`)
9697
- For such long payments like the above, closing the payment page returns a `cancelled` status, so your final source of truth has to be calling the transaction verification service.
9798

9899
## Support
@@ -119,8 +120,9 @@ Copyright (c) Flutterwave Inc.
119120
- [fluttertoast](https://pub.dev/packages/fluttertoast)
120121

121122
<a id="references"></a>
122-
## Flutterwave API References
123123

124-
- [Flutterwave API Doc](https://developer.flutterwave.com/docs)
125-
- [Flutterwave Inline Payment Doc](https://developer.flutterwave.com/docs/flutterwave-inline)
124+
## Flutterwave API References
125+
126+
- [Flutterwave API Doc](https://developer.flutterwave.com)
127+
- [Flutterwave Inline Payment Doc](https://developer.flutterwave.com/docs/inline)
126128
- [Flutterwave Dashboard](https://dashboard.flutterwave.com/login)

example/.gitignore

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
13+
migrate_working_dir/
1114

1215
# IntelliJ related
1316
*.iml
@@ -26,19 +29,17 @@
2629
.dart_tool/
2730
.flutter-plugins
2831
.flutter-plugins-dependencies
29-
.packages
3032
.pub-cache/
3133
.pub/
3234
/build/
3335

34-
# Web related
35-
lib/generated_plugin_registrant.dart
36-
3736
# Symbolication related
3837
app.*.symbols
3938

4039
# Obfuscation related
4140
app.*.map.json
4241

43-
# Exceptions to above rules.
44-
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
42+
# Android Studio will place build artifacts here
43+
/android/app/debug
44+
/android/app/profile
45+
/android/app/release

example/.metadata

+22-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled.
4+
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 85684f9300908116a78138ea4c6036c35c9a1236
8-
channel: stable
7+
revision: "c23637390482d4cf9598c3ce3f2be31aa7332daf"
8+
channel: "stable"
99

1010
project_type: app
1111

1212
# Tracks metadata for the flutter migrate command
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
17-
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
16+
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
17+
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
1818
- platform: android
19-
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
20-
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
19+
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
20+
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
21+
- platform: ios
22+
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
23+
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
24+
- platform: linux
25+
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
26+
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
27+
- platform: macos
28+
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
29+
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
30+
- platform: web
31+
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
32+
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
33+
- platform: windows
34+
create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
35+
base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
2136

2237
# User provided section
2338

example/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# flutterwave_beta
1+
# example
22

33
A new Flutter project.
44

@@ -8,9 +8,9 @@ This project is a starting point for a Flutter application.
88

99
A few resources to get you started if this is your first Flutter project:
1010

11-
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
11+
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
1313

14-
For help getting started with Flutter, view our
15-
[online documentation](https://flutter.dev/docs), which offers tutorials,
14+
For help getting started with Flutter development, view the
15+
[online documentation](https://docs.flutter.dev/), which offers tutorials,
1616
samples, guidance on mobile development, and a full API reference.

example/analysis_options.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ linter:
1313
# The lint rules applied to this project can be customized in the
1414
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
1515
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
16+
# and their documentation is published at https://dart.dev/lints.
1817
#
1918
# Instead of disabling a lint rule for the entire project in the
2019
# section below, it can also be suppressed for a single line of code

example/android/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ gradle-wrapper.jar
55
/gradlew.bat
66
/local.properties
77
GeneratedPluginRegistrant.java
8+
.cxx/
89

910
# Remember to never publicly share your keystore.
10-
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
# See https://flutter.dev/to/reference-keystore
1112
key.properties
1213
**/*.keystore
1314
**/*.jks

0 commit comments

Comments
 (0)