@alipay/ams-checkout 0.0.1747014711-dev.4 → 0.0.1747300438-dev.0
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.
@@ -9,7 +9,6 @@ import { v4 as uuid } from 'uuid';
|
|
9
9
|
import { EnvironmentEnum } from "../../../types";
|
10
10
|
import { queryParse } from "../../../util";
|
11
11
|
import { LogConfig, Logger } from "../../../util/logger";
|
12
|
-
import { handleRedirect } from "../element/util";
|
13
12
|
var CKP_PAYMENT_PAGE_HOST = {
|
14
13
|
DEV: 'https://dev.page.alipay.net',
|
15
14
|
TEST: 'https://test.page.alipay.net',
|
@@ -69,15 +68,10 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
|
|
69
68
|
return url;
|
70
69
|
});
|
71
70
|
_defineProperty(this, "eventListenerWrapper", function (event) {
|
72
|
-
var dataObj = JSON.parse(event.data) || {};
|
73
71
|
var _ref = JSON.parse(event.data) || {},
|
74
72
|
code = _ref.code,
|
75
73
|
message = _ref.message,
|
76
74
|
result = _ref.result;
|
77
|
-
var _dataObj$context = dataObj === null || dataObj === void 0 ? void 0 : dataObj.context,
|
78
|
-
eventCode = _dataObj$context.event,
|
79
|
-
data = _dataObj$context.data;
|
80
|
-
console.log("🚀 ~ AMSCheckoutPage ~ dataObj:", dataObj);
|
81
75
|
if (code && code.startsWith('SDK_PAYMENT')) {
|
82
76
|
var _this$eventListener;
|
83
77
|
console.log('[antom-web-sdk] <antom-checkout-page> eventListenerWrapper', event, message, result);
|
@@ -87,16 +81,6 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
|
|
87
81
|
result: result
|
88
82
|
});
|
89
83
|
}
|
90
|
-
if (eventCode && eventCode !== null && eventCode !== void 0 && eventCode.startsWith('onRedirectCode')) {
|
91
|
-
var _this$eventListener2;
|
92
|
-
console.log(eventCode, '[antom-web-sdk] <antom-checkout-page> onRedirectCode', data);
|
93
|
-
(_this$eventListener2 = _this.eventListener) === null || _this$eventListener2 === void 0 || _this$eventListener2.call(_this, {
|
94
|
-
code: code,
|
95
|
-
message: message,
|
96
|
-
result: result
|
97
|
-
});
|
98
|
-
handleRedirect(data);
|
99
|
-
}
|
100
84
|
});
|
101
85
|
_defineProperty(this, "addListener", function () {
|
102
86
|
window.addEventListener('message', _this.eventListenerWrapper);
|
@@ -145,7 +129,6 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
|
|
145
129
|
throw new Error('PARAMS_ERROR_ALREADY_MOUNTED');
|
146
130
|
}
|
147
131
|
this.addListener();
|
148
|
-
console.log("🚀 ~ AMSCheckoutPage======== ~ event:", event);
|
149
132
|
var ckpPageAddress = this.generateIframeSrc(params.sessionData);
|
150
133
|
var iframe = document.createElement('iframe');
|
151
134
|
iframe.id = this.APP_IFRAME_ID;
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
6
6
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
7
7
|
*/
|
8
|
-
import { ComponentActionNamesType } from '
|
8
|
+
import { ComponentActionNamesType } from '../../plugin/type';
|
9
9
|
import ComponentApp from '../../plugin/component';
|
10
10
|
import type { AMSCheckoutOptions, IAppendParams, InitSecurityConfig, IoptionsParams } from '../../types/index';
|
11
11
|
import { EventCenter } from '../../util/index';
|
package/esm/plugin/type.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BusSubscriber } from '
|
1
|
+
import { BusSubscriber } from '../core/bus';
|
2
2
|
import { PaymentMethodCategoryTypeEnum, ProductSceneEnum, ProductSceneVersion } from '../types';
|
3
3
|
export type IExtendPlugin = IExtendPluginItem[];
|
4
4
|
export interface ComponentActionNamesType {
|