@alipay/ams-checkout 0.0.1711691167-dev.14 → 0.0.1711691167-dev.16
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.
@@ -107,13 +107,14 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
107
107
|
_defineProperty(_assertThisInitialized(_this), "createPaypalScript", function (paypalPluginProps) {
|
108
108
|
var _paypalPluginProps$pa3, _paypalPluginProps$pa4, _paypalPluginProps$pa5, _paypalPluginProps$pa6;
|
109
109
|
var channelMerchantAccountId = (_paypalPluginProps$pa3 = paypalPluginProps.paymentSessionFactor) === null || _paypalPluginProps$pa3 === void 0 || (_paypalPluginProps$pa3 = _paypalPluginProps$pa3.merchantInfo) === null || _paypalPluginProps$pa3 === void 0 ? void 0 : _paypalPluginProps$pa3.channelMerchantClientId;
|
110
|
-
var accessToken = (_paypalPluginProps$pa4 = paypalPluginProps.paymentSessionFactor) === null || _paypalPluginProps$pa4 === void 0 || (_paypalPluginProps$pa4 = _paypalPluginProps$pa4.
|
110
|
+
var accessToken = (_paypalPluginProps$pa4 = paypalPluginProps.paymentSessionFactor) === null || _paypalPluginProps$pa4 === void 0 || (_paypalPluginProps$pa4 = _paypalPluginProps$pa4.paypal) === null || _paypalPluginProps$pa4 === void 0 ? void 0 : _paypalPluginProps$pa4.accessToken;
|
111
111
|
var locale = paypalPluginProps.locale;
|
112
112
|
var currency = (_paypalPluginProps$pa5 = paypalPluginProps.paymentSessionFactor) === null || _paypalPluginProps$pa5 === void 0 || (_paypalPluginProps$pa5 = _paypalPluginProps$pa5.paymentAmount) === null || _paypalPluginProps$pa5 === void 0 ? void 0 : _paypalPluginProps$pa5.currency;
|
113
113
|
var paymentMethodType = (_paypalPluginProps$pa6 = paypalPluginProps.paymentSessionFactor) === null || _paypalPluginProps$pa6 === void 0 || (_paypalPluginProps$pa6 = _paypalPluginProps$pa6.paymentMethodInfo) === null || _paypalPluginProps$pa6 === void 0 ? void 0 : _paypalPluginProps$pa6.paymentMethodType;
|
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) {
|
@@ -147,7 +148,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
147
148
|
}
|
148
149
|
src += urlSearchParams.toString();
|
149
150
|
script.src = src;
|
150
|
-
script
|
151
|
+
script.setAttribute('data-user-id-token', accessToken);
|
151
152
|
return script;
|
152
153
|
});
|
153
154
|
_defineProperty(_assertThisInitialized(_this), "onShippingChange", /*#__PURE__*/function () {
|
package/esm/types/index.d.ts
CHANGED
@@ -213,11 +213,11 @@ export interface IPaymentSessionFactor {
|
|
213
213
|
merchantInfo?: IMerchantInfo;
|
214
214
|
paymentMethodInfo: IPaymentMethodInfo;
|
215
215
|
paymentAmount?: IPaymentAmount;
|
216
|
+
paypal?: IPaypalConfig;
|
216
217
|
}
|
217
218
|
export interface IPaymentMethodInfo {
|
218
219
|
paymentMethodMetaData?: IPaymentMethodMetaData;
|
219
220
|
paymentMethodType?: PaypalMethodEnum;
|
220
|
-
paypal?: IPaypalConfig;
|
221
221
|
}
|
222
222
|
export type IPaypalConfig = {
|
223
223
|
accessToken: string;
|