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.
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.
Lastly, open the apps' iOS module. Add the newly created identifier to the project's signing capabilities.
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.
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/ tokenconst wasCharged = awaitAppAPI.charge(token, amount);
// then show success or failureStripeNative.confirmPayment(wasCharged);