@alipay/ams-checkout 0.0.1757400863-dev.2 → 0.0.1757400863-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.
@@ -242,7 +242,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
242
242
  value: function () {
243
243
  var _startBizFlow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(options) {
244
244
  var _this$paymentContext$, _this$paymentContext$2, _this$paymentContext$3;
245
- var paymentSession, displayInfo, _convertPaymentSessio2, paymentSessionId, paymentSessionMetaData, mid, webAppMatchConfig, webAppVersion, productScene, paymentMethod, _this$bizFlowStartBeh, payload;
245
+ var paymentSession, displayInfo, _convertPaymentSessio2, paymentSessionId, paymentSessionMetaData, mid, webAppMatchConfig, webAppVersion, productScene, paymentMethod, _this$bizFlowStartBeh, payload, eventCenter, data;
246
246
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
247
247
  while (1) switch (_context4.prev = _context4.next) {
248
248
  case 0:
@@ -322,13 +322,31 @@ export var AntomSDKCore = /*#__PURE__*/function () {
322
322
  return _context4.abrupt("return");
323
323
  case 36:
324
324
  if (!(this.bizFlowStartBehavior.behaviorType === 'REDIRECT')) {
325
- _context4.next = 40;
325
+ _context4.next = 45;
326
326
  break;
327
327
  }
328
328
  payload = (_this$bizFlowStartBeh = this.bizFlowStartBehavior) === null || _this$bizFlowStartBeh === void 0 ? void 0 : _this$bizFlowStartBeh.payload;
329
+ if (!options.isNativeAppWebview) {
330
+ _context4.next = 43;
331
+ break;
332
+ }
333
+ eventCenter = ServiceProvider.getInstance(this.instanceId).getService('EventCenter');
334
+ data = {
335
+ normalUrl: (payload === null || payload === void 0 ? void 0 : payload.url) || '',
336
+ schemeUrl: (payload === null || payload === void 0 ? void 0 : payload.schemeUrl) || '',
337
+ applinkUrl: (payload === null || payload === void 0 ? void 0 : payload.applinkUrl) || ''
338
+ };
339
+ eventCenter.emit(EVENT.eventCallback.name, {
340
+ code: eventCodeEnum.SDK_REDIRECT,
341
+ result: {
342
+ redirectUrls: data
343
+ }
344
+ });
345
+ return _context4.abrupt("return");
346
+ case 43:
329
347
  redirect(payload, this.instanceId);
330
348
  return _context4.abrupt("return");
331
- case 40:
349
+ case 45:
332
350
  case "end":
333
351
  return _context4.stop();
334
352
  }
@@ -20,6 +20,7 @@ export interface StartBizFlowOptions {
20
20
  displayInfo?: Partial<DisplayInfo>;
21
21
  submitPayRequestExtra?: any;
22
22
  isAppWebview?: boolean;
23
+ isNativeAppWebview?: boolean;
23
24
  }
24
25
  export declare class DisplayInfo {
25
26
  type: DisplayTypeEnum;
@@ -208,6 +208,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
208
208
  appearance: (_this$paymentContext$ = _this.paymentContext.displayInfo) === null || _this$paymentContext$ === void 0 ? void 0 : _this$paymentContext$.appearance,
209
209
  notRedirectAfterComplete: ((_this$paymentContext$2 = _this.paymentContext.startBizFlowOptions.submitPayRequestExtra) === null || _this$paymentContext$2 === void 0 ? void 0 : _this$paymentContext$2.notRedirectAfterComplete) === true,
210
210
  isAppWebview: _this.paymentContext.startBizFlowOptions.isAppWebview,
211
+ isNativeAppWebview: _this.paymentContext.startBizFlowOptions.isNativeAppWebview,
211
212
  merchantAppointParam: (_this$paymentContext$3 = _this.paymentContext.startBizFlowOptions.submitPayRequestExtra) === null || _this$paymentContext$3 === void 0 ? void 0 : _this$paymentContext$3.merchantAppointParam,
212
213
  allowSubmitPayCallAhead: _this.allowSubmitPayCallAhead,
213
214
  doubleFaUrl: getDoubleFaUrlFromSession((_this$paymentContext3 = _this.paymentContext) === null || _this$paymentContext3 === void 0 ? void 0 : _this$paymentContext3.paymentSessionObj, _this.initConfig.environment),
package/esm/index.js CHANGED
@@ -251,7 +251,8 @@ export var AMSEasyPay = /*#__PURE__*/function () {
251
251
  displayInfo: {
252
252
  type: DisplayTypeEnum.popup
253
253
  },
254
- isAppWebview: params.isAppWebview
254
+ isAppWebview: params.isAppWebview,
255
+ isNativeAppWebview: params.isNativeAppWebview
255
256
  });
256
257
  }
257
258
  }, {
@@ -26,6 +26,7 @@ export default class ComponentApp {
26
26
  private _renderDisplayType;
27
27
  private _multipleCallbackEvents;
28
28
  private _isAppWebview;
29
+ private _isNativeAppWebview;
29
30
  _merchantAppointParam: IMerchantAppointParam;
30
31
  private _webAppHeartBeatTimeoutFn;
31
32
  private _hasRenderComponent;
@@ -60,6 +60,7 @@ var ComponentApp = /*#__PURE__*/function () {
60
60
  _defineProperty(this, "_renderDisplayType", DisplayTypeEnum.popup);
61
61
  _defineProperty(this, "_multipleCallbackEvents", void 0);
62
62
  _defineProperty(this, "_isAppWebview", void 0);
63
+ _defineProperty(this, "_isNativeAppWebview", void 0);
63
64
  _defineProperty(this, "_merchantAppointParam", void 0);
64
65
  _defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
65
66
  _defineProperty(this, "_hasRenderComponent", false);
@@ -282,6 +283,7 @@ var ComponentApp = /*#__PURE__*/function () {
282
283
  var inlineId = "".concat(COMPONENT_CONTAINER_ID).concat(appendAliasContainerId);
283
284
  var insertedNode = (this === null || this === void 0 ? void 0 : this._renderDisplayType) === DisplayTypeEnum.inline ? "#".concat(inlineId) : this === null || this === void 0 ? void 0 : this._selector;
284
285
  this._isAppWebview = renderParams.isAppWebview;
286
+ this._isNativeAppWebview = renderParams.isNativeAppWebview;
285
287
  this.initLoggerMeta();
286
288
  this.initSecurity();
287
289
  this._performanceData.push({
@@ -1863,6 +1865,7 @@ var ComponentApp = /*#__PURE__*/function () {
1863
1865
  appearance: (_this$_renderParams29 = this._renderParams) === null || _this$_renderParams29 === void 0 ? void 0 : _this$_renderParams29.appearance,
1864
1866
  notRedirectAfterComplete: ((_this$_renderParams30 = this._renderParams) === null || _this$_renderParams30 === void 0 ? void 0 : _this$_renderParams30.notRedirectAfterComplete) === true,
1865
1867
  isAppWebview: this._isAppWebview,
1868
+ isNativeAppWebview: this._isNativeAppWebview,
1866
1869
  merchantAppointParam: this._merchantAppointParam,
1867
1870
  allowSubmitPayCallAhead: this._allowSubmitPayCallAhead,
1868
1871
  /** 地址组件集成的参数 */
@@ -123,6 +123,7 @@ export interface IcreateComponent {
123
123
  };
124
124
  isAppWebview?: boolean;
125
125
  merchantAppointParam?: IMerchantAppointParam;
126
+ isNativeAppWebview?: boolean;
126
127
  }
127
128
  export interface IappendIframeNodesParams extends IcreateComponent {
128
129
  paymentSessionMetaData: IPaymentSessionMetaData;
@@ -425,6 +426,11 @@ export type EventCallbackResult = {
425
426
  resultStatus: string;
426
427
  resultMessage: string;
427
428
  };
429
+ redirectUrls?: {
430
+ applinkUrl?: string;
431
+ schemeUrl?: string;
432
+ normalUrl?: string;
433
+ };
428
434
  paymentResultCode?: string;
429
435
  paymentResultMessage?: string;
430
436
  paymentStatus?: string;
@@ -674,7 +680,11 @@ export declare enum eventCodeEnum {
674
680
  SDK_PAYMENT_PROCESSING = "SDK_PAYMENT_PROCESSING",
675
681
  SDK_PAYMENT_WARN = "SDK_PAYMENT_WARN",
676
682
  SDK_PAYMENT_SHIPPINGCHANGE = "SDK_PAYMENT_SHIPPINGCHANGE",
677
- SDK_PAYMENT_APPROVE = "SDK_PAYMENT_APPROVE"
683
+ SDK_PAYMENT_APPROVE = "SDK_PAYMENT_APPROVE",
684
+ /**
685
+ * ESP createComponent时传参isNativeAppWebview:true,ESP外跳授权时透传此SDK给商户
686
+ */
687
+ SDK_REDIRECT = "SDK_REDIRECT"
678
688
  }
679
689
  export declare enum RedirectType {
680
690
  ApplinkUrl = "ApplinkUrl",
@@ -194,6 +194,7 @@ export var eventCodeEnum = /*#__PURE__*/function (eventCodeEnum) {
194
194
  eventCodeEnum["SDK_PAYMENT_WARN"] = "SDK_PAYMENT_WARN";
195
195
  eventCodeEnum["SDK_PAYMENT_SHIPPINGCHANGE"] = "SDK_PAYMENT_SHIPPINGCHANGE";
196
196
  eventCodeEnum["SDK_PAYMENT_APPROVE"] = "SDK_PAYMENT_APPROVE";
197
+ eventCodeEnum["SDK_REDIRECT"] = "SDK_REDIRECT";
197
198
  return eventCodeEnum;
198
199
  }({});
199
200
  export var RedirectType = /*#__PURE__*/function (RedirectType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1757400863-dev.2",
3
+ "version": "0.0.1757400863-dev.3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",