@alipay/ams-checkout 0.0.1691743027-dev.9 → 0.0.1691995963-dev.1

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.
Files changed (40) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/config/index.d.ts +15 -1
  3. package/esm/config/index.js +62 -9
  4. package/esm/constant/index.d.ts +32 -54
  5. package/esm/constant/index.js +32 -54
  6. package/esm/core/component/index.d.ts +9 -23
  7. package/esm/core/component/index.js +98 -161
  8. package/esm/core/drop-in/index.d.ts +4 -4
  9. package/esm/core/drop-in/index.js +3 -3
  10. package/esm/core/instance/index.d.ts +23 -6
  11. package/esm/core/instance/index.js +75 -31
  12. package/esm/index.d.ts +10 -4
  13. package/esm/index.js +30 -8
  14. package/esm/plugin/component/cashierApp.d.ts +6 -5
  15. package/esm/plugin/component/cashierApp.js +64 -48
  16. package/esm/plugin/component/{component.inline.style.d.ts → component.style.d.ts} +1 -4
  17. package/esm/plugin/component/component.style.js +15 -0
  18. package/esm/plugin/component/index.d.ts +33 -30
  19. package/esm/plugin/component/index.js +349 -248
  20. package/esm/plugin/drop-in/index.d.ts +5 -3
  21. package/esm/plugin/drop-in/index.js +3 -3
  22. package/esm/request/index.d.ts +2 -2
  23. package/esm/request/index.js +7 -8
  24. package/esm/request/utils.d.ts +3 -3
  25. package/esm/request/utils.js +4 -4
  26. package/esm/service/index.d.ts +2 -2
  27. package/esm/types/index.d.ts +37 -96
  28. package/esm/types/index.js +52 -92
  29. package/esm/util/createIframeNode.d.ts +3 -3
  30. package/esm/util/createIframeNode.js +8 -8
  31. package/esm/util/index.d.ts +4 -6
  32. package/esm/util/index.js +5 -22
  33. package/esm/util/mock.js +2 -1
  34. package/package.json +1 -1
  35. package/esm/config/request.d.ts +0 -21
  36. package/esm/config/request.js +0 -67
  37. package/esm/image/skeleton.svg +0 -18
  38. package/esm/plugin/component/component.inline.style.js +0 -38
  39. package/esm/plugin/component/component.popup.style.d.ts +0 -12
  40. package/esm/plugin/component/component.popup.style.js +0 -163
@@ -1,2 +1,16 @@
1
- export declare const marmptMap: Record<string, string>;
1
+ export declare const requestHost: {
2
+ [key: string]: string;
3
+ };
4
+ export declare const clientId = "5J5Y8X4E2Y25GR00690";
5
+ export declare const tntInstId = "ALIPW3SG";
6
+ export declare const appId = "ANTOM_PAYMENT_WEB";
7
+ export declare const sofaId: any;
8
+ export declare const closeImg = "https://file.page.alipay.net/resource/2023/3/21/3235f64c-84a6-4e33-9567-4cedf0960229.svg";
9
+ export declare const hostSignMap: (hostSign: string | undefined, env: string) => string;
10
+ export declare const lightSandboxMap: (operationType: string | undefined, env: string) => {
11
+ appId: string;
12
+ sofaId: any;
13
+ baseURL: string;
14
+ 'Operation-Type': string;
15
+ };
2
16
  export declare const sdkVersion: string;
