搜尋套件、儲存庫與 APP 分類

套件詳情v1.2.3

stripe_native

使用 Apple 與 Google Pay 建立可收費的 Stripe 條碼。顯示原生的 Apple 與 Google Pay 表單,然後收集一次性來源條碼。

近 30 天下載
30
喜歡數
26
Pub 分數
40

安裝套件

flutter pub add stripe_native

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

stripe_native 套件讓 Flutter 應用程式能夠使用 Apple Pay 與 Google Pay 建立可收費的 Stripe 金鑰。它提供原生付款表單整合,讓使用者能透過裝置內建的付款系統安全授權付款。使用者同意後,該套件會收集一次性來源金鑰,以供於 Stripe 交易使用。專為順暢結帳體驗設計,利用平台特定 API,無需自訂 UI 實作。此套件非常適合需要安全、原生付款流程且設定簡單的應用程式。

適用情境

  • 透過 Apple Pay 的一次性付款
  • 透過 Google Pay 的一次性付款
  • Stripe 的安全令牌產生
  • 原生結帳整合
  • 行動電商應用
  • 應用內購買

主要特色

  • 原生 Apple Pay 集成
  • 原生谷歌支付整合
  • 一次性源令牌收集
  • 最小化UI自定義
  • 平台特定的支付表單
  • 安全支付處理

適合對象

  • 電子商務行動應用程式
  • 基於訂閱的服務
  • 需要安全支付的應用
  • 使用 Stripe 的開發者
  • 支援 Apple/Google Pay 的專案

使用建議

  • 需要設定 Stripe 帳戶
  • 僅限 iOS 與 Android
  • 需要正確的商家設定
  • 依賴裝置支付功能的可用性
  • 不適用於定期付款
  • 不支援網頁平台

原始 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);

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。