Kal*_*yan 10 paypal payment-gateway flutter
我刚刚开始我的 Flutter 之旅,需要将 Paypal 支付集成到我的应用程序中。但是,Paypal 似乎没有提供标准的 Flutter API,我在任何地方都找不到可接受的答案。
您可以使用 WebView 实现这一点。PayPal 提供了一些 API 来进行交易。使用这些 API 可以实现这一点。
阅读这篇文章
本文演示了您需要遵循的步骤。
Braintree 是 Paypal 提供的支付处理器,通过功能 Drop-in UI 和自定义 UI 设计接受安全可靠的支付。它还提供Apple Pay、Google Pay功能来接受付款。
打开 Braintree 沙盒帐户
从 Braintree 帐户获取标记化密钥
在 pubspec.yaml 文件中添加 flutter_braintree 依赖项
依赖项:
flutter_braintree:^0.5.3+1
创建自定义用户界面
Paypal 信用卡:接受用户的以下信息
A。卡号
b. 到期月份
C。到期年份
创建 Braintree 请求
final request = BraintreeCreditCardRequest(
card number: '4115511771161116',
expiration month: '02',
expiration year: '2020',
);
Run Code Online (Sandbox Code Playgroud)
要求 Braintree 将其标记化
BraintreePaymentMethodNonce result = await Braintree.tokenizeCreditCard(
'<Insert your tokenization key>',
request,
);
Run Code Online (Sandbox Code Playgroud)
对于贝宝
创建 Paypal 请求
final request = BraintreePayPalRequest(amount: '50.00');
Run Code Online (Sandbox Code Playgroud)
然后启动 Paypal 请求
BraintreePaymentMethodNonce result = await Braintree.requestPaypalNonce(
"Insert your tokenization key or client token here",
request,
);
Run Code Online (Sandbox Code Playgroud)
支付成功后从 Braintree 获取 NONCE,并获取用户取消 Paypal 支付的失败消息。
保存此随机数以供将来在数据库中参考
| 归档时间: |
|
| 查看次数: |
12400 次 |
| 最近记录: |