multi_payment_gateway 0.0.3 copy "multi_payment_gateway: ^0.0.3" to clipboard
multi_payment_gateway: ^0.0.3 copied to clipboard

PlatformAndroid

A Flutter package to simplify integrating multiple payment gateways like Paymob, PayPal, and Stripe.

هاهو الملف README.md كاملاً ليمكنك نسخه دفعة واحدة وحفظه في مشروعك:

# MultiPaymentGateway

A Flutter package that provides an easy way to handle multiple payment gateways, including **Stripe**, **Paymob**, and **PayPal**. This package simplifies the process for developers to integrate these payment services without worrying about the underlying details.

## Features

- **Stripe**: A complete payment gateway for handling payments through Stripe.
- **Paymob**: A gateway for processing payments through Paymob.
- **PayPal**: Easily integrate PayPal payment functionality into your Flutter app.
- Simplified payment flows for users with no need to enter complex configurations.
- Handles exceptions and actions for each gateway.

## Installation

Add this to your `pubspec.yaml` file:

```yaml
dependencies:
  multi_payment_gateway: latest

Run these commands in the terminal:

dart run global activate multi_payment_gateway
dart run multi_payment_gateway:setup

Then, set up Stripe:

StripeSetup.setup(publishableKey: "PUBLISHABLE_KEY");

Examples #

Stripe #

Future<void> payWithStripe() async {
  var token = "${dotenv.env["SECRET_KEY"]}";
  final SetupStripePayment intent = SetupStripePayment(token: token);
  await StripeService.instance.pay(setupPayment: intent);
}

Create Customer in Stripe #

CustomerService.instance.createCustomer(
  name: "customer name",
  token: "your token"
);

PayPal #

void payWithPaypal(BuildContext context) async {
  final paypalModel = SetupePaypalPayment(
    context: context,
    clientId: "${dotenv.env["PAYPAL_CLIENT_ID"]}",
    secretKey: "${dotenv.env["PAYPAL_SECRET_KEY"]}",
  );
  await PaypalService.instance.pay(setupPayment: paypalModel);
}

Paymob #

Future<void> payWithPaymob(BuildContext context) async {
  final SetupPaymobPayment setupPayment = SetupPaymobPayment(
    context: context,
    frameId: "839579",
    integrationId: int.parse("${dotenv.env["INTEGRATION_ID"]}"),
    apiKey: "${dotenv.env["PAYMOB_API_KEY"]}"
  );
  await PaymobPaymentService.instance.pay(setupPayment: setupPayment);
}

Author #

Ahmed Wael – Flutter Developer
📧 ahmedwael99104@gmail.com
🔗 GitHub Profile

18
likes
130
points
187
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to simplify integrating multiple payment gateways like Paymob, PayPal, and Stripe.

Documentation

API reference

License

MIT (license)

Dependencies

dartz, dio, flutter, flutter_paypal_payment, flutter_stripe, path, plugin_platform_interface, webview_flutter

More

Packages that depend on multi_payment_gateway