@alipay/ams-checkout 0.0.1711691167-dev.13 → 0.0.1711691167-dev.15

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.
@@ -21,7 +21,7 @@ import { BusManager, BusMessage, BusSubscriber } from "../../core/bus";
21
21
  import { PaypalActionEnum, SDKCallbackActionEnum } from "../../core/bus/interface";
22
22
  import { queryPaymentInfo } from "../../service";
23
23
  import { eventCodeEnum, payPalConfigurationIntentEnum, PaypalMethodEnum } from "../../types";
24
- import { isFunction, safeJson } from "../../util";
24
+ import { isFunction } from "../../util";
25
25
  import { appendLoadingIcon, isShowLoading } from "../utils";
26
26
  export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
27
27
  _inherits(PaypalBusSubscriber, _BusSubscriber);
@@ -71,8 +71,8 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
71
71
  }
72
72
  });
73
73
  _defineProperty(_assertThisInitialized(_this), "preCheck", function (paypalPluginProps) {
74
- var _safeJson, _paypalPluginProps$pa, _paypalPluginProps$pa2;
75
- var boundPaymentMethod = (_safeJson = safeJson((((_paypalPluginProps$pa = paypalPluginProps.paymentSessionFactor) === null || _paypalPluginProps$pa === void 0 || (_paypalPluginProps$pa = _paypalPluginProps$pa.paymentMethodInfo) === null || _paypalPluginProps$pa === void 0 ? void 0 : _paypalPluginProps$pa.paymentMethodMetaData) || '').replace(/\\"/g, '"'), {})) === null || _safeJson === void 0 ? void 0 : _safeJson.boundPaymentMethod;
74
+ var _paypalPluginProps$pa, _paypalPluginProps$pa2;
75
+ var boundPaymentMethod = (_paypalPluginProps$pa = paypalPluginProps.paymentSessionFactor) === null || _paypalPluginProps$pa === void 0 || (_paypalPluginProps$pa = _paypalPluginProps$pa.paymentMethodInfo) === null || _paypalPluginProps$pa === void 0 || (_paypalPluginProps$pa = _paypalPluginProps$pa.paymentMethodMetaData) === null || _paypalPluginProps$pa === void 0 ? void 0 : _paypalPluginProps$pa.boundPaymentMethod;
76
76
  var paymentMethodType = (_paypalPluginProps$pa2 = paypalPluginProps.paymentSessionFactor) === null || _paypalPluginProps$pa2 === void 0 || (_paypalPluginProps$pa2 = _paypalPluginProps$pa2.paymentMethodInfo) === null || _paypalPluginProps$pa2 === void 0 ? void 0 : _paypalPluginProps$pa2.paymentMethodType;
77
77
  if (boundPaymentMethod && PaypalMethodEnum.PAYPAL_VAULT === paymentMethodType) {
78
78
  _this.onEventCallback({
@@ -114,6 +114,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
114
114
  var _ref2 = (paypalPluginProps === null || paypalPluginProps === void 0 ? void 0 : paypalPluginProps.paypalConfiguration) || {},
115
115
  blockPayPalCreditButton = _ref2.blockPayPalCreditButton,
116
116
  blockPayPalPayLaterButton = _ref2.blockPayPalPayLaterButton,
117
+ displayPayPalPayLaterButtonOnly = _ref2.displayPayPalPayLaterButtonOnly,
117
118
  enableMessages = _ref2.enableMessages,
118
119
  intent = _ref2.intent;
119
120
  var script = document.createElement('script');
@@ -124,10 +125,10 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
124
125
  'client-id': channelMerchantAccountId
125
126
  });
126
127
  var disableFundingArr = [];
127
- if (blockPayPalCreditButton) {
128
+ if (blockPayPalCreditButton && !displayPayPalPayLaterButtonOnly) {
128
129
  disableFundingArr.push('card');
129
130
  }
130
- if (blockPayPalPayLaterButton) {
131
+ if (blockPayPalPayLaterButton && !displayPayPalPayLaterButtonOnly) {
131
132
  disableFundingArr.push('credit');
132
133
  }
133
134
  if (disableFundingArr.length) {
@@ -215,7 +215,7 @@ export interface IPaymentSessionFactor {
215
215
  paymentAmount?: IPaymentAmount;
216
216
  }
217
217
  export interface IPaymentMethodInfo {
218
- paymentMethodMetaData?: string;
218
+ paymentMethodMetaData?: IPaymentMethodMetaData;
219
219
  paymentMethodType?: PaypalMethodEnum;
220
220
  paypal?: IPaypalConfig;
221
221
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1711691167-dev.13",
3
+ "version": "0.0.1711691167-dev.15",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",