Skip to content

Commit 7d8584f

Browse files
authored
Merge pull request #16 from Flutterwave/release/1.0.4
Release/1.0.4
2 parents b3b0494 + 90f772b commit 7d8584f

30 files changed

+362
-337
lines changed

CHANGELOG.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
## [1.0.0] - September 9, 2021.
2-
* Initial release
1+
## [1.0.4] - July 4, 2022
2+
* Renamed property `isDebug` to `isTestMode`
3+
* Made property `redirectUrl` required
4+
* Updated README file
5+
6+
## [1.0.3] - October 4, 2021.
7+
* Fixed issue with webview
38

9+
## [1.0.2] - September 23, 2021.
10+
* Fixed bug where cancel payment buttons are not clickable on iOS devices.
411

512
## [1.0.1] - September 14, 2021.
6-
* Fix bug where response is not returned to initiating screen when user cancels transaction.
13+
* Fixed bug where response is not returned to initiating screen when user cancels transaction.
714

8-
## [1.0.2] - September 23, 2021.
9-
* Fix bug where cancel payment buttons are not clickable on iOS devices.
15+
## [1.0.0] - September 9, 2021.
16+
* Initial release

README.md

+134-117
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,149 @@
1-
<p align="center">
2-
<img title="Flutterwave" height="200" src="https://flutterwave.com/images/logo/full.svg" width="50%"/>
3-
</p>
41

5-
# Flutterwave Flutter(Standard) SDK
2+
<p align="center">
3+
<img title="Flutterwave" height="200" src="https://flutterwave.com/images/logo-colored.svg" width="50%"/>
4+
</p>
65

7-
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.
6+
# Flutterwave Flutter Standard SDK
87

9-
Available features include:
8+
## Table of Contents
109

