You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,109 +25,116 @@ Flutterwave's Flutter SDK is Flutterwave's offical flutter sdk to integrate Flut
24
25
25
26
## Getting Started
26
27
27
-
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.
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.
28
29
See [references](#references) for links to dashboard and API documentation.
29
30
30
-
### Prerequisite
31
-
32
-
- Ensure you have your test (and live) [API keys](https://developer.flutterwave.com/docs/api-keys).
33
-
```
34
-
Flutter version >= 1.17.0
35
-
Flutterwave version 3 API keys
36
-
```
31
+
## 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 ```
37
34
38
-
### Installing
39
-
40
-
**Step 1.** Add the dependency
35
+
## Installation Add the dependency
41
36
42
37
In your `pubspec.yaml` file add:
43
38
44
-
1.`flutterwave_standard: ^1.0.3`
45
-
2. run `flutter pub get`
39
+
1.`flutterwave_standard: ^1.0.4`
40
+
2. run `flutter pub get`
41
+
<aid="usage"></a>
46
42
47
-
<aid="usage"></a>
48
43
## Usage
49
44
50
-
### 1. Create a `Flutterwave` instance
51
-
52
-
Create a `Flutterwave` instance by calling the constructor `Flutterwave` The constructor accepts a mandatory instance of the following:
53
-
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.
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.
of `ChargeResponse` which we await for the actual response as seen above.
98
-
99
-
```
100
-
final ChargeResponse response = await flutterwave.charge();
101
-
if (response != null) {
102
-
print(response.toJson());
103
-
if(response.success) {
104
-
Call the verify transaction endpoint with the transactionID returned in `response.transactionId` to verify transaction before offering value to customer
105
-
} else {
106
-
// Transaction not successful
107
-
}
108
-
} else {
109
-
// User cancelled
110
-
}
111
-
```
91
+
Calling the `.charge()` method returns a `Future`
92
+
of `ChargeResponse` which we await for the actual response as seen above.
112
93
113
94
114
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
+
115
108
#### Please note that:
116
-
-`ChargeResponse` can be null, depending on if the user cancels
117
-
the transaction by pressing back.
118
-
- 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
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
119
112
120
113
> **PLEASE NOTE**
121
114
122
-
> We advise you to do a further verification of transaction's details on your server to be sure everything checks out before providing service.
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.
123
116
<a id="deployment"></a>
124
-
## Deployment
125
117
126
-
- Switch to Live Mode on the Dashboard settings page
127
-
- Use the Live Public API key from the API tab, see [here](https://developer.flutterwave.com/docs/api-keys) for more details.
128
118
129
-
<aid="build-tools"></a>
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
+
<aid="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
+
130
138
## Built Using
131
139
-[flutter](https://flutter.dev/)
132
140
-[http](https://pub.dev/packages/http)
@@ -138,9 +146,4 @@ Create a `Flutterwave` instance by calling the constructor `Flutterwave` The con
138
146
139
147
-[Flutterwave API Doc](https://developer.flutterwave.com/docs)
0 commit comments