指南
关于使用 Pay 的教程
使用 @capgo/capacitor-pay
Capacitor 插件用于触发 iOS(Apple pay) 和 Android(Google Pay) 的原生支付。
安装
bun add @capgo/capacitor-pay
bunx cap sync
What This Plugin Exposes
isPayAvailable- 检查当前平台是否支持原生付款。iOS 中评估 Apple Pay,Android 中评估 Google Pay。requestPayment- 为当前平台呈现原生付款界面。iOS 中提供 Apple Pay 配置,Android 中提供 Google Pay 配置。
Example Usage
isPayAvailable
Checks whether native pay is available on the current platform. On iOS this evaluates Apple Pay, on Android it evaluates Google Pay.
import { Pay } from '@capgo/capacitor-pay';
await Pay.isPayAvailable();
requestPayment
Presents the native pay sheet for the current platform. Provide the Apple Pay configuration on iOS and the Google Pay configuration on Android.
import { Pay } from '@capgo/capacitor-pay';
await Pay.requestPayment({} as PayPaymentOptions);
Full Reference
- GitHub: https://github.com/Cap-go/capacitor-pay/
- Docs: /docs/plugins/pay/
Keep going from Using @capgo/capacitor-pay
If you are using 使用 @capgo/capacitor-pay 计划支付和购买,连接它 使用 @capgo/capacitor-pay 查看 @capgo/capacitor-pay 的实现细节 开始使用 查看开始使用的实现细节 Capgo 价格 查看Capgo价格的产品工作流程 支付系统 查看支付系统的实现细节 @capgo/native-purchases 查看 @capgo/native-purchases 的实现细节