@alipay/ams-checkout 0.0.1711691167-dev.2 → 0.0.1711691167-dev.3
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.
@@ -17,7 +17,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
18
|
import { BusManager, BusMessage, BusSubscriber } from "../../core/bus";
|
19
19
|
import { PaypalActionEnum, SDKCallbackActionEnum } from "../../core/bus/interface";
|
20
|
-
import { submitPayInfo } from "../../service";
|
21
20
|
import { eventCodeEnum, payPalConfigurationIntentEnum, PaypalMethodEnum } from "../../types";
|
22
21
|
import { isFunction } from "../../util";
|
23
22
|
import { appendLoadingIcon, isShowLoading } from "../utils";
|
@@ -122,19 +121,15 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
122
121
|
locale: locale,
|
123
122
|
'client-id': channelMerchantAccountId
|
124
123
|
});
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
}
|
135
|
-
if (disableFundingArr.length) {
|
136
|
-
urlSearchParams.append('disable-funding', disableFundingArr.join(','));
|
137
|
-
}
|
124
|
+
var disableFundingArr = [];
|
125
|
+
if (blockPayPalCreditButton) {
|
126
|
+
disableFundingArr.push('card');
|
127
|
+
}
|
128
|
+
if (blockPayPalPayLaterButton) {
|
129
|
+
disableFundingArr.push('credit');
|
130
|
+
}
|
131
|
+
if (disableFundingArr.length) {
|
132
|
+
urlSearchParams.append('disable-funding', disableFundingArr.join(','));
|
138
133
|
}
|
139
134
|
if (enableMessages) {
|
140
135
|
urlSearchParams.append('components', 'messages,buttons');
|
@@ -176,30 +171,11 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
176
171
|
}());
|
177
172
|
_defineProperty(_assertThisInitialized(_this), "createOrder", /*#__PURE__*/function () {
|
178
173
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_data, _action, paymentSessionData) {
|
179
|
-
var _submitPayInfoRes$ext;
|
180
|
-
var submitPayInfoRes;
|
181
174
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
182
175
|
while (1) switch (_context2.prev = _context2.next) {
|
183
176
|
case 0:
|
184
|
-
_context2.
|
185
|
-
|
186
|
-
case 2:
|
187
|
-
submitPayInfoRes = _context2.sent;
|
188
|
-
if (!(!(submitPayInfoRes !== null && submitPayInfoRes !== void 0 && submitPayInfoRes.success) || !(submitPayInfoRes !== null && submitPayInfoRes !== void 0 && (_submitPayInfoRes$ext = submitPayInfoRes.extendInfo) !== null && _submitPayInfoRes$ext !== void 0 && _submitPayInfoRes$ext.channelOrderId))) {
|
189
|
-
_context2.next = 7;
|
190
|
-
break;
|
191
|
-
}
|
192
|
-
_this.logger.logInfo({
|
193
|
-
title: 'paypal_payment_failed'
|
194
|
-
});
|
195
|
-
_this.onEventCallback({
|
196
|
-
code: eventCodeEnum.SDK_PAYMENT_FAIL,
|
197
|
-
message: 'Create order failed.'
|
198
|
-
});
|
199
|
-
return _context2.abrupt("return");
|
200
|
-
case 7:
|
201
|
-
return _context2.abrupt("return", submitPayInfoRes.extendInfo.channelOrderId);
|
202
|
-
case 8:
|
177
|
+
return _context2.abrupt("return", '0LP997257N0409033');
|
178
|
+
case 1:
|
203
179
|
case "end":
|
204
180
|
return _context2.stop();
|
205
181
|
}
|