@alipay/ams-checkout 0.0.1750304078-dev.3 → 0.0.1751254427-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,8 +103,21 @@ export var handleGooglePay = function handleGooglePay(data) {
103
103
  }
104
104
  }
105
105
  });
106
- // 获取到googlePay token后返回消息给app
107
- paymentsClient.loadPaymentData(paymentRequest).then(function (paymentData) {
106
+ // 使用GooglePay官方API判断设备是否支持,目前WebView场景有bug,不支持的WebView仍然显示支持
107
+ // UA判断方案和isReadyToPay方案PD决策使用【isReadyToPay方案】
108
+ // PD已反馈给Google,Google已确认bug待修复
109
+ paymentsClient.isReadyToPay(paymentRequest).then(function (response) {
110
+ if (response.result) {
111
+ // 设备支持 GooglePay,继续拉起
112
+ return paymentsClient.loadPaymentData(paymentRequest);
113
+ } else {
114
+ // 抛错给收银台,目前errorCode未消费
115
+ reject({
116
+ errorCode: 'GOOGLE_PAY_NOT_SUPPORTED'
117
+ });
118
+ }
119
+ }).then(function (paymentData) {
120
+ // 获取到googlePay token后返回消息给app
108
121
  if (paymentData) {
109
122
  resolve(paymentData);
110
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1750304078-dev.3",
3
+ "version": "0.0.1751254427-dev.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",