@alipay/ams-checkout 0.0.1711691167-dev.4 → 0.0.1711691167-dev.7

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,6 +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 { submitPayInfo } from "../../service";
22
23
  import { eventCodeEnum, payPalConfigurationIntentEnum, PaypalMethodEnum } from "../../types";
23
24
  import { isFunction } from "../../util";
24
25
  import { appendLoadingIcon, isShowLoading } from "../utils";
@@ -172,11 +173,32 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
172
173
  }());
173
174
  _defineProperty(_assertThisInitialized(_this), "createOrder", /*#__PURE__*/function () {
174
175
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_data, _action, paymentSessionData) {
176
+ var _submitPayInfoRes$ext;
177
+ var submitPayInfoRes;
175
178
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
176
179
  while (1) switch (_context2.prev = _context2.next) {
177
180
  case 0:
178
- return _context2.abrupt("return", '0LP997257N0409033');
179
- case 1:
181
+ _context2.next = 2;
182
+ return submitPayInfo({
183
+ paymentSessionData: paymentSessionData
184
+ }, {}, _this.logger);
185
+ case 2:
186
+ submitPayInfoRes = _context2.sent;
187
+ 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))) {
188
+ _context2.next = 7;
189
+ break;
190
+ }
191
+ _this.logger.logInfo({
192
+ title: 'paypal_payment_failed'
193
+ });
194
+ _this.onEventCallback({
195
+ code: eventCodeEnum.SDK_PAYMENT_FAIL,
196
+ message: 'Create order failed.'
197
+ });
198
+ return _context2.abrupt("return");
199
+ case 7:
200
+ return _context2.abrupt("return", submitPayInfoRes.extendInfo.channelOrderId);
201
+ case 8:
180
202
  case "end":
181
203
  return _context2.stop();
182
204
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1711691167-dev.4",
3
+ "version": "0.0.1711691167-dev.7",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",