パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v4.0.0

pay

Flutterアプリケーションに支払いのサポートを追加するためのプラグイン。

AndroidiOS
30日間ダウンロード
11.4万
いいね数
1110
Pub ポイント
160

パッケージをインストール

flutter pub add pay

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

支払いパッケージは、モバイルアプリケーションで支払い機能を可能にするFlutterプラグインであり、AndroidおよびiOSでのGoogle Payとの統合を提供します。開発者は、支払いの安全な処理、支払い方法の管理、アプリ内の取引の処理が可能になります。Googleによって設計されたこのプラグインは、標準化されたAPIを使用して支払いフローの実装を簡素化しています。両方の主要プラットフォームをサポートし、セキュリティのベストプラクティスに準拠しています。電子商務、サブスクリプションベースのサービス、およびアプリ内決済処理が必要なすべてのアプリに適しています。

用途

  • アプリ内購入
  • サブスクリプション課金
  • 電子商取引チェックアウト
  • デジタル商品の購入
  • モバイルウォレットの統合

主な機能

  • Google Pay の統合
  • クロスプラットフォーム対応(Android および iOS)
  • セキュアな支払い処理
  • 支払いリクエスト用のシンプルな API
  • 複数の支払い方法をサポートしています

適している対象

  • ECアプリ
  • サブスクリプションサービス
  • モバイルウォレット
  • 支払い対応のマーケットプレイス
  • セキュアなトランザクションを必要とするアプリ

注意事項

  • デバイスに Google Pay のセットアップが必要です
  • 本番環境用に適切な設定が必要です
  • プラットフォーム固有の決済ゲートウェイに依存します
  • Google Payエコシステムに限定
  • 追加のバックエンド検証が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

A plugin to add payments to your Flutter application.

pay pay_android pay_ios pay_platform_interface
pub package pub package pub package pub package

Platform Support

Android iOS
Google Pay Apple Pay

Getting started

Before you start, create an account with the payment providers you are planning to support and follow the setup instructions:

Apple Pay:
  1. Take a look at the integration requirements.
  2. Create a merchant identifier for your business.
  3. Create a payment processing certificate to encrypt payment information.
Google Pay:
  1. Take a look at the integration requirements.
  2. Sign up to the business console and create an account.

Installation

This adds the pay package to the list of dependencies in your pubspec.yaml file with the following command:

flutter pub add pay

Usage

Define the configuration for your payment provider(s). Take a look at the parameters available in the documentation for Apple Pay and Google Pay, and explore the sample configurations in this package.

Example

This snippet assumes the existence of a payment configuration for Apple Pay (defaultApplePayConfig) and another one for Google Pay (defaultGooglePayConfig):

import 'package:pay/pay.dart';
import 'payment_configurations.dart' as payment_configurations;

const _paymentItems = [
  PaymentItem(
    label: 'Total',
    amount: '99.99',
    status: PaymentItemStatus.final_price,
  )
];

ApplePayButton(
  paymentConfiguration: payment_configurations.defaultApplePayConfig,
  paymentItems: _paymentItems,
  style: ApplePayButtonStyle.black,
  type: ApplePayButtonType.buy,
  margin: const EdgeInsets.only(top: 15.0),
  onPaymentResult: onApplePayResult,
  loadingIndicator: const Center(
    child: CircularProgressIndicator(),
  ),
),

GooglePayButton(
  paymentConfiguration: payment_configurations.defaultGooglePayConfig,
  paymentItems: _paymentItems,
  type: GooglePayButtonType.buy,
  margin: const EdgeInsets.only(top: 15.0),
  onPaymentResult: onGooglePayResult,
  loadingIndicator: const Center(
    child: CircularProgressIndicator(),
  ),
),

void onApplePayResult(paymentResult) {
  // Send the resulting Apple Pay token to your server / PSP
}

void onGooglePayResult(paymentResult) {
  // Send the resulting Google Pay token to your server / PSP
}

To learn more about the pay plugin and alternative integration paths, check out the readme in the pay folder.

Other packages in this plugin

The packages in this repository follow the federated plugin architecture. Each package has a specific responsibility and can be used independently to fulfil less conventional integration needs:

Package Description When to use
pay An app-facing package with support for all the platforms supported by this plugin. This package offers an agnostic integration for the platforms supported in this plugin and features the easiest path to add payments to your Flutter application.
pay_android The endorsed implementation of this plugin for Android. This package contains the necessary business logic to support the Android platform. You can integrate this package separately or use it to build your own app-facing package.
pay_ios The endorsed implementation of this plugin for iOS. This package contains the necessary business logic to support the iOS platform. You can integrate this package separately or use it to build your own app-facing package.
pay_platform_interface A common API contract for platform-specific implementations. Folow the contract in this package to add new platforms to the plugin or create your own Android or iOS implementations. Take a look at the guide about plugin development to learn more.

Additional resources

Check out the following resources to manage your payment accounts and learn more about the APIs for the supported providers:

Google Pay Apple Pay
Platforms Android iOS
Documentation Overview Overview
Console Google Pay Business Console Developer portal
Reference API reference Apple Pay API
Style guidelines Brand guidelines Buttons and Marks

Note: This is not an officially supported Google product.

カテゴリー

依存関係

依存関係一覧 4 件

  • meta^1.10.0
  • pay_android^4.0.0
  • pay_ios^1.3.0
  • pay_platform_interface^2.0.0

ソースリポジトリ

このパッケージを使用しているプロジェクト