【发布时间】: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