@@ -5,13 +5,66 @@
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 json from "../../package.json";
9
- export var marmptMap = {
10
- dev: 'http://page.alipay.net/page/antom-web-checkout/src/component-app',
11
- sit: 'http://page.test.alipay.net/page/antom-web-checkout/src/component-app',
12
- pre: 'https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app',
13
- sandbox: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app',
14
- light_sandbox: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app',
15
- prod: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app'
8
+ import packageJSON from "../../package.json";
9
+ import { queryParse } from "../util";
10
+ var _queryParse = queryParse(),
11
+ _light_sandbox = _queryParse._light_sandbox,
12
+ groupId = _queryParse.groupId,
13
+ host = _queryParse.requestHost;
14
+ export var requestHost = {
15
+ local: 'http://imgs-1164.gz00b.dev.alipay.net/mgw.htm',
16
+ dev: host || 'http://imgs-1164.gz00b.dev.alipay.net/mgw.htm',
17
+ sit: host || 'http://imgs-9.sggz00a.test.alipay.net/mgw.htm',
18
+ pre: 'https://imgs-sea-pre.alipay.com/mgw.htm',
19
+ prod: 'https://imgs-sea-global.alipay.com/mgw.htm',
20
+ sandbox: 'https://imgs-sea-global.alipay.com/mgw.htm'
16
21
  };
17
- export var sdkVersion = json.version;
22
+ export var clientId = '5J5Y8X4E2Y25GR00690';
23
+ export var tntInstId = 'ALIPW3SG';
24
+ export var appId = 'ANTOM_PAYMENT_WEB';
25
+ export var sofaId = groupId || 'GROUP_20230523202227'; // 2.0
26
+
27
+ export var closeImg = 'https://file.page.alipay.net/resource/2023/3/21/3235f64c-84a6-4e33-9567-4cedf0960229.svg';
28
+ export var hostSignMap = function hostSignMap(hostSign, env) {
29
+ var map = {
30
+ SG: 'https://imgs-sea-global.alipay.com/mgw.htm',
31
+ US: 'https://imgs-na-global.alipay.com/mgw.htm',
32
+ DE: 'https://imgs-de-global.alipay.com/mgw.htm'
33
+ };
34
+ var preMap = {
35
+ SG: 'https://imgs-sea-pre.alipay.com/mgw.htm',
36
+ US: 'https://imgs-pre.alipay.com/mgw.htm',
37
+ DE: 'https://imgs-de-pre.alipay.com/mgw.htm'
38
+ };
39
+ if (env === 'prod' || env === 'sandbox' || env === 'light_sandbox') {
40
+ return map[hostSign || 'SG'];
41
+ } else if (env === 'pre') {
42
+ return preMap[hostSign || 'SG'];
43
+ } else return '';
44
+ };
45
+ export var lightSandboxMap = function lightSandboxMap() {
46
+ var operationType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
47
+ var env = arguments.length > 1 ? arguments[1] : undefined;
48
+ var map = {
49
+ pre: 'https://imgs-sea-pre.alipay.com/mgw.htm',
50
+ sit: host || 'http://imgs-9.sggz00a.test.alipay.net/mgw.htm',
51
+ dev: host || 'http://imgs-13.sggz00b.stable.alipay.net/mgw.htm'
52
+ };
53
+ var typeMap = {
54
+ 'com.ipay.iexpcashier.sdkAction.query': 'com.ipay.iopensandbox.sdk.paymentSession.query'
55
+ };
56
+ var appId = 'SDK_MOCK_SANDBOX';
57
+ var sofaId = groupId || 'GROUP_20230315210531';
58
+ if (typeMap[operationType] && env === 'light_sandbox' || _light_sandbox === 'true') return {
59
+ appId: appId,
60
+ sofaId: sofaId,
61
+ baseURL: map[env],
62
+ 'Operation-Type': typeMap[operationType]
63
+ };else return {
64
+ appId: '',
65
+ sofaId: '',
66
+ baseURL: '',
67
+ 'Operation-Type': ''
68
+ };
69
+ };
70
+ export var sdkVersion = packageJSON.version;
@@ -4,83 +4,74 @@
4
4
  * 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
5
5
  * 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.
6
6
  */
7
- import { eventCodeEnum } from "../types";
8
7
  export declare const ERRORMESSAGE: {
9
8
  DOMAIN_NOT_IN_WHITE_LIST: {
10
- code: eventCodeEnum;
11
- message: string;
9
+ errorCode: string;
10
+ errorMessage: string;
12
11
  };
13
12
  NOT_JSON_FORMAT: {
14
- code: eventCodeEnum;
15
- message: string;
13
+ errorCode: string;
14
+ errorMessage: string;
16
15
  };
17
16
  SDK_COMPATIBILITY_ISSUES: {
18
- code: eventCodeEnum;
17
+ errorCode: string;
19
18
  BROWSER_NOT_SUPPORT_POSTMESSAGE: {
20
- code: eventCodeEnum;
21
- message: string;
19
+ errorCode: string;
20
+ errorMessage: string;
22
21
  };
23
22
  FAILED_TO_CREATE_IFRAME: {
24
- code: eventCodeEnum;
25
- message: string;
23
+ errorCode: string;
24
+ errorMessage: string;
26
25
  };
27
26
  };
28
27
  INIT_PARAMETER_ERROR: {
29
- code: eventCodeEnum;
28
+ errorCode: string;
30
29
  UI_MODE_NOT_SUPPORTED: {
31
- code: eventCodeEnum;
32
- message: string;
30
+ errorCode: string;
31
+ errorMessage: string;
33
32
  };
34
33
  ENVIRONMENT_ERROR: {
35
- code: eventCodeEnum;
36
- message: string;
34
+ errorCode: string;
35
+ errorMessage: string;
37
36
  };
38
37
  MODE_ERROR: {
39
- code: eventCodeEnum;
40
- message: string;
38
+ errorCode: string;
39
+ errorMessage: string;
41
40
  };
42
41
  LOCALE_ERROR: {
43
- code: eventCodeEnum;
44
- message: string;
42
+ errorCode: string;
43
+ errorMessage: string;
45
44
  };
46
45
  NET_MODE_NOT_SUPPORT: {
47
- code: eventCodeEnum;
48
- message: string;
46
+ errorCode: string;
47
+ errorMessage: string;
49
48
  };
50
49
  EVENT_ERROR: {
51
- code: eventCodeEnum;
52
- message: string;
50
+ errorCode: string;
51
+ errorMessage: string;
53
52
  };
54
53
  };
55
54
  CREATEPAYMENT_PARAMETER_ERROR: {
56
- code: eventCodeEnum;
55
+ errorCode: string;
57
56
  };
58
57
  CONFIRMPAYMENT_PARAMETER_ERROR: {
59
- code: string;
58
+ errorCode: string;
60
59
  };
61
60
  CREATECOMPONENT_ERROR: {
62
- code: eventCodeEnum;
63
- message: string;
61
+ errorCode: string;
62
+ errorMessage: string;
64
63
  SINGLETON_COMPONENT_ERROR: {
65
- code: eventCodeEnum;
66
- message: string;
67
- };
68
- LOAD_APP_TIMEOUT: {
69
- code: eventCodeEnum;
70
- message: string;
64
+ errorCode: string;
65
+ errorMessage: string;
71
66
  };
72
67
  };
73
68
  SDK_CALL_URL_ERROR: {
74
- code: eventCodeEnum;
69
+ errorCode: string;
75
70
  REDIRECT_ERROR: {
76
- code: eventCodeEnum;
77
- message: string;
71
+ errorCode: string;
72
+ errorMessage: string;
78
73
  };
79
74
  };
80
- SDK_SUBMIT_ERROR: {
81
- code: eventCodeEnum;
82
- message: string;
83
- };
84
75
  };
85
76
  export declare const BASEPLUGINID = "CHECKOUT";
86
77
  export declare const COMPONENTPLUGINID = "COMPONENT";
@@ -111,7 +102,7 @@ export declare const EVENT: {
111
102
  redirect: {
112
103
  name: string;
113
104
  };
114
- close: {
105
+ onClose: {
115
106
  name: string;
116
107
  uniqueKey: string;
117
108
  };
@@ -141,17 +132,4 @@ export declare const EVENT: {
141
132
  name: string;
142
133
  };
143
134
  };
144
- export declare const COMPONENT_CONTAINER_ID = "ams-component-container";
145
- export declare const COMPONENT_SECTION_ID = "ams-component-section";
146
- export declare const COMPONENT_IFRAME_TAG_ID = "ams-checkout-component";
147
- export declare const COMPONENT_CLOSE_BLOCK_ID = "asm-component-close-block";
148
- export declare const COMPONENT_RETENTION_ID = "ams-component-retention";
149
- export declare const MOCKUP_ID = "ams-component-mockup";
150
- export declare const LOADING_ID = "ams-component-loading";
151
- export declare const LISTENER_PREFIX = "_ams_sdk_component_listener";
152
- export declare const INLINE_BASE_STYLE_ID = "ams-inline-component-style";
153
- export declare const INLINE_IMG_CLASSNAME = "inline-loading";
154
- export declare const LOADTIME_LIMIT = 15000;
155
- export declare const ANIMATION_TIME = 300;
156
- export declare const closeImg = "https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg";
157
135
  export declare const LOADINGIMG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAACEBAMAAACjap6UAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAITgAACE4AUWWMWAAAAAqUExURUdwTKe3zKGxyK27z7K/05ytxLbD1bvH2Jaowb/K28DL3JCjvYueucDL2xLcxpgAAAAOdFJOUwCKoHRft0w5zCgY4fYKKSYvdQAABvtJREFUaN6lmt+LG1UUx6fddbcZHOgkpWutBTPbVBEfNp1xS6uF2oQURUGnBBbqw7YdsooV2ipZ06c+uBBZCistDRMUqgV1gnnwJ4HMg2jBh+Qh1bW1A/lfPOfcO9lkNz/m3j3dh2XT+eznfM+dmTvTKsroUovpeGotbyetlXuKTH17vFxeKq9R5fOJG8KAR6+Uy2vlJag8ALDmxSDa2TLWEhos5UPKnEA7sy8yALNYyod1/mpUwiYpQB9MYy1sJZWybwgRgLGGDLRAhg1ftn0qIqHBkijzefBO7HwKRN6cTJguNxoho38gjGHb7y5PTHJpvdyLgsaap3UBSdjISKWMCZlqzzTBosGj4CMJC+LEmh8/20+b62jRM+EGjIAQsLDnxhH+IQduUS7P50p1RQk85zgRwCIPhJTx9pjz6gIev84k1o59tfVJ7HIKw0iRRio5upX3GaGBjPMbg5/FjnOAYRvGC6MIU83mOkGAcHLnx7cxC8O2ETNqsofhcIgT2xja7WOmYRsp4+hwwt9NKErz1xG/ZJYRsE4PXRIX0GAdwxi5AGfjNrYCiGRnyMf/kgRgGmNm9ihl8DoyVAKOxzxfGrdy7vOZGPM7NfaiBDI+G38KXDK4yMKOj16lNiDKCVc3Nc47OTpkTRCjeWTi9SRMY3voHzZZ/TL5inKJAPHtS1TlhMZyhIszk4hvm+t/HPF5lEvjNyRhxAd7PuwziY0oCJV3cqz/hzPNph9ZQlG+hi6SRjze/wu/9/3oEnywycEVerhFFr9FvVldT5LFgb4Lvw8EEFmIipihiSSNLet9PjKaP0a/656Nx0FD37+1uFvNVstv3oqOeGgks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Gx2xzMMt3DdSQN1eBvndsbMCJ47oZW7WSdHiCGvXTBMtHDHtvI4yy1yQ4IHDbfquuMZMcfJMYmPhn3sIQE13JGTVaEJsHCGS6CGy6o0ykN1CrkcWjjDJVDDIwm34g69McUKSIDjnSHj4PNiEpWKWyoNWelewXEoCuhj5EPpEzeEVFa3L3X1bgHaKOQcjOOD0YFXqYtSCRkDEPW7ApbjMJExZ5LasyCIW8M9mBZ4FQLkHB7G2MfzJ3Q8eKyGtVIsFlcKvBwayfh/ldW8Ck4Va7USEorFAkEoi1zu3KQrEu+Ca6wwi54GpFmYeC6ruLRAgffCLVgv2EchwkuGgGVZWe15bElAL5FeUwSUBR1f5AQUESCQR2mVh1FkjfAkohJgLj1GEVtZIRFACP0fCm/AgmdREnzYqIRhFHkvq+J77MBFQpEPpCQOYPcntwIWeK6Mu0P9D9pzJq4u5hj+AAAAAElFTkSuQmCC";
@@ -4,82 +4,73 @@
4
4
  * 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
5
5
  * 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.
6
6
  */
7
- import { eventCodeEnum } from "../types";
8
7
  export var ERRORMESSAGE = {
9
8
  DOMAIN_NOT_IN_WHITE_LIST: {
10
- code: eventCodeEnum.SDK_INTERNAL_ERROR,
11
- message: 'Origin of the message is not in the white list'
9
+ errorCode: 'SDK_INTERNAL_ERROR',
10
+ errorMessage: 'Origin of the message is not in the white list'
12
11
  },
13
12
  NOT_JSON_FORMAT: {
14
- code: eventCodeEnum.SDK_INTERNAL_ERROR,
15
- message: 'The message string should conform to the json format'
13
+ errorCode: 'SDK_INTERNAL_ERROR',
14
+ errorMessage: 'The message string should conform to the json format'
16
15
  },
17
16
  SDK_COMPATIBILITY_ISSUES: {
18
- code: eventCodeEnum.SDK_INTERNAL_ERROR,
17
+ errorCode: 'SDK_INTERNAL_ERROR',
19
18
  BROWSER_NOT_SUPPORT_POSTMESSAGE: {
20
- code: eventCodeEnum.SDK_INTERNAL_ERROR,
21
- message: 'The browser does not support the postmessage communication mode'
19
+ errorCode: 'SDK_INTERNAL_ERROR',
20
+ errorMessage: 'The browser does not support the postmessage communication mode'
22
21
  },
23
22
  FAILED_TO_CREATE_IFRAME: {
24
- code: eventCodeEnum.SDK_INTERNAL_ERROR,
25
- message: 'Failed to create iframe'
23
+ errorCode: 'SDK_INTERNAL_ERROR',
24
+ errorMessage: 'Failed to create iframe'
26
25
  }
27
26
  },
28
27
  INIT_PARAMETER_ERROR: {
29
- code: eventCodeEnum.SDK_INIT_PARAMETER_ERROR,
28
+ errorCode: 'SDK_INIT_PARAMETER_ERROR',
30
29
  UI_MODE_NOT_SUPPORTED: {
31
- code: eventCodeEnum.SDK_INIT_PARAMETER_ERROR,
32
- message: 'This UI mode is not supported'
30
+ errorCode: 'SDK_INIT_PARAMETER_ERROR',
31
+ errorMessage: 'This UI mode is not supported'
33
32
  },
34
33
  ENVIRONMENT_ERROR: {
35
- code: eventCodeEnum.SDK_INIT_PARAMETER_ERROR,
36
- message: 'The current input environment does not support or is not in the standard enumeration'
34
+ errorCode: 'SDK_INIT_PARAMETER_ERROR',
35
+ errorMessage: 'The current input environment does not support or is not in the standard enumeration'
37
36
  },
38
37
  MODE_ERROR: {
39
- code: eventCodeEnum.SDK_INIT_PARAMETER_ERROR,
40
- message: 'mode value not in enum'
38
+ errorCode: 'SDK_INIT_PARAMETER_ERROR',
39
+ errorMessage: 'mode value not in enum'
41
40
  },
42
41
  LOCALE_ERROR: {
43
- code: eventCodeEnum.SDK_INIT_PARAMETER_ERROR,
44
- message: 'The current input language does not support or is not in the standard enumeration'
42
+ errorCode: 'SDK_INIT_PARAMETER_ERROR',
43
+ errorMessage: 'The current input language does not support or is not in the standard enumeration'
45
44
  },
46
45
  NET_MODE_NOT_SUPPORT: {
47
- code: eventCodeEnum.SDK_INIT_PARAMETER_ERROR,
48
- message: 'The network mode is not supported'
46
+ errorCode: 'SDK_INIT_PARAMETER_ERROR',
47
+ errorMessage: 'The network mode is not supported'
49
48
  },
50
49
  EVENT_ERROR: {
51
- code: eventCodeEnum.SDK_INIT_PARAMETER_ERROR,
52
- message: 'Parameter type should be function'
50
+ errorCode: 'SDK_INIT_PARAMETER_ERROR',
51
+ errorMessage: 'Parameter type should be function'
53
52
  }
54
53
  },
55
54
  CREATEPAYMENT_PARAMETER_ERROR: {
56
- code: eventCodeEnum.SDK_CREATEPAYMENT_PARAMETER_ERROR
55
+ errorCode: 'SDK_CREATEPAYMENT_PARAMETER_ERROR'
57
56
  },
58
57
  CONFIRMPAYMENT_PARAMETER_ERROR: {
59
- code: 'SDK_CONFIRMPAYMENT_PARAMETER_ERROR'
58
+ errorCode: 'SDK_CONFIRMPAYMENT_PARAMETER_ERROR'
60
59
  },
61
60
  CREATECOMPONENT_ERROR: {
62
- code: eventCodeEnum.SDK_CREATECOMPONENT_ERROR,
63
- message: 'Failed to create component',
61
+ errorCode: 'SDK_CREATECOMPONENT_ERROR',
62
+ errorMessage: 'Failed to create component',
64
63
  SINGLETON_COMPONENT_ERROR: {
65
- code: eventCodeEnum.SDK_CREATECOMPONENT_ERROR,
66
- message: 'Only one component can be rendered simultaneously'
67
- },
68
- LOAD_APP_TIMEOUT: {
69
- code: eventCodeEnum.SDK_CREATECOMPONENT_ERROR,
70
- message: 'Load resource timeout'
64
+ errorCode: 'SDK_CREATECOMPONENT_ERROR',
65
+ errorMessage: 'Only one component can be rendered simultaneously'
71
66
  }
72
67
  },
73
68
  SDK_CALL_URL_ERROR: {
74
- code: eventCodeEnum.SDK_CALL_URL_ERROR,
69
+ errorCode: 'SDK_CALL_URL_ERROR',
75
70
  REDIRECT_ERROR: {
76
- code: eventCodeEnum.SDK_CALL_URL_ERROR,
77
- message: 'Redirect data exception'
71
+ errorCode: 'SDK_CALL_URL_ERROR',
72
+ errorMessage: 'Redirect data exception'
78
73
  }
79
- },
80
- SDK_SUBMIT_ERROR: {
81
- code: eventCodeEnum.SDK_CALL_URL_ERROR,
82
- message: 'Component not created or current browser compatibility issue, not supported'
83
74
  }
84
75
  };
85
76
  export var BASEPLUGINID = 'CHECKOUT';
@@ -111,7 +102,7 @@ export var EVENT = {
111
102
  redirect: {
112
103
  name: 'onRedirect'
113
104
  },
114
- close: {
105
+ onClose: {
115
106
  name: 'onClose',
116
107
  uniqueKey: 'userOnClose'
117
108
  },
@@ -141,17 +132,4 @@ export var EVENT = {
141
132
  name: 'dismissLoading'
142
133
  }
143
134
  };
144
- export var COMPONENT_CONTAINER_ID = 'ams-component-container';
145
- export var COMPONENT_SECTION_ID = 'ams-component-section';
146
- export var COMPONENT_IFRAME_TAG_ID = 'ams-checkout-component';
147
- export var COMPONENT_CLOSE_BLOCK_ID = 'asm-component-close-block';
148
- export var COMPONENT_RETENTION_ID = 'ams-component-retention';
149
- export var MOCKUP_ID = 'ams-component-mockup';
150
- export var LOADING_ID = 'ams-component-loading';
151
- export var LISTENER_PREFIX = '_ams_sdk_component_listener';
152
- export var INLINE_BASE_STYLE_ID = 'ams-inline-component-style';
153
- export var INLINE_IMG_CLASSNAME = 'inline-loading';
154
- export var LOADTIME_LIMIT = 15000;
155
- export var ANIMATION_TIME = 300;
156
- export var closeImg = 'https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg';
157
135
  export var LOADINGIMG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAACEBAMAAACjap6UA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MZMcfJMYmPhn3sIQE13JGTVaEJsHCGS6CGy6o0ykN1CrkcWjjDJVDDIwm34g69McUKSIDjnSHj4PNiEpWKWyoNWelewXEoCuhj5EPpEzeEVFa3L3X1bgHaKOQcjOOD0YFXqYtSCRkDEPW7ApbjMJExZ5LasyCIW8M9mBZ4FQLkHB7G2MfzJ3Q8eKyGtVIsFlcKvBwayfh/ldW8Ck4Va7USEorFAkEoi1zu3KQrEu+Ca6wwi54GpFmYeC6ruLRAgffCLVgv2EchwkuGgGVZWe15bElAL5FeUwSUBR1f5AQUESCQR2mVh1FkjfAkohJgLj1GEVtZIRFACP0fCm/AgmdREnzYqIRhFHkvq+J77MBFQpEPpCQOYPcntwIWeK6Mu0P9D9pzJq4u5hj+AAAAAElFTkSuQmCC';
@@ -5,27 +5,13 @@
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 ComponentApp from '../../plugin/component';
9
- import { IcreateComponent, IoptionsParams, Iselector } from '../../types';
10
- import CoreInstance from '../instance/index';
11
- export declare class AMSComponent extends CoreInstance {
12
- _componentApp: ComponentApp;
13
- constructor(options: IoptionsParams);
14
- private parameterInitAndCheck;
15
- private pluginAppendIframe;
16
- /**
17
- * @description Create component application
18
- * @param params - The data source created by the component, necessary paymentSessionData, optional appearance configuration, and refer to the documentation for other parameters and detailed information.
19
- */
20
- createComponent(params: IcreateComponent): Promise<void>;
21
- /**
22
- * @description Create and render components in the specified element area
23
- * @param params - The data source created by the component, necessary paymentSessionData, necessary element selector IDs, optional appearance configurations, and refer to the documentation for other parameters and detailed information.
24
- */
25
- mountComponent(params: IcreateComponent, selector: Iselector): Promise<void>;
26
- /**
27
- * @description Execute payment submission process
28
- * @description - When using your own payment button, you can execute the submit payment process by actively calling this function.
29
- */
30
- submit(): void;
8
+ import { componentNameEnum, IcreateComponent, optionsParams } from '../../types';
9
+ export declare const mixinComponentConstructor: (options: optionsParams, context: any) => void;
10
+ /**
11
+ * @description Create component application
12
+ * @description component
13
+ */
14
+ export declare const createComponent: (componentNameOrParams: string | componentNameEnum | IcreateComponent, params?: IcreateComponent) => Promise<void>;
15
+ export interface IcreateComponentFunc {
16
+ (componentName: string | componentNameEnum, params: IcreateComponent): Promise<any>;
31
17
  }