Dialog Flow /gogle action 支付网关(交易集成)或集成任何第三方支付网关

Dialog Flow /gogle action Payment gateway (Transaction Integration) or Integrate any third party payment gateway

我正在使用 google assistant / Dialogflow 处理支付相关的应用程序。我在下面参考 google 参考 url 但我什么都不懂。

https://developers.google.com/actions/transactions/

最后我使用了这个方法用Google支付建立物理交易。我将以下代码与我的应用程序集成,但它抛出 Application not responding right now .

conv.ask(new TransactionRequirements({
  orderOptions: {
    requestDeliveryAddress: false,
  },
  paymentOptions: {
    googleProvidedOptions: {
      prepaidCardDisallowed: false,
      supportedCardNetworks: ['VISA', 'AMEX'],
      // These will be provided by payment processor,
      // like Stripe, Braintree, or Vantiv.
      tokenizationParameters: {},
    },
  },
}));

const arg = conv.arguments.get('TRANSACTION_REQUIREMENTS_CHECK_RESULT');
  if (arg && arg.resultType ==='OK') {
    // Normally take the user through cart building flow
    conv.ask(`Looks like you're good to go! ` +
      `Try saying "Get Delivery Address".`);
  } else {
    conv.close('Transaction failed.');
  }

请告知如何在 google assistant 中集成任何支付网关。

tokenizationParameters 对象为空,这将导致您的应用程序抛出您提到的错误。

如果您还没有设置支付网关,您可以提供占位符值来避免错误,直到您准备好设置支付。

以下是支付处理器 Stripe 的示例占位符标记化参数:

tokenizationParameters: {
      parameters: {
        "gateway": "braintree",
        "braintree:sdkVersion": "1.4.0",
        "braintree:apiVersion": "v1",
        "braintree:merchantId": "xxxxxxxxxxx",
        "braintree:clientKey": "sandbox_xxxxxxxxxxxxxxx",
        "braintree:authorizationFingerprint": "sandbox_xxxxxxxxxxxxxxx"
      },
      tokenizationType: "PAYMENT_GATEWAY"
    },

您还可以查看 GitHub 上提供的 open source transaction sample code,以更好地了解如何使用事务创建操作。