11-
- Collections: Card, Account, Mobile money, Bank Transfers, USSD, Barter.
12-
- Recurring payments: Tokenization and Subscriptions.
13-
- Split payments
10+
- [About](#about)
11+
- [Getting Started](#getting-started)
12+
- [Usage](#usage)
13+
- [Deployment](#deployment)
14+
- [Built Using](#build-tools)
15+
- [References](#references)
16+
- [Support](#support)
1417

15-
## Table of Contents
18+
<a id="about"></a>
19+
## About
20+
Flutterwave's Flutter SDK is Flutterwave's offical flutter sdk to integrate Flutterwave's [Standard](https://developer.flutterwave.com/docs/flutterwave-standard) payment into your flutter app. It comes with a ready made Drop In UI.
21+
22+
23+
24+
<a id="getting-started"></a>
1625

17-
1. [Requirements](#requirements)
18-
2. [Installation](#installation)
19-
3. [Usage](#usage)
20-
4. [Support](#support)
21-
5. [Contribution guidelines](#contribution-guidelines)
22-
6. [License](#license)
26+
## Getting Started
2327

28+
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See [deployment](#deployment) for notes on how to deploy the project on a live system.
29+
See [references](#references) for links to dashboard and API documentation.
2430

2531
## Requirements
32+
- Ensure you have your test (and live) [API keys](https://developer.flutterwave.com/docs/api-keys).
33+
``` Flutter version >= 1.17.0 Flutterwave version 3 API keys ```
2634

27-
1. Flutterwave for business [API Keys](https://developer.flutterwave.com/docs/integration-guides/authentication)
28-
2. Supported Flutter version >= 1.17.0
35+
## Installation Add the dependency
2936

30-
## Installation
37+
In your `pubspec.yaml` file add:
3138

32-
1. Add the dependency to your project. In your `pubspec.yaml` file add: `flutterwave_standard: 1.0.2`
33-
2. Run `flutter pub get`
39+
1. `flutterwave_standard: ^1.0.4`
40+
2. run `flutter pub get`
41+
<a id="usage"></a>
3442

3543
## Usage
3644

37-
### Initializing a Flutterwave instance
38-
39-
To create an instance, you should call the Flutterwave constructor. This constructor accepts a mandatory instance of the following:
40-
41-
- The calling `Context`
42-
- `publicKey`
43-
- `Customer`
44-
- `amount`
45-
- `currency`
46-
- `email`
47-
- `fullName`
48-
- `txRef`
49-
- `isTestMode`
50-
- `paymentOptions`
51-
- `Customization`
52-
53-
It returns an instance of Flutterwave which we then call the async method `.charge()` on.
54-
55-
```dart
56-
_handlePaymentInitialization() async {
57-
final style = FlutterwaveStyle(
58-
appBarText: "My Standard Blue",
59-
buttonColor: Color(0xffd0ebff),
60-
appBarIcon: Icon(Icons.message, color: Color(0xffd0ebff)),
61-
buttonTextStyle: TextStyle(
62-
color: Colors.black,
63-
fontWeight: FontWeight.bold,
64-
fontSize: 18,
65-
),
66-
appBarColor: Color(0xffd0ebff),
67-
dialogCancelTextStyle: TextStyle(
68-
color: Colors.redAccent,
69-
fontSize: 18,
70-
),
71-
dialogContinueTextStyle: TextStyle(
72-
color: Colors.blue,
73-
fontSize: 18,
74-
)
75-
);
76-
final Customer customer = Customer(
77-
name: "FLW Developer",
78-
phoneNumber: "1234566677777",
79-
email: "[email protected]");
80-
81-
final Flutterwave flutterwave = Flutterwave(
82-
context: context,
83-
style: style,
84-
publicKey: "Public Key,
85-
currency: "RWF",
86-
txRef: "unique_transaction_reference",
87-
amount: "3000",
88-
customer: customer,
89-
paymentOptions: "ussd, card, barter, payattitude",
90-
customization: Customization(title: "Test Payment"),
91-
isTestMode: true);
92-
}
93-
```
94-
95-
96-
### Handling the response
97-
98-
Calling the `.charge()` method returns a Future of `ChargeResponse` which we await for the actual response as seen above.
99-
100-
```dart
101-
final ChargeResponse response = await flutterwave.charge();
102-
if (response != null) {
103-
print(response.toJson());
104-
if(response.success) {
105-
Call the verify transaction endpoint with the transactionID returned in `response.transactionId` to verify transaction before offering value to customer
106-
} else {
107-
// Transaction not successful
108-
}
109-
} else {
110-
// User cancelled
111-
}
112-
```
113-
114-
#### Note:
115-
1. `ChargeResponse` can be null if a user cancels the transaction by pressing back.
116-
2. You need to confirm the transaction is succesful. 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.
117-
118-
# Support
119-
120-
For additional assistance using this library, contact the developer experience (DX) team via [email](mailto:[email protected]) or on [slack](https://bit.ly/34Vkzcg).
121-
122-
You can also follow us [@FlutterwaveEng](https://twitter.com/FlutterwaveEng) and let us know what you think 😊.
123-
124-
# Contribution guidelines
125-
126-
Read more about our community contribution guidelines [here](/CONTRIBUTING.md).
127-
128-
# License
129-
130-
By contributing to the Flutter library, you agree that your contributions will be licensed under its [MIT license](/LICENSE).
131-
132-
Copyright (c) Flutterwave Inc.
45+
Create a `Flutterwave` instance by calling the constructor `Flutterwave` The constructor accepts a mandatory instance of the following:
46+
the calling `Context` , `publicKey`, `Customer`, `amount`, `currency`, `email`, `fullName`, `txRef`, `isDebug`, `paymentOptions`, and `Customization` . It returns an instance of `Flutterwave` which we then call the `async` method `.charge()` on.
47+
48+
_handlePaymentInitialization() async {
49+
final style = FlutterwaveStyle(
50+
appBarText: "My Standard Blue",
51+
buttonColor: Color(0xffd0ebff),
52+
appBarIcon: Icon(Icons.message, color: Color(0xffd0ebff)),
53+
buttonTextStyle: TextStyle(
54+
color: Colors.black,
55+
fontWeight: FontWeight.bold,
56+
fontSize: 18),
57+
appBarColor: Color(0xffd0ebff),
58+
dialogCancelTextStyle: TextStyle(
59+
color: Colors.redAccent,
60+
fontSize: 18
61+
),
62+
dialogContinueTextStyle: TextStyle(
63+
color: Colors.blue,
64+
fontSize: 18
65+
)
66+
);
67+
68+
final Customer customer = Customer(
69+
name: "FLW Developer",
70+
phoneNumber: "1234566677777",
71+
72+
);
73+
74+
final Flutterwave flutterwave = Flutterwave(
75+
context: context,
76+
style: style,
77+
publicKey: "Public Key,
78+
currency: "RWF",
79+
redirectUrl: "my_redirect_url"
80+
txRef: "unique_transaction_reference",
81+
amount: "3000",
82+
customer: customer,
83+
paymentOptions: "ussd, card, barter, payattitude",
84+
customization: Customization(title: "Test Payment"),
85+
isDebug: true
86+
);
87+
}
88+
89+
### 2. Handle the response
90+
91+
Calling the `.charge()` method returns a `Future`
92+
of `ChargeResponse` which we await for the actual response as seen above.
93+
94+
95+
96+
final ChargeResponse response = await flutterwave.charge();
97+
if (response != null) {
98+
print(response.toJson());
99+
if(response.success) {
100+
Call the verify transaction endpoint with the transactionID returned in `response.transactionId` to verify transaction before offering value to customer
101+
} else {
102+
// Transaction not successful
103+
}
104+
} else {
105+
// User cancelled
106+
}
107+
108+
#### Please note that:
109+
- `ChargeResponse` can be null, depending on if the user cancels
110+
the transaction by pressing back.
111+
- You need to check the status of the transaction from the instance of `ChargeResponse` returned from calling `.charge()`, the `status`, `success` and `txRef` are successful and correct before providing value to the customer
112+
113+
> **PLEASE NOTE**
114+
115+
> We advise you to do a further verification of transaction's details on your server to be sure everything checks out before providing service.
116+
<a id="deployment"></a>
117+
118+
119+
##Testing
120+
`pub run test`
121+
122+
## Debugging Errors
123+
We understand that you may run into some errors while integrating our library. You can read more about our error messages [here](https://developer.flutterwave.com/docs/integration-guides/errors).
124+
125+
For `authorization` and `validation` error responses, double-check your API keys and request. If you get a `server` error, kindly engage the team for support.
126+
127+
<a id="support"></a>
128+
## Support For additional assistance using this library, contact the developer experience (DX) team via [email](mailto:[email protected]) or on [slack](https://bit.ly/34Vkzcg).
129+
130+
You can also follow us [@FlutterwaveEng](https://twitter.com/FlutterwaveEng) and let us know what you think 😊
131+
132+
## Contribution guidelines
133+
Read more about our community contribution guidelines [here](https://www.notion.so/flutterwavego/Community-contribution-guide-ca1d8a876ba04d45ab4b663c758ae42a).
134+
135+
## License
136+
By contributing to the Flutter library, you agree that your contributions will be licensed under its [MIT license](https://opensource.org/licenses/MIT).
137+
138+
## Built Using
139+
- [flutter](https://flutter.dev/)
140+
- [http](https://pub.dev/packages/http)
141+
- [flutter_inappwebview](https://pub.dev/packages/flutter_inappwebview)
142+
- [fluttertoast](https://pub.dev/packages/fluttertoast)
143+
144+
<a id="references"></a>
145+
## Flutterwave API References
146+
147+
- [Flutterwave API Doc](https://developer.flutterwave.com/docs)
148+
- [Flutterwave Inline Payment Doc](https://developer.flutterwave.com/docs/flutterwave-inline)
149+
- [Flutterwave Dashboard](https://dashboard.flutterwave.com/login)

example/.metadata

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
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 and should not be manually edited.
4+
# This file should be version controlled.
55

66
version:
7-
revision: fba99f6cf9a14512e461e3122c8ddfaa25394e89
7+
revision: 85684f9300908116a78138ea4c6036c35c9a1236
88
channel: stable
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
17+
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
18+
- platform: android
19+
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
20+
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/analysis_options.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# 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.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

example/android/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java
99
# Remember to never publicly share your keystore.
1010
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
1111
key.properties
12+
**/*.keystore
13+
**/*.jks

example/android/app/build.gradle

+16-8
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,29 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion 28
29+
compileSdkVersion flutter.compileSdkVersion
30+
ndkVersion flutter.ndkVersion
3031

31-
sourceSets {
32-
main.java.srcDirs += 'src/main/kotlin'
32+
compileOptions {
33+
sourceCompatibility JavaVersion.VERSION_1_8
34+
targetCompatibility JavaVersion.VERSION_1_8
35+
}
36+
37+
kotlinOptions {
38+
jvmTarget = '1.8'
3339
}
3440

35-
lintOptions {
36-
disable 'InvalidPackage'
41+
sourceSets {
42+
main.java.srcDirs += 'src/main/kotlin'
3743
}
3844

3945
defaultConfig {
4046
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41-
applicationId "com.example.flutterwave_beta"
42-
minSdkVersion 19
43-
targetSdkVersion 28
47+
applicationId "com.example.example"
48+
// You can update the following values to match your application needs.
49+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50+
minSdkVersion 17
51+
targetSdkVersion flutter.targetSdkVersion
4452
versionCode flutterVersionCode.toInteger()
4553
versionName flutterVersionName
4654
}

0 commit comments

Comments
 (0)