https://github.com/chayanforyou/bkash-pgwclient-demo-flutter
bKash payment gateway integration in flutter
https://github.com/chayanforyou/bkash-pgwclient-demo-flutter
bkash bkash-payment bkash-payment-gateway bkash-pgw flutter tokenize
Last synced: 13 days ago
JSON representation
bKash payment gateway integration in flutter
- Host: GitHub
- URL: https://github.com/chayanforyou/bkash-pgwclient-demo-flutter
- Owner: chayanforyou
- Created: 2021-02-07T05:52:44.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-19T07:01:48.000Z (6 months ago)
- Last Synced: 2025-04-13T05:13:56.584Z (13 days ago)
- Topics: bkash, bkash-payment, bkash-payment-gateway, bkash-pgw, flutter, tokenize
- Language: Dart
- Homepage:
- Size: 34 MB
- Stars: 41
- Watchers: 2
- Forks: 28
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Easy bKash integration with Flutter
[](https://opensource.org/licenses/MIT) []() []() [](https://github.com/ellerbrock/open-source-badges/) [](https://chayanforyou.github.io/)
A simple implementation of bKash payment gateway in flutter with tokenized checkout feature.
## Features
* A Simple App with a button to `Checkout`
* Pressing the button initiates bKash payment dialogs
* Returns a success message with tranId if payment is successful## Usage
Official link for API documentation and demo checkout
* [bKash API Specifications](https://developer.bka.sh/v1.2.0-beta/reference)
* [bKash Checkout Demo](https://merchantdemo.sandbox.bka.sh)### Production
Replace the credentials for production uses in `bkash_credentials.dart` with your own bKash credentials and change the parameter `isSandbox: false`.
```dart
static const String username = 'app_username';
static const String password = 'app_password';
static const String appKey = 'app_key';
static const String appSecret = 'app_secret';
```
### Pay With bKashBasically this the implementation of payment without an agreement. Use the `makePayment` method to pay
#### Request
```dart
final result = await bkashApi.makePayment(
context: context,
amount: 50.0,
payerReference: "01770618575",
merchantInvoiceNumber: "INV-123",
isSandbox: false,
);
```
#### Response```json
{
"amount": "50.0",
"trxId": "BJJ90KGFBH",
"paymentId": "TR0011HjY1p6A1729311405472",
"payerReference": "01770618575",
"customerMsisdn": "01770618575",
"merchantInvoiceNumber": "INV-123",
"paymentExecuteTime": "2024-10-19T10:17:14:333"
}
```## Error Handling
In case of any error it's throw `PaymentException`. You can handle the exception using a try-catch block.
```dart
try {
// Make a payment
} on PaymentException catch (e) {
// Handle the error
log(e.message);
}
```## Video Demo
https://github.com/chayanforyou/bkash-pgwclient-demo-flutter/assets/12654289/9f81977b-b6f8-45c2-9746-93f1a1ad987c
## Contributing
Contributions to this project you always are welcome. Please note the standard guidelines before submitting your pull request.