【问题标题】:How to get payer email in flutter stripe gpay integration?如何在颤动条纹 gpay 集成中获取付款人电子邮件?
【发布时间】:2020-12-09 18:13:38
【问题描述】:

我的代码是这样的: 实际上我想获取买家的电子邮件 ID。为此我已经打印了查看日志。但我没有得到 付款人电子邮件 ID。

StripePayment.setOptions(StripeOptions(publishableKey: _credential, androidPayMode: 'test'));

   RaisedButton(
             child: Text("Google Pay"),
            onPressed: () {
              if (Platform.isIOS) {
              _controller.jumpTo(450);
               }
              StripePayment.paymentRequestWithNativePay(
              androidPayOptions: AndroidPayPaymentRequest(
              totalPrice: "0.40",
              currencyCode: "EUR",
              billingAddressRequired: true,
              shippingAddressRequired: true,
              ),
             applePayOptions: ApplePayPaymentOptions(
              countryCode: 'DE',
              currencyCode: 'EUR',
              items: [
                ApplePayItem(
                  label: 'Test',
                  amount: '0.1',
                )
              ],
            ),
          ).then((token) {
            setState(() {
              print(token.tokenId);
              print(token.toJson());
              tokenId = token.tokenId;
              if(tokenId!=null||tokenId!=''){
                getPayment_Api();
              }
            });
          }).catchError(setError);
        },
      ),

【问题讨论】:

  • 我从未使用过该库,但如果令牌上不存在它,我不确定您将如何获得它。无论代码调用实际的本机 API(这里将成为库的一部分)都需要单独访问帐单详细信息和电子邮件并将其提供给您,也许它没有。我会向社区询问该插件。
  • 不明白你在说什么?我正在使用 stripe_payment: ^1.0.6 library.but nt 成功获取 gmail。

标签: flutter stripe-payments payment-gateway google-pay


【解决方案1】:

使用直接 Google Pay API,当您使用 emailRequired 请求时返回此字段

我不熟悉您使用的 API,但我假设它是 https://github.com/jonasbark/flutter_stripe_payment/。如果是这样,它看起来不像公开emailRequired 属性:https://github.com/jonasbark/flutter_stripe_payment/blob/master/lib/src/android_pay_payment_request.dart

【讨论】:

  • 是的,我正在使用 stripe_payment: 1.0.7 库。除了付款人电子邮件字段外,一切都已完成。
  • 仍然没有成功获取付款人电子邮件。我尝试了 android_payment_request.dart
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-07-11
  • 1970-01-01
  • 1970-01-01
  • 2018-05-26
  • 2014-10-31
  • 2011-08-20
  • 1970-01-01
相关资源
最近更新 更多