搜索插件、代码仓与 APP 分类

插件详情v1.0.8

flutter_paypal_payment

该包可简化将 PayPal 支付集成到您的移动应用中的过程。主要功能包括无缝的内应用 PayPal 集成

AndroidiOSWebmacOSWindows
近 30 天下载
4240
喜欢数
284
Pub 分数
130

安装插件

flutter pub add flutter_paypal_payment

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

flutter_paypal_payment 包可实现将 PayPal 支付无缝集成到跨平台的 Flutter 应用中。它简化了添加安全、应用内支付功能的过程,设置简单。开发者可以轻松启动交易、处理支付响应,并在应用中管理结账流程。该包支持 Android、iOS、Web、macOS 和 Windows,非常适合需要 PayPal 作为支付选项的跨平台项目。

适合场景

  • 应用内购买
  • 电子商务移动应用
  • 订阅服务
  • 数字产品销售
  • 在线服务付款

主要特点

  • 跨平台支持
  • 简单的 API 集成
  • 安全支付处理
  • 实时交易处理
  • 内置结账流程

适合对象

  • 移动电子商务应用
  • SaaS 平台
  • 数字内容提供商
  • 跨平台应用
  • 寻求快速 PayPal 集成的开发者

使用建议

  • 需要设置 PayPal 账户
  • 需要合适的沙盒/测试环境
  • 依赖网络连接
  • 可能需要额外的后端验证
  • 需要平台特定配置

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Flutter PayPal Payment Package

The Flutter PayPal Payment Package provides an easy-to-integrate solution for enabling PayPal payments in your Flutter mobile application. This package allows for a seamless checkout experience with both sandbox and production environments.

Features

  • Seamless PayPal Integration: Easily integrate PayPal payments into your Flutter app.
  • Sandbox Mode Support: Test payments in a safe sandbox environment before going live.
  • Customizable Transactions: Define custom transaction details for each payment.
  • Payment Outcome Callbacks: Handle success, error, and cancellation events for payments.

Installation

To install the Flutter PayPal Payment Package, follow these steps

  1. Add the package to your project's dependencies in the pubspec.yaml file:

    dependencies:
      flutter_paypal_payment: ^1.0.7
    
  2. Run the following command to fetch the package:

    flutter pub get
    

Usage

  1. Import the package into your Dart file:

    import 'package:flutter_paypal_payment/flutter_paypal_payment.dart';
    
  2. Navigate to the PayPal checkout view with the desired configuration:

 Navigator.of(context).push(MaterialPageRoute(
                  builder: (BuildContext context) => PaypalCheckoutView(
                    sandboxMode: true,
                    clientId: "",
                    secretKey: "",
                    transactions: const [
                      {
                        "amount": {
                          "total": '70',
                          "currency": "USD",
                          "details": {
                            "subtotal": '70',
                            "shipping": '0',
                            "shipping_discount": 0
                          }
                        },
                        "description": "The payment transaction description.",
                        // "payment_options": {
                        //   "allowed_payment_method":
                        //       "INSTANT_FUNDING_SOURCE"
                        // },
                        "item_list": {
                          "items": [
                            {
                              "name": "Apple",
                              "quantity": 4,
                              "price": '5',
                              "currency": "USD"
                            },
                            {
                              "name": "Pineapple",
                              "quantity": 5,
                              "price": '10',
                              "currency": "USD"
                            }
                          ],

                          // shipping address is not required though
                          //   "shipping_address": {
                          //     "recipient_name": "tharwat",
                          //     "line1": "Alexandria",
                          //     "line2": "",
                          //     "city": "Alexandria",
                          //     "country_code": "EG",
                          //     "postal_code": "21505",
                          //     "phone": "+00000000",
                          //     "state": "Alexandria"
                          //  },
                        }
                      }
                    ],
                    note: "Contact us for any questions on your order.",
                    onSuccess: (Map params) async {
                      print("onSuccess: $params");
                    },
                    onError: (error) {
                      print("onError: $error");
                      Navigator.pop(context);
                    },
                    onCancel: () {
                      print('cancelled:');
                    },
                  ),
                ));

⚡ Donate

If you would like to support me, please consider making a donation through one of the following links:

Thank you for your support!

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目