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

パッケージ詳細v1.2.3

stripe_native

Apple PayおよびGoogle Payを使用して課金可能なStripeトークンを作成します。ネイティブのApple PayおよびGoogle Payシートを表示し、一時的なソーストークンを収集します。

30日間ダウンロード
30
いいね数
26
Pub ポイント
40

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

flutter pub add stripe_native

パッケージ概要

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

stripe_native パッケージは、Flutter アプリケーションが Apple Pay および Google Pay を使用して課金可能な Stripe トークンを作成できるようにします。ネイティブの決済シート統合を提供し、ユーザーがデバイス内蔵の決済システムを通じて安全に支払いを承認できるようにします。ユーザーの承認後、このパッケージは一時的なソーストークンを収集し、Stripe トランザクションで使用します。カスタムUIの実装を必要とせず、プラットフォーム固有のAPIを活用することで、スムーズなチェックアウト体験を実現しています。最小限のセットアップで安全かつネイティブな決済フローが必要なアプリに最適です。

用途

  • Apple Pay を通じた一回限りの支払い
  • Google Pay を通じた一時的な支払い
  • Stripe 用のセキュアなトークン生成
  • ネイティブ決済統合
  • モバイルECアプリ
  • アプリ内購入

主な機能

  • ネイティブな Apple Pay 統合
  • ネイティブなGoogle Payの統合
  • ワンタイムソーストークンの収集
  • 最小限のUIカスタマイズ
  • プラットフォーム固有の支払いシート
  • セキュアな決済処理

適している対象

  • ECモバイルアプリ
  • サブスクリプションベースのサービス
  • セキュアな決済を必要とするアプリ
  • Stripe を使用する開発者
  • Apple/Google Pay をサポートするプロジェクト

注意事項

  • Stripeアカウントの設定が必要です
  • iOS および Android に限定
  • 適切なマーチャントの設定が必要です
  • デバイスの支払い機能の利用可能性に依存する
  • 繰り返し支払いには適していません
  • Webプラットフォームはサポートされていません

元の README

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

Stripe Native

Create chargeable stripe tokens using Apple and Google Pay.

This plugin will give you easy access to the Apple and Google Pay payment sheets. And provide one-time source tokens that are used to create a Stripe Charge.

Apple Pay

Setup

Both (Required)

To begin one will need a Stripe project, from there collect a publishable key.

iOS (Required)

On the Apple Developer portal, one will need to create a merchant identifier. Then connect that identifier to the Stripe project.

From the Stripe dashboard, create a signing certificate to share with Apple, then upload the signed certificate to Stripe.

Merchant Identifier

Lastly, open the apps' iOS module. Add the newly created identifier to the project's signing capabilities.

Signing Capablities

Android (Optional)

On the Google Play console, add the merchant identifier to the app capabilites. This makes the merchant known to Google Pay. With it, users will not see a warning saying this app is an unidentified merchant.

Functions

Set Publishable Key

Prior to calling native pay, set the publishable key.

StripeNative.setPublishableKey("pk_test_yZuUz6Sqm83H4lA7SrlAvYCh003MvJiJlR");
Set Merchant Identifier

Prior to calling native pay, set the merchant identifier.

StripeNative.setMerchantIdentifier("merchant.rbii.stripe-example");
Set Currency Key

In order to change the currency, pass in an ISO currency code prior to opening a payment sheet. On iOS it also requires passing in a country code.

StripeNative.setCurrencyKey("EUR");
// Not required on Android
StripeNative.setCountryKey("FR");
Native-Pay

There are two ways to create a payment sheet. With a list of items and prices, or with some subtotal, tax and tip.

Both methods require a merchant name to display at the bottom of the sheet.

// subtotal, tax, tip, merchant name
var order = Order(5.50, 1.0, 2.0, "Some Store");
var token = await StripeNative.useNativePay(order);
const itemPrices = <String, double>{"Nice Hat": 5.00, "Used Hat" : 1.50};
var receipt = Receipt(itemPrices, "Hat Store");
var token = await StripeNative.useReceiptNativePay(receipt);
Confirm Payment (iOS)

On iOS the payment sheet spins and ends with a check or X depending on the result passed in. During the spinning, query an endpoint for a charge using the token. This function does not affect Android.

// call charge endpoint w/ token
const wasCharged = await AppAPI.charge(token, amount);
// then show success or failure
StripeNative.confirmPayment(wasCharged);

カテゴリー

ソースリポジトリ

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

データはまだありません。