Skip to content

Commit 44671e9

Browse files
Merge pull request #69 from Flutterwave/dev
Pull changes from the dev branch
2 parents b2cdadd + 828c4ad commit 44671e9

File tree

131 files changed

+4855
-1238
lines changed

Some content is hidden

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

131 files changed

+4855
-1238
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Developer Support Forum
4+
url: https://forum.flutterwave.com
5+
about: If you're having general trouble with your integration, Kindly contact our support team.

.github/workflows/change-review.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,51 @@
11

2-
name: Code Quality Check
2+
name: Review changes on Dev (Commits/PRs)
33

44
on:
55
push:
6-
branched: ['develop']
6+
branches: ['dev']
77
pull_request:
88
types:
99
- opened
1010

1111
jobs:
1212
version:
13-
name: Code Checks
13+
name: code-check
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: set up flutter environment
16+
- name: checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: setup flutter environment
1820
uses: subosito/flutter-action@v2
1921
with:
2022
flutter-version: '3.0.0'
2123

22-
- name: Install dependencies
24+
- name: install flutter dependencies
2325
run: flutter pub get
2426

25-
- name: Run unit tests
27+
- name: run coverage tests
2628
run: flutter test --coverage
2729

28-
- name: Install lcov
30+
- name: install lcov for coverage reporting
2931
run: sudo apt-get install -y lcov
3032

31-
- name: Remove irrelevant files from coverage
33+
- name: remove irrelevant files from coverage report
3234
run: lcov --remove coverage/lcov.info 'lib/view/*.dart' 'lib/*/*.freezed.dart' 'lib/*/*.g.dart' 'lib/*/*.part.dart' 'lib/generated/*.dart' 'lib/generated/*/*.dart' -o coverage/lcov.info
3335

34-
- name: Upload coverage report to Codecov
36+
- name: upload coverage report to Codecov
3537
uses: codecov/codecov-action@v2
3638
with:
3739
file: coverage/lcov.info
3840
token: ${{ secrets.CODECOV_TOKEN }}
3941

40-
- name: push build status to Slack
42+
- name: push build status to slack
4143
uses: 8398a7/action-slack@v3
4244
with:
4345
status: ${{ job.status }}
4446
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest
4547
env:
4648
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
49+
MATRIX_CONTEXT: ${{ toJson(matrix) }}
4750
if: always()
4851

.github/workflows/package-publish.yml

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,59 @@
1-
2-
name: Publish to Pub.dev
1+
name: Publish changes to Pub.dev
32

43
on:
5-
push:
6-
branched: ['master']
4+
release:
5+
types: [created]
76

87
jobs:
9-
version:
10-
name: Code Checks
8+
check-readme-and-changelog:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: check for changes in readme and changelog files
15+
run: |
16+
if ! git diff --quiet HEAD~ HEAD -- README.md CHANGELOG.md; then
17+
echo "README and/or CHANGELOG have been modified. Proceeding with deployment."
18+
else
19+
echo "README and/or CHANGELOG have not been modified. Terminating deployment."
20+
exit 1
21+
fi
22+
23+
- name: push build status to slack
24+
uses: 8398a7/action-slack@v3
25+
with:
26+
status: ${{ job.status }}
27+
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest
28+
env:
29+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
30+
MATRIX_CONTEXT: ${{ toJson(matrix) }}
31+
if: always()
32+
33+
publish:
34+
needs: check-readme-and-changelog
1135
runs-on: ubuntu-latest
1236
steps:
13-
- uses: actions/checkout@v2
14-
- name: set up flutter environment
37+
- name: checkout code
38+
uses: actions/checkout@v2
39+
40+
- name: setup flutter environment
1541
uses: subosito/flutter-action@v2
1642
with:
1743
flutter-version: '3.0.0'
1844

19-
- name: Install dependencies
45+
- name: install flutter dependencies
2046
run: flutter pub get
2147

22-
- name: Run unit tests
23-
run: flutter test --coverage
24-
25-
# - name: Publish to Pub.dev
26-
# run: pub publish --dry-run
48+
- name: Publish to Pub.dev
49+
run: pub publish --dry-run
2750

2851
- name: push build status to Slack
29-
uses: 8398a7/action-slack@v3
30-
with:
31-
status: ${{ job.status }}
32-
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest
33-
env:
34-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
35-
if: always()
36-
52+
uses: 8398a7/action-slack@v3
53+
with:
54+
status: ${{ job.status }}
55+
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest
56+
env:
57+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
58+
MATRIX_CONTEXT: ${{ toJson(matrix) }}
59+
if: always()

CHANGELOG.md

Lines changed: 37 additions & 16 deletions
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

Lines changed: 35 additions & 33 deletions
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

Lines changed: 7 additions & 6 deletions
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

0 commit comments

Comments
 (0)