搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案