{"id":30602354,"url":"https://github.com/iamngoni/pesepay","last_synced_at":"2025-08-30T00:35:42.532Z","repository":{"id":311656568,"uuid":"608608799","full_name":"iamngoni/pesepay","owner":"iamngoni","description":"Pesepay helps businesses in Africa get paid by anyone, anywhere in the world","archived":false,"fork":false,"pushed_at":"2025-08-25T20:31:03.000Z","size":85,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-25T20:41:50.709Z","etag":null,"topics":["africa","business","dart","dartlang","flutter","gateway","iamngoni","payments","pesepay","zimbabwe"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamngoni.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-02T11:24:41.000Z","updated_at":"2025-08-25T20:31:07.000Z","dependencies_parsed_at":"2025-08-25T20:41:59.643Z","dependency_job_id":"323312ca-ca7f-43da-a6b8-0d22b18e4c8e","html_url":"https://github.com/iamngoni/pesepay","commit_stats":null,"previous_names":["iamngoni/pesepay"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/iamngoni/pesepay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamngoni%2Fpesepay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamngoni%2Fpesepay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamngoni%2Fpesepay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamngoni%2Fpesepay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamngoni","download_url":"https://codeload.github.com/iamngoni/pesepay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamngoni%2Fpesepay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272788300,"owners_count":24993107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["africa","business","dart","dartlang","flutter","gateway","iamngoni","payments","pesepay","zimbabwe"],"created_at":"2025-08-30T00:35:41.451Z","updated_at":"2025-08-30T00:35:42.516Z","avatar_url":"https://github.com/iamngoni.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pesepay\n\n[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]\n[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason)\n[![License: MIT][license_badge]][license_link]\n\u003cimg src=\"https://img.shields.io/pub/v/pesepay?style=for-the-badge\"\u003e\n\u003cimg src=\"https://img.shields.io/github/last-commit/iamngoni/pesepay\"\u003e\n\u003cimg src=\"https://img.shields.io/twitter/url?label=iamngoni_\u0026style=social\u0026url=https%3A%2F%2Ftwitter.com%2Fiamngoni_\"\u003e\n\nPesepay helps businesses in Africa get paid by anyone, anywhere in the world\n\n\u003e This is still WIP! Try out and contribute where you can.\n\n## Installation 💻\n\n**❗ In order to start using Pesepay you must have the [Dart SDK][dart_install_link] installed on your machine.**\n\nAdd `pesepay` to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  pesepay:\n```\n\nInstall it:\n\n```sh\ndart pub get\n```\n\n---\n\n## Usage 🔥\n\n### Import package\n\n```dart\n  import 'package:pesepay/pesepay.dart';\n```\n\n### Declare and initialize\n\n```dart\nfinal pesepay = Pesepay(\n  integrationKey: '',\n  encryptionKey: '',\n  resultUrl: '',\n  returnUrl: '',\n);\n```\n\n### Get list of active currencies\n```dart\nfinal List\u003cCurrency\u003e currencies = await Pesepay.getActiveCurrencies();\n```\nSample Currency\n```dart\nCurrency(\n    name: Zimbabwe Dollar, \n    description: Zimbabwe Dollar, \n    code: ZWL, \n    defaultCurrency: false,\n    rateToDefault: 604.25,\n    active: true\n)\n```\n\n### Get list of payment methods for selected currency\n```dart\nfinal List\u003cPaymentMethod\u003e methods = await Pesepay.getPaymentMethodsByCurrency(currency);\n```\n\nSample PaymentMethod\n```dart\nPaymentMethod(\n  active: true,\n  code: PZW201,\n  currencies: [ZWL], \n  description: Make payment directly from your mobile phone.,\n  id: 1,\n  maximumAmount: 50000.0,\n  minimumAmount: 2.0, \n  name: Ecocash, \n  processingPaymentMessage: Please enter PIN on the phone that is making the payment.,\n  redirectRequired: false, \n  redirectURL: null, \n  requiredFields: [\n    RequiredField(\n      displayName: Phone Number, \n      fieldType: TEXT, \n      name: customerPhoneNumber, \n      optional: false\n    )\n  ]\n)\n```\n\n### Perform Web Transaction\nThis relies on the returned web `redirectUrl` that customers can use to complete the transaction\n\nFirst step would be to create the transaction:\n```dart\nfinal Transaction transaction = pesepay.createTransaction(\n  amount: 1,\n  currencyCode: 'ZWL',\n  transactionDescription: 'Bag of potatoes',\n  transactionReference: '111-222-333'\n)\n```\n\nThen process the transaction:\n```dart\nfinal TransactionResponse response = await pesepay.initiateWebTransaction(transaction);\n```\n\nIf the above execution results in any error either within the package itself or from the Pesepay server side you should except a `PesepayException`. So it would be helpful to handle that.\n\n### Perform Seamless Transaction\nFirst step here would be to create the transaction:\n```dart\nfinal SeamlessTransaction seamlessTransaction = pesepay.createSeamlessTransaction(\n  customerName: 'Cool Name',\n  customerEmail: 'yourmail@email.com',\n  customerPhone: '0777111111',\n  amount: 1,\n  currencyCode: 'ZWL',\n  transactionDescription: 'Banana Peel',\n  transactionReference: '111-222-333',\n  paymentMethodCode: paymentMethodCode,\n);\n```\n\nProcess the seamless transaction:\n```dart\nfinal TransactionResponse response = await pesepay.initiateSeamlessTransaction(transaction);\n```\n\n### Check transaction status\n```dart\nfinal TransactionResponse response = await pesepay.checkTransactionStatus(pollUrl);\n```\n\n### Serverless Checkout ?\nInstead of using delays to check transaction status you can also `stream` the `TransactionResponse` using the poll url.\n\n- `pesepay.streamTransactionResponse(..)` takes a required `pollUrl` string and optional `streamInterval` in seconds which is the interval to poll the url, default to `20` sec\n- You can stream status and show current transaction status on UI to user with a `StreamBuilder(..)` like below:\n\n```dart\nfinal String pollUrl = response.pollUrl;\n\n// in Widget build(..) method\n// you can do something like\nStreamBuilder(\n  stream: pesepay.streamTransactionResponse(pollUrl),\n  builder: (context, AsyncSnapshot\u003cTransactionResponse\u003e snapshot) {\n    if(snapshot.hasData) {\n      final TransactionResponse response = snapshot.data!;\n      return response.paid ? SuccessWidget() : OtherWidgetsForErrorOrWaiting();\n    } else {\n      return CircularProgressIndicator();\n    }\n  }\n)\n```\n\n### Full Usage Example\n```dart\nvoid main() async {\n  try {\n    final pesepay = Pesepay(\n      integrationKey: '',\n      encryptionKey: '',\n      resultUrl: '',\n      returnUrl: '',\n    );\n\n    final Transaction transaction = pesepay.createTransaction(\n      amount: 1,\n      currencyCode: 'ZWL',\n      transactionDescription: 'Bag of potatoes',\n      transactionReference: '111-222-333'\n    );\n\n    final TransactionResponse response = await pesepay.initiateWebTransaction(transaction);\n\n    // Add a delay before checking status, maybe 20-30 seconds\n    await Future.delayed(const Duration(seconds: 30))\n\n    // Check status\n    final TransactionResponse pollResponse = await pesepay.checkTransactionStatus(response.pollUrl);\n\n    if (pollResponse.paid) {\n      // well you've done it\n      print('I deserve drinks 🍻');\n    } else {\n      // not yet pal\n      print('👎🏿')\n    }\n\n  } on PesepayException catch (e) {\n    print(e.message);\n  } catch (e) {\n    // hell\n  }\n}\n```\n\n---\n[dart_install_link]: https://dart.dev/get-dart\n[github_actions_link]: https://docs.github.com/en/actions/learn-github-actions\n[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[license_link]: https://opensource.org/licenses/MIT\n[logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only\n[logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only\n[mason_link]: https://github.com/felangel/mason\n[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg\n[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis\n[very_good_coverage_link]: https://github.com/marketplace/actions/very-good-coverage\n[very_good_ventures_link]: https://verygood.ventures\n[very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only\n[very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only\n[very_good_workflows_link]: https://github.com/VeryGoodOpenSource/very_good_workflows","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamngoni%2Fpesepay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamngoni%2Fpesepay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamngoni%2Fpesepay/lists"}