actions-on-google - 支付令牌没有响应
问题描述
==== 已解决 ====
问题解决了。Adyen 希望您将整个字符串作为对象发送。JSON.parse(令牌)。确保在 Adyen 平台中启用了 Google 支付。
=================
我正在与 Actions on Google 进行交易并与 Google Pay 集成。我按照 Actions on Google 的文档执行了所有步骤。
为了提出订单,我发送以下代码片段。笔记:
gateway
出于安全原因,值被替换。gatewayMerchantId
出于安全原因,值被替换。- 我正在使用注册网关。
- 我尚未通过业务控制台注册为 Google 合作伙伴,因此我无法访问生产 API。
// Handle order with Google Pay.
conv.ask(new TransactionDecision({
orderOptions: {
requestDeliveryAddress: true,
userInfoOptions: {
userInfoProperties: [
'EMAIL',
],
},
},
paymentParameters: {
googlePaymentOption: {
facilitationSpec: JSON.stringify({
apiVersion: 2,
apiVersionMinor: 0,
environment: 'TEST',
merchantInfo: {
merchantName: 'Example Merchant',
merchantId: '12345678901234567890',
},
allowedPaymentMethods: [
{
type: 'CARD',
parameters: {
allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
allowedCardNetworks: [
'AMEX', 'DISCOVER', 'JCB', 'MASTERCARD', 'VISA',
],
},
tokenizationSpecification: {
type: 'PAYMENT_GATEWAY',
parameters: {
'gateway': 'my_gateway',
'gatewayMerchantId': 'my_gateway_id',
},
},
},
],
transactionInfo: {
totalPriceStatus: 'FINAL',
totalPrice: prodPriceInclBtwInMicros.toString(),
currencyCode: 'EUR',
},
}),
},
},
presentationOptions: {
actionDisplayName: 'PLACE_ORDER',
},
order: order,
}));
处理事务决策值的意图获得以下arg
值:
const arg = conv.arguments.get('TRANSACTION_DECISION_VALUE');
{
'@type': 'type.googleapis.com/google.actions.transactions.v3.TransactionDecisionValue',
transactionDecision: 'ORDER_ACCEPTED',
order: {
googleOrderId: '02458320178127324049',
merchantOrderId: 'example',
userVisibleOrderId: 'example',
buyerInfo: {
email: 'example@example.com',
firstName: 'example',
lastName: 'example',
displayName: 'example example'
},
createTime: '2020-07-21T10:59:16.624Z',
lastUpdateTime: '2020-07-21T10:59:16.624Z',
transactionMerchant: { name: 'Example Merchant' },
contents: { lineItems: [Array] },
priceAttributes: [ [Object], [Object], [Object] ],
paymentData: { paymentResult: [Object], paymentInfo: [Object] },
purchase: {
status: 'CREATED',
type: 'RETAIL',
userVisibleStatusLabel: 'CREATED'
},
vertical: {
'@type': 'type.googleapis.com/google.actions.orders.v3.verticals.purchase.PurchaseOrderExtension',
status: 'CREATED',
type: 'RETAIL',
userVisibleStatusLabel: 'CREATED'
}
}
}
根据 [Adyen][1],我应该提供支付令牌:“从 Google Pay API 的 PaymentData 响应中获取令牌。” [Google][2] 声明在用户批准付款后,令牌将在响应对象中返回。这肯定不是在 `arg` 对象中可以看到的情况。
通过深入挖掘 paymentData,我们得到以下值:
{
paymentResult: {
googlePaymentData: '{"signature":"MEYCIQDS8Tiu9bprWqamQ24oNx+Wa43Wg6Vi3sP5PArDeOtOEAIhAOBqe4sQvN5tD390qWzDn9DIgwA8gjS8ajynrusOix6O","protocolVersion":"ECv1","signedMessage":"{\\"encryptedMessage\\":\\"Some_tokens_IUHASIDHUSAGFUAHS\\",\\"ephemeralPublicKey\\":\\"SOMEKEYSASD\\\\u003d\\",\\"tag\\":\\"SOMETAG_OIASJDJSOIJ\\\\u003d\\"}"}'
},
paymentInfo: {
paymentMethodDisplayInfo: {
paymentType: 'PAYMENT_CARD',
paymentMethodDisplayName: 'Visa •••• 1234'
},
paymentMethodProvenance: 'PAYMENT_METHOD_PROVENANCE_GOOGLE'
}
}
响应中仍然没有token
返回...这对于网关来说是必需的。
有谁知道如何解决这个问题?或者这与生产事务 API 有关系吗?
任何帮助表示赞赏。[1]:https ://docs.adyen.com/payment-methods/google-pay/api-only [2]:https ://developers.google.com/pay/api/web/reference/response-objects #PaymentData
解决方案
推荐阅读
- sql - 使用交叉应用时 SQL Server 计算百分比
- django - 如何使用隐藏逻辑通过 UpdateView 更新 CustomUser 值
- oracle - 查询中的 GROUP BY 问题
- excel - 使用 ActiveWorkbook.Path 在电子邮件中插入图像
- c++ - OpenCV 访问当前和上一帧
- python - TensorFlow 2.1 - 类型错误:padded_batch() 缺少 1 个必需的位置参数:'padded_shapes'
- apache-kafka - 如何解释来自 kafka 连接源任务的活动记录计数指标?
- rx-java - Rx 和协程之间的桥梁
- google-api - Google 语音转文本 API 不返回任何内容,甚至不返回错误
- amazon-web-services - AWS Lambda 和 SES - 向多个用户发送个人电子邮件 [30 秒 lambda 限制问题]