@alipay/ams-checkout 0.0.1711691167-dev.10 → 0.0.1711691167-dev.12
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.
@@ -19,7 +19,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
19
19
|
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); }
|
20
20
|
import { BusManager, BusMessage, BusSubscriber } from "../../core/bus";
|
21
21
|
import { PaypalActionEnum, SDKCallbackActionEnum } from "../../core/bus/interface";
|
22
|
-
import {
|
22
|
+
import { queryPaymentInfo } from "../../service";
|
23
23
|
import { eventCodeEnum, payPalConfigurationIntentEnum, PaypalMethodEnum } from "../../types";
|
24
24
|
import { isFunction } from "../../util";
|
25
25
|
import { appendLoadingIcon, isShowLoading } from "../utils";
|
@@ -172,19 +172,22 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
172
172
|
};
|
173
173
|
}());
|
174
174
|
_defineProperty(_assertThisInitialized(_this), "createOrder", /*#__PURE__*/function () {
|
175
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_data, _action, paymentSessionData) {
|
176
|
-
var
|
177
|
-
var
|
175
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_data, _action, paymentSessionData, env) {
|
176
|
+
var _queryPaymentInfoRes$;
|
177
|
+
var queryPaymentInfoRes;
|
178
178
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
179
179
|
while (1) switch (_context2.prev = _context2.next) {
|
180
180
|
case 0:
|
181
181
|
_context2.next = 2;
|
182
|
-
return
|
182
|
+
return queryPaymentInfo({
|
183
183
|
paymentSessionData: paymentSessionData
|
184
|
-
}, {
|
184
|
+
}, {
|
185
|
+
env: env,
|
186
|
+
timeout: 15000
|
187
|
+
}, _this.logger);
|
185
188
|
case 2:
|
186
|
-
|
187
|
-
if (!(!(
|
189
|
+
queryPaymentInfoRes = _context2.sent;
|
190
|
+
if (!(!(queryPaymentInfoRes !== null && queryPaymentInfoRes !== void 0 && queryPaymentInfoRes.success) || !(queryPaymentInfoRes !== null && queryPaymentInfoRes !== void 0 && (_queryPaymentInfoRes$ = queryPaymentInfoRes.extendInfo) !== null && _queryPaymentInfoRes$ !== void 0 && _queryPaymentInfoRes$.channelOrderId))) {
|
188
191
|
_context2.next = 7;
|
189
192
|
break;
|
190
193
|
}
|
@@ -197,14 +200,14 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
197
200
|
});
|
198
201
|
return _context2.abrupt("return");
|
199
202
|
case 7:
|
200
|
-
return _context2.abrupt("return",
|
203
|
+
return _context2.abrupt("return", queryPaymentInfoRes.extendInfo.channelOrderId);
|
201
204
|
case 8:
|
202
205
|
case "end":
|
203
206
|
return _context2.stop();
|
204
207
|
}
|
205
208
|
}, _callee2);
|
206
209
|
}));
|
207
|
-
return function (_x2, _x3, _x4) {
|
210
|
+
return function (_x2, _x3, _x4, _x5) {
|
208
211
|
return _ref4.apply(this, arguments);
|
209
212
|
};
|
210
213
|
}());
|
@@ -230,7 +233,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
230
233
|
}
|
231
234
|
}, _callee3);
|
232
235
|
}));
|
233
|
-
return function (
|
236
|
+
return function (_x6) {
|
234
237
|
return _ref5.apply(this, arguments);
|
235
238
|
};
|
236
239
|
}());
|
@@ -256,7 +259,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
256
259
|
}
|
257
260
|
}, _callee4);
|
258
261
|
}));
|
259
|
-
return function (
|
262
|
+
return function (_x7) {
|
260
263
|
return _ref6.apply(this, arguments);
|
261
264
|
};
|
262
265
|
}());
|
@@ -280,7 +283,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
280
283
|
}
|
281
284
|
}, _callee5);
|
282
285
|
}));
|
283
|
-
return function (
|
286
|
+
return function (_x8, _x9) {
|
284
287
|
return _ref7.apply(this, arguments);
|
285
288
|
};
|
286
289
|
}());
|
@@ -296,6 +299,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
296
299
|
key: "renderPaypalButton",
|
297
300
|
value: function renderPaypalButton(context, message) {
|
298
301
|
var _data$options,
|
302
|
+
_data$options2,
|
299
303
|
_data$appendParams,
|
300
304
|
_data$appendParams2,
|
301
305
|
_data$appendParams3,
|
@@ -305,6 +309,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
305
309
|
var data = message.getJSONObject();
|
306
310
|
var paypalPluginProps = {
|
307
311
|
locale: (_data$options = data.options) === null || _data$options === void 0 ? void 0 : _data$options.locale,
|
312
|
+
environment: (_data$options2 = data.options) === null || _data$options2 === void 0 ? void 0 : _data$options2.environment,
|
308
313
|
paymentSessionData: (_data$appendParams = data.appendParams) === null || _data$appendParams === void 0 || (_data$appendParams = _data$appendParams.iframeNodesParams) === null || _data$appendParams === void 0 ? void 0 : _data$appendParams.sessionData,
|
309
314
|
paymentSessionFactor: (_data$appendParams2 = data.appendParams) === null || _data$appendParams2 === void 0 || (_data$appendParams2 = _data$appendParams2.iframeNodesParams) === null || _data$appendParams2 === void 0 || (_data$appendParams2 = _data$appendParams2.paymentSessionMetaData) === null || _data$appendParams2 === void 0 ? void 0 : _data$appendParams2.paymentSessionFactor,
|
310
315
|
selector: (_data$appendParams3 = data.appendParams) === null || _data$appendParams3 === void 0 || (_data$appendParams3 = _data$appendParams3.iframeNodesParams) === null || _data$appendParams3 === void 0 ? void 0 : _data$appendParams3.selector,
|
@@ -323,7 +328,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
323
328
|
fundingSource: undefined,
|
324
329
|
onShippingChange: _this2.onShippingChange,
|
325
330
|
createOrder: function createOrder(data, action) {
|
326
|
-
return _this2.createOrder(data, action, paypalPluginProps.paymentSessionData);
|
331
|
+
return _this2.createOrder(data, action, paypalPluginProps.paymentSessionData, paypalPluginProps.environment);
|
327
332
|
},
|
328
333
|
onApprove: _this2.onApprove,
|
329
334
|
onCancel: _this2.onCancel
|
package/esm/types/index.d.ts
CHANGED