https://github.com/arshmancodes/paymob_pakistan
A plugin for Flutter to Easily accept Jazzcash/Easypaisa/Card Payments through Paymob Pakistan in your Flutter app.
https://github.com/arshmancodes/paymob_pakistan
payment-gateway paymentmethods plugin
Last synced: 6 months ago
JSON representation
A plugin for Flutter to Easily accept Jazzcash/Easypaisa/Card Payments through Paymob Pakistan in your Flutter app.
- Host: GitHub
- URL: https://github.com/arshmancodes/paymob_pakistan
- Owner: arshmancodes
- License: mit
- Created: 2023-09-20T11:52:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T11:58:23.000Z (over 2 years ago)
- Last Synced: 2025-10-23T01:32:55.545Z (6 months ago)
- Topics: payment-gateway, paymentmethods, plugin
- Language: C++
- Homepage:
- Size: 852 KB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# paymob_pakistan
Easily accept Jazzcash/Easypaisa/Card Payments through [Paymob Pakistan](https://paymob.pk) in your Flutter app.
## :rocket: Installation
Add this to `dependencies` in your app's `pubspec.yaml`
```yaml
paymob_pakistan : latest_version
```
## :hammer: Initialization
```dart
PaymobPakistan.instance.initialize(
apiKey: "", // from dashboard Select Settings -> Account Info -> API Key
jazzcashIntegrationId: 123123, // From Dashboard select Developers -> Payment Integrations -> JazzCash Integration ID
easypaisaIntegrationID: 123123, // From Dashboard select Developers -> Payment Integrations -> EasyPaisa Integration ID
integrationID: 123456, // from dashboard Select Developers -> Payment Integrations -> Online Card ID
iFrameID: 123456, // from paymob Select Developers -> iframes
);
```
> :pushpin: Note :
>
> You can use this singleton (instance)
> or
> Create your own
> if you want to create different iFrames or integrations
```dart
final PaymobPakistan paymobPakistan = PaymobPakistan();
paymobPakistan.initialize(
apiKey: "",
jazzcashIntegrationId: 123123,
easypaisaIntegrationID: 123123,
integrationID: 123456,
iFrameID: 123456,
);
```
## :bookmark: Usage
```dart
final PaymobResponse? response = await PaymobPakistan.instance.pay(
context: context,
currency: "PKR",
paymentType: PaymentType.card, // or you can User paymentType: PaymentType.jazzcash OR PaymentType.easypaisa
amountInCents: "50000", // 500 PKR
onPayment: (response) => setState(() => this.response = response), // Optional
)
```
## :incoming_envelope: PaymobResponse
| Variable | Type | Description |
| ------------- |---------| -------------------- |
| success | bool | Indicates if the transaction was successful or not |
| transactionID | String? | The ID of the transaction |
| responseCode | String? | The response code for the transaction |
| message | String? | A brief message describing the transaction |
## :test_tube: Testing Cards
#### :white_check_mark: Successful payment
| Variable | Description |
|--------------|------------------|
| Card Number | 5123456789012346 |
| Expiry Month | 12 |
| Expiry Year | 25 |
| CVV | 123 |
| Name | Test Account |
#### :negative_squared_cross_mark: Declined payment
Change cvv to 111 or expiry year to 20
## Credits
> All API Credits goes to [Paymob Pakistan](https://paymob.pk)
> :pushpin: Note :
>
> Visit [Paymob Pakistan](https://paymob.pk) to get your PayMob account for accepting Digital Payments on your Flutter Application.
> May be you have to contact paymob support to activate your test card