@alipay/ams-checkout 1.25.1 → 1.26.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.
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/component/channel.js +1 -1
- package/esm/component/component.popup.style.d.ts +2 -0
- package/esm/component/component.popup.style.js +15 -2
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +4 -0
- package/esm/constant/index.js +4 -0
- package/esm/core/bus/index.d.ts +3 -3
- package/esm/core/bus/index.js +14 -14
- package/esm/core/component/appPreloadProcessing.js +2 -2
- package/esm/core/component/ckp/index.js +6 -3
- package/esm/core/component/element/index.js +5 -4
- package/esm/core/component/element/type.d.ts +3 -2
- package/esm/core/component/element/type.js +1 -0
- package/esm/core/component/index.js +6 -10
- package/esm/core/instance/index.js +3 -3
- package/esm/foundation/core/index.d.ts +1 -0
- package/esm/foundation/core/index.js +25 -12
- package/esm/foundation/product-processor/easysafepay/index.js +17 -16
- package/esm/foundation/service/api-bus/busManager.d.ts +3 -3
- package/esm/foundation/service/api-bus/busManager.js +14 -14
- package/esm/foundation/service/container/index.d.ts +2 -0
- package/esm/foundation/service/container/index.js +31 -1
- package/esm/foundation/service/event-center.d.ts +3 -2
- package/esm/foundation/service/event-center.js +29 -9
- package/esm/foundation/service/log/index.d.ts +2 -2
- package/esm/foundation/service/log/index.js +23 -8
- package/esm/foundation/service/log/keys.d.ts +13 -0
- package/esm/foundation/service/log/keys.js +103 -0
- package/esm/foundation/service/log/processor.d.ts +9 -0
- package/esm/foundation/service/log/processor.js +148 -0
- package/esm/foundation/service/log/types.d.ts +1 -1
- package/esm/foundation/service/requester/requester.js +3 -0
- package/esm/foundation/service/security/index.js +6 -8
- package/esm/foundation/utils/redirect_utils.js +1 -2
- package/esm/index.js +1 -1
- package/esm/plugin/applepay/component.js +10 -8
- package/esm/plugin/applepay/index.js +10 -6
- package/esm/plugin/applepay/service.js +24 -16
- package/esm/plugin/component/cashierApp.js +3 -3
- package/esm/plugin/component/channel.js +1 -1
- package/esm/plugin/component/component.popup.style.d.ts +8 -0
- package/esm/plugin/component/component.popup.style.js +22 -2
- package/esm/plugin/component/index.d.ts +2 -0
- package/esm/plugin/component/index.js +66 -27
- package/esm/plugin/paypal/index.js +1 -1
- package/esm/service/index.js +4 -2
- package/esm/util/getBackScheme.js +1 -2
- package/esm/util/index.js +4 -8
- package/esm/util/logger.d.ts +3 -3
- package/esm/util/logger.js +49 -13
- package/esm/util/spm-map.d.ts +172 -0
- package/esm/util/spm-map.js +172 -0
- package/package.json +1 -1
package/esm/component/channel.js
CHANGED
@@ -49,7 +49,7 @@ export function getChannelBehavior(paymentSessionMetaData) {
|
|
49
49
|
|
50
50
|
// TOSS
|
51
51
|
if (['BANKTRANSFER_QUICKPAY'].includes(paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa9 = paymentSessionMetaData.paymentMethodInfoView) === null || _paymentSessionMetaDa9 === void 0 ? void 0 : _paymentSessionMetaDa9.paymentMethodType)) {
|
52
|
-
allowClickOutsideClose =
|
52
|
+
allowClickOutsideClose = false;
|
53
53
|
buildSubmitPayExtParams = function buildSubmitPayExtParams(params) {
|
54
54
|
var callBackUrl = getDoubleFaUrl(params);
|
55
55
|
return {
|
@@ -2,6 +2,7 @@ import { PlatformEnum } from '../types';
|
|
2
2
|
export declare const componentAddCSS: () => void;
|
3
3
|
export declare const createBaseElement: (platform: PlatformEnum, closeBtnFunc: () => void) => HTMLDivElement;
|
4
4
|
export declare const createCloseBtn: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
|
5
|
+
export declare const createMaskCloseButton: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
|
5
6
|
/**
|
6
7
|
* 弹出离开挽留弹窗
|
7
8
|
* @param platform
|
@@ -15,6 +16,7 @@ export declare const removeRetentionPopup: () => void;
|
|
15
16
|
export declare const createMockup: (options: {
|
16
17
|
platform: PlatformEnum;
|
17
18
|
onClickOutside: () => void;
|
19
|
+
closeBtnFunc: () => void;
|
18
20
|
}) => void;
|
19
21
|
export declare const hideMockup: () => void;
|
20
22
|
export declare const cleanMockup: () => void;
|
@@ -5,10 +5,10 @@
|
|
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 { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../constant";
|
8
|
+
import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../constant";
|
9
9
|
import { PlatformEnum } from "../types";
|
10
10
|
import { addSetFontSizeEvent, amsSetSize, getDesignFontSize } from "../util";
|
11
|
-
var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
|
11
|
+
var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
|
12
12
|
export var componentAddCSS = function componentAddCSS() {
|
13
13
|
var style = document.createElement('style');
|
14
14
|
style.type = 'text/css';
|
@@ -47,6 +47,18 @@ export var createCloseBtn = function createCloseBtn(platform, closeBtnFunc) {
|
|
47
47
|
});
|
48
48
|
if (container) container.appendChild(closeBlock);
|
49
49
|
};
|
50
|
+
export var createMaskCloseButton = function createMaskCloseButton(platform, closeBtnFunc) {
|
51
|
+
var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
|
52
|
+
var closeBtnHTML = "<div class='".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-btn'>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z\" fill=\"#EEEEEE\"/>\n</svg>\n </div>");
|
53
|
+
var closeBlock = document.createElement('div');
|
54
|
+
closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-").concat(platform), "".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
|
55
|
+
closeBlock.id = COMPONENT_CLOSE_MASK_BLOCK_ID;
|
56
|
+
closeBlock.innerHTML = closeBtnHTML;
|
57
|
+
closeBlock.addEventListener(clickEventName, function () {
|
58
|
+
closeBtnFunc();
|
59
|
+
});
|
60
|
+
document.body.appendChild(closeBlock);
|
61
|
+
};
|
50
62
|
|
51
63
|
/**
|
52
64
|
* 弹出离开挽留弹窗
|
@@ -116,6 +128,7 @@ export var createMockup = function createMockup(options) {
|
|
116
128
|
options === null || options === void 0 || (_options$onClickOutsi = options.onClickOutside) === null || _options$onClickOutsi === void 0 || _options$onClickOutsi.call(options);
|
117
129
|
});
|
118
130
|
body.appendChild(mockup);
|
131
|
+
createMaskCloseButton(options === null || options === void 0 ? void 0 : options.platform, options === null || options === void 0 ? void 0 : options.closeBtnFunc);
|
119
132
|
};
|
120
133
|
export var hideMockup = function hideMockup() {
|
121
134
|
var mockup = document.getElementById(MOCKUP_ID);
|
package/esm/config/index.d.ts
CHANGED
@@ -5,10 +5,10 @@ export declare const sdkVersion: string;
|
|
5
5
|
/**
|
6
6
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
7
7
|
*/
|
8
|
-
export declare const AMSCheckoutAppVersion = "1.
|
9
|
-
export declare const AMSAutoDebitAppVersion = "1.
|
10
|
-
export declare const AMSEasyPayAppVersion = "1.
|
11
|
-
export declare const AMSCashierPaymentAppVersion = "1.
|
12
|
-
export declare const AMSVaultingAppVersion = "1.
|
13
|
-
export declare const AMSPaymentElementAppVersion = "1.
|
14
|
-
export declare const ADDRESSElementAppVersion = "1.
|
8
|
+
export declare const AMSCheckoutAppVersion = "1.26.0";
|
9
|
+
export declare const AMSAutoDebitAppVersion = "1.26.0";
|
10
|
+
export declare const AMSEasyPayAppVersion = "1.26.0";
|
11
|
+
export declare const AMSCashierPaymentAppVersion = "1.26.0";
|
12
|
+
export declare const AMSVaultingAppVersion = "1.26.0";
|
13
|
+
export declare const AMSPaymentElementAppVersion = "1.26.0";
|
14
|
+
export declare const ADDRESSElementAppVersion = "1.26.0";
|
package/esm/config/index.js
CHANGED
@@ -35,10 +35,10 @@ export var sdkVersion = json.version;
|
|
35
35
|
/**
|
36
36
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
37
37
|
*/
|
38
|
-
export var AMSCheckoutAppVersion = '1.
|
39
|
-
export var AMSAutoDebitAppVersion = '1.
|
40
|
-
export var AMSEasyPayAppVersion = '1.
|
41
|
-
export var AMSCashierPaymentAppVersion = '1.
|
42
|
-
export var AMSVaultingAppVersion = '1.
|
43
|
-
export var AMSPaymentElementAppVersion = '1.
|
44
|
-
export var ADDRESSElementAppVersion = '1.
|
38
|
+
export var AMSCheckoutAppVersion = '1.26.0'; // 兜底版本号
|
39
|
+
export var AMSAutoDebitAppVersion = '1.26.0'; // 代扣
|
40
|
+
export var AMSEasyPayAppVersion = '1.26.0'; // easypay
|
41
|
+
export var AMSCashierPaymentAppVersion = '1.26.0'; // 收银台(卡、apm)
|
42
|
+
export var AMSVaultingAppVersion = '1.26.0'; // 绑卡
|
43
|
+
export var AMSPaymentElementAppVersion = '1.26.0'; // payment element
|
44
|
+
export var ADDRESSElementAppVersion = '1.26.0'; // address element
|
package/esm/constant/index.d.ts
CHANGED
@@ -129,6 +129,9 @@ export declare const EVENT: {
|
|
129
129
|
showCloseButton: {
|
130
130
|
name: string;
|
131
131
|
};
|
132
|
+
setMaskCloseButton: {
|
133
|
+
name: string;
|
134
|
+
};
|
132
135
|
setAllowRetention: {
|
133
136
|
name: string;
|
134
137
|
};
|
@@ -200,6 +203,7 @@ export declare const COMPONENT_CONTAINER_ID = "ams-component-container";
|
|
200
203
|
export declare const COMPONENT_SECTION_ID = "ams-component-section";
|
201
204
|
export declare const COMPONENT_IFRAME_TAG_ID = "ams-checkout-component";
|
202
205
|
export declare const COMPONENT_CLOSE_BLOCK_ID = "asm-component-close-block";
|
206
|
+
export declare const COMPONENT_CLOSE_MASK_BLOCK_ID = "ams-component-mask-close-block";
|
203
207
|
export declare const COMPONENT_RETENTION_ID = "ams-component-retention";
|
204
208
|
export declare const MOCKUP_ID = "ams-component-mockup";
|
205
209
|
export declare const LOADING_ID = "ams-component-loading";
|
package/esm/constant/index.js
CHANGED
@@ -130,6 +130,9 @@ export var EVENT = {
|
|
130
130
|
showCloseButton: {
|
131
131
|
name: 'showCloseButton'
|
132
132
|
},
|
133
|
+
setMaskCloseButton: {
|
134
|
+
name: 'setMaskCloseButton'
|
135
|
+
},
|
133
136
|
setAllowRetention: {
|
134
137
|
name: 'setAllowRetention'
|
135
138
|
},
|
@@ -203,6 +206,7 @@ export var COMPONENT_CONTAINER_ID = 'ams-component-container';
|
|
203
206
|
export var COMPONENT_SECTION_ID = 'ams-component-section';
|
204
207
|
export var COMPONENT_IFRAME_TAG_ID = 'ams-checkout-component';
|
205
208
|
export var COMPONENT_CLOSE_BLOCK_ID = 'asm-component-close-block';
|
209
|
+
export var COMPONENT_CLOSE_MASK_BLOCK_ID = 'ams-component-mask-close-block';
|
206
210
|
export var COMPONENT_RETENTION_ID = 'ams-component-retention';
|
207
211
|
export var MOCKUP_ID = 'ams-component-mockup';
|
208
212
|
export var LOADING_ID = 'ams-component-loading';
|
package/esm/core/bus/index.d.ts
CHANGED
@@ -16,17 +16,17 @@ export declare enum BusLogEventEnum {
|
|
16
16
|
/**
|
17
17
|
* 查询是否订阅
|
18
18
|
* action:string
|
19
|
-
* sub: bool
|
19
|
+
* sub (processResult): bool
|
20
20
|
*/
|
21
21
|
sdk_event_busIsSubscribe = "sdk_event_busIsSubscribe",
|
22
22
|
/**
|
23
23
|
* 订阅协议
|
24
|
-
* actions: string[] , 用逗号拼接
|
24
|
+
* actions (actionNames): string[] , 用逗号拼接
|
25
25
|
*/
|
26
26
|
sdk_event_busSubscribe = "sdk_event_busSubscribe",
|
27
27
|
/**
|
28
28
|
* 退订协议
|
29
|
-
* actions: string[] , 用逗号拼接
|
29
|
+
* actions (actionNames): string[] , 用逗号拼接
|
30
30
|
*/
|
31
31
|
sdk_event_busUnsubscribe = "sdk_event_busUnsubscribe",
|
32
32
|
/**
|
package/esm/core/bus/index.js
CHANGED
@@ -140,7 +140,7 @@ export var BusManager = /*#__PURE__*/function () {
|
|
140
140
|
this.logger.logInfo({
|
141
141
|
title: title
|
142
142
|
}, _objectSpread({
|
143
|
-
|
143
|
+
eventSource: 'sdk'
|
144
144
|
}, optionalParams)).send();
|
145
145
|
}
|
146
146
|
}
|
@@ -154,7 +154,7 @@ export var BusManager = /*#__PURE__*/function () {
|
|
154
154
|
this.logger.logError({
|
155
155
|
title: title
|
156
156
|
}, _objectSpread({
|
157
|
-
|
157
|
+
eventSource: 'sdk'
|
158
158
|
}, optionalParams)).send();
|
159
159
|
}
|
160
160
|
}
|
@@ -187,7 +187,7 @@ export var BusManager = /*#__PURE__*/function () {
|
|
187
187
|
setTimeout(function () {
|
188
188
|
if (failed) {
|
189
189
|
BusManager.traceError(BusLogEventEnum.sdk_error_busPublishNoResult, {
|
190
|
-
|
190
|
+
actionName: message.getAction()
|
191
191
|
});
|
192
192
|
if ((config === null || config === void 0 ? void 0 : config.fallback) !== null) {
|
193
193
|
resolve(message.result(config === null || config === void 0 ? void 0 : config.fallback));
|
@@ -203,7 +203,7 @@ export var BusManager = /*#__PURE__*/function () {
|
|
203
203
|
value: function publish(message, callback) {
|
204
204
|
var _callBack = function _callBack(result) {
|
205
205
|
BusManager.traceLog(BusLogEventEnum.sdk_event_busPublishCallback, {
|
206
|
-
|
206
|
+
actionName: message.getAction()
|
207
207
|
});
|
208
208
|
if (callback) {
|
209
209
|
callback(result);
|
@@ -213,7 +213,7 @@ export var BusManager = /*#__PURE__*/function () {
|
|
213
213
|
var actionName = message.getAction();
|
214
214
|
var subscribers = BusManager.subscribersMap.get(actionName);
|
215
215
|
BusManager.traceLog(BusLogEventEnum.sdk_event_busPublishMessage, {
|
216
|
-
|
216
|
+
actionName: message.getAction()
|
217
217
|
});
|
218
218
|
if (subscribers) {
|
219
219
|
var _iterator = _createForOfIteratorHelper(subscribers),
|
@@ -225,8 +225,8 @@ export var BusManager = /*#__PURE__*/function () {
|
|
225
225
|
subscriber.onMessage(context, message);
|
226
226
|
} catch (e) {
|
227
227
|
BusManager.traceError(BusLogEventEnum.sdk_error_busPublishError, {
|
228
|
-
|
229
|
-
|
228
|
+
actionName: message.getAction(),
|
229
|
+
errorMessage: e
|
230
230
|
});
|
231
231
|
var _iterator2 = _createForOfIteratorHelper(BusManager.interceptors),
|
232
232
|
_step2;
|
@@ -266,7 +266,7 @@ export var BusManager = /*#__PURE__*/function () {
|
|
266
266
|
BusManager.publish(message, callback); // Re-publish the message
|
267
267
|
} else {
|
268
268
|
BusManager.traceError(BusLogEventEnum.sdk_error_busPublishUnsubscribeError, {
|
269
|
-
|
269
|
+
actionName: message.getAction()
|
270
270
|
});
|
271
271
|
}
|
272
272
|
}
|
@@ -275,7 +275,7 @@ export var BusManager = /*#__PURE__*/function () {
|
|
275
275
|
key: "subscribe",
|
276
276
|
value: function subscribe(subscriber) {
|
277
277
|
BusManager.traceLog(BusLogEventEnum.sdk_event_busSubscribe, {
|
278
|
-
|
278
|
+
actionNames: subscriber === null || subscriber === void 0 ? void 0 : subscriber.actionNames()
|
279
279
|
});
|
280
280
|
var _iterator4 = _createForOfIteratorHelper(subscriber.actionNames()),
|
281
281
|
_step4;
|
@@ -300,7 +300,7 @@ export var BusManager = /*#__PURE__*/function () {
|
|
300
300
|
key: "unsubscribe",
|
301
301
|
value: function unsubscribe(subscriber) {
|
302
302
|
BusManager.traceLog(BusLogEventEnum.sdk_event_busUnsubscribe, {
|
303
|
-
|
303
|
+
actionNames: subscriber === null || subscriber === void 0 ? void 0 : subscriber.actionNames()
|
304
304
|
});
|
305
305
|
var _iterator5 = _createForOfIteratorHelper(subscriber.actionNames()),
|
306
306
|
_step5;
|
@@ -327,8 +327,8 @@ export var BusManager = /*#__PURE__*/function () {
|
|
327
327
|
var subscribers = BusManager.subscribersMap.get(actionName);
|
328
328
|
if (subscribers && subscribers.length > 0) {
|
329
329
|
BusManager.traceLog(BusLogEventEnum.sdk_event_busIsSubscribe, {
|
330
|
-
|
331
|
-
|
330
|
+
actionName: actionName,
|
331
|
+
processResult: true
|
332
332
|
});
|
333
333
|
return true;
|
334
334
|
}
|
@@ -350,8 +350,8 @@ export var BusManager = /*#__PURE__*/function () {
|
|
350
350
|
return BusManager.subscribersMap.has(actionName);
|
351
351
|
}
|
352
352
|
BusManager.traceLog(BusLogEventEnum.sdk_event_busIsSubscribe, {
|
353
|
-
|
354
|
-
|
353
|
+
actionName: actionName,
|
354
|
+
processResult: false
|
355
355
|
});
|
356
356
|
return false;
|
357
357
|
}
|
@@ -39,8 +39,8 @@ function _loadChannelPneumaticControl() {
|
|
39
39
|
logger.logInfo({
|
40
40
|
title: 'load_channel_sdk_start'
|
41
41
|
}, {
|
42
|
-
|
43
|
-
|
42
|
+
eventMessage: JSON.stringify(frontModulesToBeLoaded),
|
43
|
+
requestId: paymentRequestId
|
44
44
|
});
|
45
45
|
frontModulesToBeLoaded.forEach(function (loadItem) {
|
46
46
|
var acquirerName = loadItem.acquirerName,
|
@@ -114,14 +114,16 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
|
|
114
114
|
function mountComponent(params, selector) {
|
115
115
|
if (params.sessionData === undefined || params.sessionData === '' || typeof params.sessionData !== 'string') {
|
116
116
|
this.logger.logError({
|
117
|
-
title: '
|
117
|
+
title: 'event_important_error',
|
118
|
+
msg: 'PARAMS_ERROR_INVALID_SESSION_DATA'
|
118
119
|
});
|
119
120
|
console.error('[antom-web-sdk] <antom-checkout-page> mountComponent: sessionData is required and must be a string');
|
120
121
|
throw new Error('PARAMS_ERROR_INVALID_SESSION_DATA');
|
121
122
|
}
|
122
123
|
if (document.querySelector(this.APP_IFRAME_ID)) {
|
123
124
|
this.logger.logError({
|
124
|
-
title: '
|
125
|
+
title: 'event_important_error',
|
126
|
+
msg: 'PARAMS_ERROR_ALREADY_MOUNTED'
|
125
127
|
});
|
126
128
|
console.error('[antom-web-sdk] <antom-checkout-page> mountComponent: already mounted, please unmount first');
|
127
129
|
throw new Error('PARAMS_ERROR_ALREADY_MOUNTED');
|
@@ -140,7 +142,8 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
|
|
140
142
|
wrapper.appendChild(iframe);
|
141
143
|
} else {
|
142
144
|
this.logger.logError({
|
143
|
-
title: '
|
145
|
+
title: 'event_important_error',
|
146
|
+
msg: 'PARAMS_ERROR_INVALID_SELECTOR'
|
144
147
|
});
|
145
148
|
console.error('[antom-web-sdk] <antom-checkout-page> mountComponent: invalid selector');
|
146
149
|
this.removeListener();
|
@@ -16,16 +16,16 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
16
16
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
17
17
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
18
18
|
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); }
|
19
|
-
import { AntomSDKCore } from "../../../foundation/core";
|
20
19
|
import PackageJson from "../../../../package.json";
|
20
|
+
import { AntomSDKCore } from "../../../foundation/core";
|
21
|
+
import { EVENT as ConstantEvent } from "../../../constant";
|
21
22
|
import { ConnectErrorCode, ElementPaymentEvent, ElementPaymentMethod, EventCallbackCode, ProductSceneEnum } from "../../../types";
|
22
23
|
import { parseSessionData } from "../index";
|
23
24
|
import { ElementAddressComponent } from "./components/address";
|
24
25
|
import { ElementAuthComponent } from "./components/auth";
|
25
26
|
import { ElementPaymentComponent } from "./components/payment";
|
26
|
-
import { EVENT as ConstantEvent } from "../../../constant";
|
27
27
|
// import { oneAccount, sdkAction, submitResult } from './mock';
|
28
|
-
|
28
|
+
import { v4 as uuid } from 'uuid';
|
29
29
|
import { addressTheme, ELEMENT_ENVIRONMENT, ThemeType } from "./type";
|
30
30
|
var ElementProcessor = /*#__PURE__*/function () {
|
31
31
|
function ElementProcessor(options) {
|
@@ -515,7 +515,7 @@ export var ElementComponent = /*#__PURE__*/function () {
|
|
515
515
|
value: function createIframeSrc() {
|
516
516
|
var env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ELEMENT_ENVIRONMENT.DEV;
|
517
517
|
var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : PackageJson.version;
|
518
|
-
var baseUrl = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ELEMENT_ENVIRONMENT.DEV, 'http://dev.page.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.TEST, 'http://page.test.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.SIT, 'http://page.test.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.PRE, 'https://pre.ac.alipay.com/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.PROD, 'https://checkout.antom.com');
|
518
|
+
var baseUrl = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ELEMENT_ENVIRONMENT.DEV, 'http://dev.page.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.TEST, 'http://page.test.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.SIT, 'http://page.test.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.PRE, 'https://pre.ac.alipay.com/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.SANDBOX, 'https://checkout.antom.com'), ELEMENT_ENVIRONMENT.PROD, 'https://checkout.antom.com');
|
519
519
|
var _env = (env === null || env === void 0 ? void 0 : env.toLocaleUpperCase()) || ELEMENT_ENVIRONMENT.DEV;
|
520
520
|
var payment = "".concat(baseUrl[_env], "/elements/").concat(version, "/pages/element_payment/index.html");
|
521
521
|
try {
|
@@ -682,6 +682,7 @@ export var ElementComponent = /*#__PURE__*/function () {
|
|
682
682
|
this.mountOptions[ElementPaymentMethod.AUTH_ELEMENT] = _mountParams;
|
683
683
|
var link = renderOptions === null || renderOptions === void 0 || (_renderOptions$elemen = renderOptions.elementProps) === null || _renderOptions$elemen === void 0 ? void 0 : _renderOptions$elemen.elementLink;
|
684
684
|
var params = window.location.href.split('?')[1];
|
685
|
+
params = "instanceId=".concat(uuid(), "&") + params;
|
685
686
|
var url = link.indexOf('?') === -1 ? "".concat(link, "?").concat(params) : link;
|
686
687
|
this.authBase.mount({
|
687
688
|
selector: sdkSelector,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ConnectErrorCode, ElementPaymentMethod
|
1
|
+
import { ActionForm, ConnectErrorCode, ElementPaymentMethod } from '../../../types';
|
2
2
|
export declare enum ThemeType {
|
3
3
|
NostalgicGray = "nostalgicGray",
|
4
4
|
Default = "default",
|
@@ -20,7 +20,8 @@ export declare enum ELEMENT_ENVIRONMENT {
|
|
20
20
|
TEST = "TEST",
|
21
21
|
SIT = "SIT",
|
22
22
|
PRE = "PRE",
|
23
|
-
PROD = "PROD"
|
23
|
+
PROD = "PROD",
|
24
|
+
SANDBOX = "SANDBOX"
|
24
25
|
}
|
25
26
|
export type ELEMENT_ENVIRONMENT_TYPE = keyof typeof ELEMENT_ENVIRONMENT | (typeof ELEMENT_ENVIRONMENT)[keyof typeof ELEMENT_ENVIRONMENT];
|
26
27
|
export interface IElementOptions {
|
@@ -23,6 +23,7 @@ export var ELEMENT_ENVIRONMENT = /*#__PURE__*/function (ELEMENT_ENVIRONMENT) {
|
|
23
23
|
ELEMENT_ENVIRONMENT["SIT"] = "SIT";
|
24
24
|
ELEMENT_ENVIRONMENT["PRE"] = "PRE";
|
25
25
|
ELEMENT_ENVIRONMENT["PROD"] = "PROD";
|
26
|
+
ELEMENT_ENVIRONMENT["SANDBOX"] = "SANDBOX";
|
26
27
|
return ELEMENT_ENVIRONMENT;
|
27
28
|
}({});
|
28
29
|
// export type IMountOptions = AddressMountOptions | LinkAuthMountOptions | PaymentMountOptions;
|
@@ -219,19 +219,15 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
219
219
|
this.logger.logInfo({
|
220
220
|
title: 'preload_match'
|
221
221
|
}, {
|
222
|
-
|
223
|
-
|
224
|
-
sessionDataChannel: channelType,
|
225
|
-
sessionDataVersion: productSceneVersion
|
222
|
+
eventMessage: channelType,
|
223
|
+
productSceneVersion: productSceneVersion
|
226
224
|
});
|
227
225
|
} else {
|
228
226
|
this.logger.logInfo({
|
229
227
|
title: 'preload_no_match'
|
230
228
|
}, {
|
231
|
-
|
232
|
-
|
233
|
-
sessionDataChannel: channelType,
|
234
|
-
sessionDataVersion: productSceneVersion
|
229
|
+
eventMessage: channelType,
|
230
|
+
productSceneVersion: productSceneVersion
|
235
231
|
});
|
236
232
|
}
|
237
233
|
var previousChannel = {
|
@@ -332,7 +328,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
332
328
|
_this4.logger.logInfo({
|
333
329
|
title: 'canMakePayments_error'
|
334
330
|
}, {
|
335
|
-
|
331
|
+
errorMessage: JSON.stringify(e)
|
336
332
|
});
|
337
333
|
resolve(false);
|
338
334
|
});
|
@@ -403,7 +399,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
403
399
|
this.logger.logError({
|
404
400
|
title: 'performance_optimization_channelType_error'
|
405
401
|
}, {
|
406
|
-
|
402
|
+
eventMessage: channelType
|
407
403
|
});
|
408
404
|
}
|
409
405
|
this.timer = setTimeout(function () {
|
@@ -163,7 +163,7 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
163
163
|
this.logger.logInfo({
|
164
164
|
title: 'sdk_event_securitySdkPreInit'
|
165
165
|
}, {
|
166
|
-
|
166
|
+
productScene: product
|
167
167
|
}).send();
|
168
168
|
var sdk = this._getSecuritySDKByProductScene({
|
169
169
|
product: product || scene
|
@@ -176,14 +176,14 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
176
176
|
_this.logger.logInfo({
|
177
177
|
title: 'sdk_event_securitySdkPreInitSuccess'
|
178
178
|
}, {
|
179
|
-
|
179
|
+
productScene: product
|
180
180
|
}).send();
|
181
181
|
}, function (msg) {
|
182
182
|
_this.logger.logError({
|
183
183
|
title: 'sdk_error_securitySdkInitFailed',
|
184
184
|
msg: msg
|
185
185
|
}, {
|
186
|
-
|
186
|
+
productScene: product,
|
187
187
|
sign: 'Active initialization'
|
188
188
|
}).send();
|
189
189
|
});
|
@@ -12,6 +12,7 @@ export declare class AntomSDKCore {
|
|
12
12
|
private instanceId;
|
13
13
|
private sdkMetaData;
|
14
14
|
private productProcessors;
|
15
|
+
private enablePopWindowEventCallback;
|
15
16
|
constructor();
|
16
17
|
registerProcessor(productScene: string, paymentMethod: string, processor: ProductProcessor): void;
|
17
18
|
init(options: IoptionsParams, productScene: ProductSceneEnum): void;
|
@@ -21,7 +21,7 @@ import { parseWebAppMatchConfig } from "../utils/web_app_url_utils";
|
|
21
21
|
import { redirect } from "../utils/redirect_utils";
|
22
22
|
import { insertStyleSheet } from "../../component/popupWindow.style";
|
23
23
|
import { hideMockup, createMockup, createRetentionPopup, hideRetentionPopup, showRetentionPopup, cleanMockup, removeRetentionPopup, handleDeclareInfo } from "../../component/component.popup.style";
|
24
|
-
import { EVENT, LOADING_ID } from "../../constant";
|
24
|
+
import { COMPONENT_CLOSE_MASK_BLOCK_ID, EVENT, LOADING_ID } from "../../constant";
|
25
25
|
/**
|
26
26
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
27
27
|
* @date 2024/9/17
|
@@ -35,6 +35,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
35
35
|
_defineProperty(this, "instanceId", void 0);
|
36
36
|
_defineProperty(this, "sdkMetaData", void 0);
|
37
37
|
_defineProperty(this, "productProcessors", {});
|
38
|
+
_defineProperty(this, "enablePopWindowEventCallback", false);
|
38
39
|
}
|
39
40
|
_createClass(AntomSDKCore, [{
|
40
41
|
key: "registerProcessor",
|
@@ -162,6 +163,11 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
162
163
|
var _options$onError;
|
163
164
|
(_options$onError = options.onError) === null || _options$onError === void 0 || _options$onError.call(options, data);
|
164
165
|
});
|
166
|
+
eventCenter.listen(EVENT.declareEventCallbackInfo.name, function (data) {
|
167
|
+
if (data !== null && data !== void 0 && data.popWindowEventInfo) {
|
168
|
+
_this.enablePopWindowEventCallback = data.popWindowEventInfo.enableCallback;
|
169
|
+
}
|
170
|
+
});
|
165
171
|
|
166
172
|
// execute additional logic from specified product
|
167
173
|
if (this.productProcessors[sdkMetaData.productScene]) {
|
@@ -296,6 +302,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
296
302
|
var platform = this.paymentContext.displayInfo.platform;
|
297
303
|
var payload = this.bizFlowStartBehavior.payload;
|
298
304
|
var closeBtnCallbackForPopup = function closeBtnCallbackForPopup() {
|
305
|
+
var isOnCloseEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
299
306
|
if (displayType === DisplayTypeEnum.inline) {
|
300
307
|
return;
|
301
308
|
}
|
@@ -303,13 +310,13 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
303
310
|
showRetentionPopup();
|
304
311
|
return;
|
305
312
|
} else {
|
306
|
-
_this2.handleClose();
|
313
|
+
_this2.handleClose(isOnCloseEvent);
|
307
314
|
}
|
308
315
|
};
|
309
316
|
|
310
317
|
// TODO 感觉有死循环
|
311
318
|
eventCenter.listen(EVENT.close.name, function () {
|
312
|
-
closeBtnCallbackForPopup();
|
319
|
+
closeBtnCallbackForPopup(true);
|
313
320
|
});
|
314
321
|
eventCenter.listen(EVENT.setAllowRetention.name, function (data) {
|
315
322
|
if (data === undefined || typeof data !== 'boolean') {
|
@@ -335,7 +342,8 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
335
342
|
});
|
336
343
|
createMockup({
|
337
344
|
platform: platform,
|
338
|
-
onClickOutside: payload.allowClickPopupOutsideClose ? closeBtnCallbackForPopup : undefined
|
345
|
+
onClickOutside: payload.allowClickPopupOutsideClose ? closeBtnCallbackForPopup : undefined,
|
346
|
+
closeBtnFunc: closeBtnCallbackForPopup
|
339
347
|
});
|
340
348
|
containerService.showLoading(container, this.paymentContext.displayInfo);
|
341
349
|
return;
|
@@ -344,21 +352,25 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
344
352
|
}, {
|
345
353
|
key: "handleClose",
|
346
354
|
value: function handleClose() {
|
355
|
+
var isOnCloseEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
347
356
|
var eventCenter = ServiceProvider.getInstance(this.instanceId).getService('EventCenter');
|
348
357
|
eventCenter.emit(EVENT.closeCallback.name, {});
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
result: {
|
353
|
-
|
354
|
-
|
358
|
+
if (this.enablePopWindowEventCallback && !isOnCloseEvent) {
|
359
|
+
eventCenter.emit(EVENT.eventCallback.name, {
|
360
|
+
code: eventCodeEnum.SDK_PAYMENT_CANCEL,
|
361
|
+
result: {
|
362
|
+
result: {}
|
363
|
+
}
|
364
|
+
});
|
365
|
+
}
|
355
366
|
this.cleanRender();
|
356
367
|
}
|
357
368
|
}, {
|
358
369
|
key: "cleanRender",
|
359
370
|
value: function cleanRender() {
|
360
371
|
var _this3 = this,
|
361
|
-
_document$getElementB
|
372
|
+
_document$getElementB,
|
373
|
+
_document$getElementB2;
|
362
374
|
var immediately = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
363
375
|
var containerService = ServiceProvider.getInstance(this.instanceId).getService('Container');
|
364
376
|
var cleanElement = function cleanElement() {
|
@@ -367,7 +379,8 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
367
379
|
removeRetentionPopup();
|
368
380
|
// TODO @/component this.removeEventListener();
|
369
381
|
};
|
370
|
-
(_document$getElementB = document.getElementById(
|
382
|
+
(_document$getElementB = document.getElementById(COMPONENT_CLOSE_MASK_BLOCK_ID)) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
383
|
+
(_document$getElementB2 = document.getElementById(LOADING_ID)) === null || _document$getElementB2 === void 0 || _document$getElementB2.remove();
|
371
384
|
containerService.startHideAnim();
|
372
385
|
hideMockup();
|
373
386
|
if (immediately) {
|