gpt4 book ai didi

braintree - GooglePay DEVELOPER_ERROR“PaymentDataRequest.merchantId不存在”

转载 作者:行者123 更新时间:2023-12-03 15:21:21 28 4
gpt4 key购买 nike

获得Google Pay merchantId的批准后,尝试打开付款表时出现以下错误。

{ statusCode: "DEVELOPER_ERROR", errorCode: 2, 
statusMessage: "PaymentDataRequest.merchantId does not exist." }


我正在使用Braintree Payments,但这与结束消息无关。

   var paymentDataRequest = googlePaymentInstance.createPaymentDataRequest({

merchantId: environment.payment.googlePayMerchantId,

merchantInfo: {
merchantId: environment.payment.googlePayMerchantId
},

transactionInfo: {
currencyCode: 'USD',
totalPriceStatus: 'ESTIMATED',
totalPrice: this.priceEstimate.toFixed(2)
},

shippingAddressRequired: true,

emailRequired: true,

shippingAddressParameters: {
allowedCountryCodes: data.countryCodes.map(c => c.code)
}

// cardRequirements: {
// // We recommend collecting billing address information, at minimum
// // billing postal code, and passing that billing postal code with all
// // Google Pay transactions as a best practice.
// billingAddressRequired: true
// }
});


Google告诉我一切顺利。

最佳答案

事实证明,除了merchantId之外,传递额外的merchantInfo参数也可能导致这种情况。

所以解决方法就是这样:

  // merchantId: environment.payment.googlePayMerchantId


但是,事实也证明,如果在第一次在 merchantInfo中创建Braintree客户端时正确提供了 createPaymentDataRequest,则不需要 merchantId中的 braintree.googlePayment.create(...)

因此,以上代码中的最终解决方法是同时删除 merchantIdmerchantInfo

我不记得这是旧版API的错误还是过时的参数。在这两种情况下,这都是一个极具误导性的错误,因为该错误表明它丢失了,但实际上是一个额外的参数。

关于braintree - GooglePay DEVELOPER_ERROR“PaymentDataRequest.merchantId不存在”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57015699/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com