@paykka/card-checkout-ui 0.7.0 → 0.8.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/card-checkout-ui.js +19 -19
- package/dist/card-checkout-ui.umd.cjs +19 -19
- package/dist/es/api/modules/checkout/map.js +11 -0
- package/dist/es/components/AliPay/index.js +39 -29
- package/dist/es/components/ApplePay/index.js +14 -7
- package/dist/es/components/Card/index.js +42 -39
- package/dist/es/components/DropIn/index.js +210 -0
- package/dist/es/components/GooglePay/index.js +11 -4
- package/dist/es/components/Sepa/index.js +5 -3
- package/dist/es/components/WechatPay/index.js +26 -17
- package/dist/es/components/index.js +1 -0
- package/dist/es/components/internal/Modal/Modal.js +1 -1
- package/dist/es/components/internal/icons/IconCard.js +42 -0
- package/dist/es/constant.js +10 -0
- package/dist/es/core/PayKKaCheckout.js +10 -0
- package/dist/es/hooks/usePayState.js +3 -1
- package/dist/es/i18n/locales/de-DE.js +3 -0
- package/dist/es/i18n/locales/en-GB.js +3 -0
- package/dist/es/i18n/locales/es-ES.js +3 -0
- package/dist/es/i18n/locales/fr-FR.js +3 -0
- package/dist/es/i18n/locales/ja-JP.js +3 -0
- package/dist/es/i18n/locales/ko-KR.js +3 -0
- package/dist/es/i18n/locales/pt-PT.js +3 -0
- package/dist/es/i18n/locales/ru-RU.js +3 -0
- package/dist/es/i18n/locales/zh-CN.js +3 -0
- package/dist/es/i18n/locales/zh-HK.js +3 -0
- package/dist/es/i18n/locales/zh-TW.js +3 -0
- package/dist/es/i18n/util.js +11 -0
- package/dist/es/index.js +4 -0
- package/dist/es/style.css +103 -7
- package/dist/style.css +1 -1
- package/dist/types/api/modules/checkout/map.d.ts +2 -1
- package/dist/types/api/modules/checkout/type.d.ts +11 -2
- package/dist/types/components/AliPay/AliPay.d.ts +2 -1
- package/dist/types/components/AliPay/type.d.ts +1 -2
- package/dist/types/components/ApplePay/ApplePay.d.ts +2 -1
- package/dist/types/components/ApplePay/type.d.ts +9 -6
- package/dist/types/components/Card/Card.d.ts +2 -1
- package/dist/types/components/Card/type.d.ts +2 -2
- package/dist/types/components/DropIn/DropIn.d.ts +6 -0
- package/dist/types/components/DropIn/components/PaymentTabs/PaymentTabs.d.ts +3 -0
- package/dist/types/components/DropIn/components/PaymentTabs/index.d.ts +2 -0
- package/dist/types/components/DropIn/components/PaymentTabs/type.d.ts +11 -0
- package/dist/types/components/DropIn/index.d.ts +2 -0
- package/dist/types/components/DropIn/type.d.ts +49 -0
- package/dist/types/components/GooglePay/GooglePay.d.ts +2 -1
- package/dist/types/components/GooglePay/type.d.ts +20 -9
- package/dist/types/components/Sepa/Sepa.d.ts +2 -1
- package/dist/types/components/Sepa/type.d.ts +1 -2
- package/dist/types/components/WechatPay/WechatPay.d.ts +2 -1
- package/dist/types/components/WechatPay/type.d.ts +1 -2
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/internal/Modal/index.d.ts +2 -0
- package/dist/types/components/internal/Modal/type.d.ts +1 -1
- package/dist/types/components/internal/icons/IconCard.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +1 -0
- package/dist/types/constant.d.ts +11 -0
- package/dist/types/core/PayKKaCheckout.d.ts +1 -0
- package/dist/types/i18n/locales/de-DE.d.ts +2 -0
- package/dist/types/i18n/locales/en-GB.d.ts +2 -0
- package/dist/types/i18n/locales/es-ES.d.ts +2 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +2 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +2 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +2 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +2 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +2 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +2 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +2 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +2 -0
- package/dist/types/i18n/util.d.ts +5 -0
- package/dist/types/types/index.d.ts +24 -4
- package/package.json +63 -63
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.paykka-card-checkout,.paykka-card-checkout *{box-sizing:border-box}@media (min-width: 480px){.paykka-card-checkout-ali-pay__email{padding-bottom:20px}}.paykka-card-checkout-ali-pay__error{margin-top:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-ali-pay__error{margin-top:20px}}.paykka-card-checkout-ali-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-ali-pay__button{margin-top:20px}}.paykka-card-checkout-address-field__first-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-bottom-right-radius:0;border-bottom-left-radius:0}.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-radius:0;border-top:0}.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper:focus{border-top:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-top-right-radius:0;border-top-left-radius:0;border-top:0}.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper:focus{border-top:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-form-item{font-size:16px}.paykka-card-checkout-form-item__label{margin-bottom:8px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none}@media (min-width: 480px){.paykka-card-checkout-form-item__label{margin-bottom:10px}}.paykka-card-checkout-form-item__error-text{margin-top:4px;color:#f53f3f;font-size:14px}.paykka-card-checkout-input{position:relative;box-sizing:border-box;font-size:16px}.paykka-card-checkout-input__input-wrapper{display:flex;align-items:center;height:44px;width:100%;border-radius:8px;border:1px solid #E1E1E5;transition:border .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1);caret-color:var(--paykka-card-checkout-input-color, #4F43DF) .paykka-card-checkout-input__input-wrapper --success;caret-color-border-bottom:1px solid #00B42A}.paykka-card-checkout-input__input-wrapper--error{border:1px solid #F53F3F}.paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-input__input-wrapper:focus{border:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 2px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-input__input-wrapper-disabled{cursor:not-allowed;background:#f5f5f7}.paykka-card-checkout-input__input-wrapper-disabled:active,.paykka-card-checkout-input__input-wrapper-disabled--focus,.paykka-card-checkout-input__input-wrapper-disabled:focus{border:1px solid #F5F5F7;box-shadow:0 0 0 2px #f5f5f7}.paykka-card-checkout-input__input{outline:none;border:none;height:100%;width:100%;border-radius:8px;caret-color:var(--paykka-card-checkout-input-color, #4F43DF);font-size:16px;padding-left:12px;background-color:transparent}.paykka-card-checkout-input__input::placeholder{color:#c2c2c2}.paykka-card-checkout-input__right-icon{padding-right:12px;display:flex;align-items:center;flex-shrink:0;margin-left:12px}.paykka-card-checkout-input__left-icon{padding-left:12px;display:flex;align-items:center;flex-shrink:0;margin-right:12px}.paykka-card-checkout-select__wrapper{width:100%;position:relative;cursor:pointer}.paykka-card-checkout-select__render-label{position:absolute;top:0;line-height:44px;height:44px;padding:0 16px;display:flex}.paykka-card-checkout-select__render-label--placeholder{color:#c2c2c2}.paykka-card-checkout-select__render-label--hidden{visibility:hidden}.paykka-card-checkout-select__menu{margin-top:4px;width:100%;max-height:260px;background:#fff;box-shadow:0 4px 14px #0000001a;border-radius:4px;border:1px solid #EBEBEF;overflow-y:auto;z-index:999;position:absolute}.paykka-card-checkout-select__menu-item{padding:6px 12px;line-height:32px;color:#626266;cursor:pointer;display:flex;justify-content:space-between}.paykka-card-checkout-select__menu-item:hover,.paykka-card-checkout-select__menu-item:active,.paykka-card-checkout-select__menu-item--selected,.paykka-card-checkout-select__menu-item:focus{color:#1f1f1f;background:#f3f3f5}.paykka-card-checkout-select__menu-item-icon{margin-left:10px;display:flex;align-items:center}.paykka-card-checkout-select__menu-no-data{height:200px;display:flex;justify-content:center;align-items:center;color:#c2c2c2}.paykka-card-checkout-info{display:flex;align-items:center;padding:10px 14px;border-radius:4px}.paykka-card-checkout-info--error{background-color:#ffece8}.paykka-card-checkout-info__icon{margin-right:8px;height:1.3em;display:flex;align-items:center}.paykka-card-checkout-info__content{text-align:justify;word-break:break-all}.paykka-card-checkout-recurring-tip{display:flex;color:#a9a9a9}.paykka-card-checkout-recurring-tip__icon{width:20px;display:flex;padding-top:4px;padding-right:4px}.paykka-card-checkout-submit-button--success{opacity:1!important;background-color:#00b42a!important}.paykka-card-checkout-submit-button__text{line-height:1}.paykka-card-checkout-submit-button__text--not-verified{color:#fff9}.paykka-card-checkout-button{display:flex;align-items:center;justify-content:center;width:100%;height:44px;padding:0 14px;border-radius:8px;border:0;background-color:var(--paykka-card-checkout-button-bg-color, #4F43DF);color:var(--paykka-card-checkout-button-text-color, #fff);font-size:16px;cursor:pointer;text-decoration:none;transition:background-color .3s cubic-bezier(.4,0,.2,1)}.paykka-card-checkout-button:not(.paykka-card-checkout-button--loading).paykka-card-checkout-button:not(.paykka-card-checkout-button--disabled).paykka-card-checkout-button:not(.paykka-card-checkout-button--dashed):hover{background-color:var(--paykka-card-checkout-button-bg-color-hover, #3f33bb)}.paykka-card-checkout-button:not(.paykka-card-checkout-button--loading).paykka-card-checkout-button:not(.paykka-card-checkout-button--disabled).paykka-card-checkout-button:not(.paykka-card-checkout-button--dashed):active{background-color:var(--paykka-card-checkout-button-bg-color-active, #312498)}.paykka-card-checkout-button--loading{cursor:wait}.paykka-card-checkout-button--disabled{cursor:not-allowed;opacity:.5}.paykka-card-checkout-button--dashed{border:1px dashed #DFDFE5;color:#1f1f1f;background-color:transparent}.paykka-card-checkout-button__icon{display:flex;align-items:center;margin-right:12px}.paykka-card-checkout-loading-check{display:inline-flex;align-items:center;overflow:hidden;--circle-transition-time: .3s;--check-dashoffset: 50}.paykka-card-checkout-loading-check__circle{transition:stroke-dasharray var(--circle-transition-time) linear}.paykka-card-checkout-loading-check__circle--loading{animation:spin 1s infinite linear;transform-origin:center}.paykka-card-checkout-loading-check__check{stroke-dasharray:var(--check-dashoffset);stroke-dashoffset:var(--check-dashoffset);animation:tick .5s ease-out;animation-fill-mode:forwards;animation-delay:var(--circle-transition-time)}@keyframes tick{0%{stroke-dashoffset:var(--check-dashoffset)}to{stroke-dashoffset:0}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.paykka-card-checkout-card{min-width:280px}.paykka-card-checkout-card__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__field{margin-bottom:20px}}.paykka-card-checkout-card__center{display:flex;justify-content:space-between}.paykka-card-checkout-card__center>div{width:calc((100% - 20px)/2);transition:width .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-card__center>div{width:calc((100% - 32px)/2)}}.paykka-card-checkout-card__card-info{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__card-info{margin-bottom:20px}}.paykka-card-checkout-card__holder-name{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__holder-name{margin-bottom:20px}}.paykka-card-checkout-card__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-card__button{margin-top:20px}}.paykka-card-checkout-card__card-brands{margin-top:8px}.paykka-card-checkout-card__card-number-wrapper{position:relative}.paykka-card-checkout-card__change-box{display:flex;align-items:center;color:#4f43df;font-size:14px;position:absolute;top:0;right:0;cursor:pointer}.paykka-card-checkout-card__card-selector-wrapper{display:flex;justify-content:space-between}.paykka-card-checkout-card__address{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__address{margin-bottom:20px}}.paykka-card-checkout-card__store-checkbox{margin-top:16px}@media (min-width: 480px){.paykka-card-checkout-card__store-checkbox{margin-top:20px}}.paykka-card-checkout-card-brands{display:flex;flex-wrap:wrap;gap:6px}.paykka-card-checkout-card-brands__more{line-height:32px;font-size:13px;color:#687282}.paykka-card-checkout-card-selector__action{padding:8px 12px}.paykka-card-checkout-card-selector__label{display:flex;align-items:center}.paykka-card-checkout-card-selector__card-no{margin-left:12px}.paykka-card-checkout-card-selector__change{display:flex;align-items:center;color:#4f43df;font-size:14px}.paykka-card-checkout-card-no__wrapper{display:flex;align-items:center}.paykka-card-checkout-card-no__dot{width:4px;height:4px;background:currentColor;margin-right:4px;border-radius:50%}.paykka-card-checkout-card-no__card-no{margin-left:4px}.paykka-card-checkout-check-box{display:inline-flex;align-items:center;font-size:14px;background-color:transparent;cursor:pointer}.paykka-card-checkout-check-box:hover .paykka-card-checkout-check-box__inner{border-color:#4f43df}.paykka-card-checkout-check-box--checked .paykka-card-checkout-check-box__inner{border-color:#4f43df;background-color:#4f43df}.paykka-card-checkout-check-box__inner{width:14px;height:14px;border:1px solid #E1E1E5;border-radius:2px;margin-right:8px;transition:border-color .2s cubic-bezier(.4,0,.2,1);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.paykka-card-checkout-modal{position:fixed;left:0;right:0;top:0;bottom:0;z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center}.paykka-card-checkout-modal__mask{position:fixed;left:0;right:0;top:0;bottom:0;background-color:#0006}.paykka-card-checkout-modal__content{position:relative;z-index:9999;border-radius:8px;background-color:#fff;box-shadow:0 8px 16px -8px #00000014,0 12px 32px #0000000f,0 16px 48px 16px #0000000a;display:flex;flex-direction:column}.paykka-card-checkout-modal__close{cursor:pointer;right:0;position:absolute;transform:translateY(-150%);color:#d2d2d2}.paykka-card-checkout-modal__close:hover{color:#fff}.paykka-card-checkout-modal__body{flex:1;padding:36px 28px 24px}.paykka-card-checkout-three-ds-auth__content{height:100%}.paykka-card-checkout-three-ds-auth__last-three-ds{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column}.paykka-card-checkout-three-ds-auth__last-three-ds-title{margin-top:20px;margin-bottom:40px;color:#1f1f1f;font-size:20px;font-weight:700;text-align:center}.paykka-card-checkout-combined-card-info{width:100%;height:100%;display:flex}.paykka-card-checkout-combined-card-info__card-number{flex:1}.paykka-card-checkout-combined-card-info__expire-date{width:100px}.paykka-card-checkout-combined-card-info__cvv{width:60px}.paykka-card-checkout-combined-card-info__blank-icon{width:16px;height:16px}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__email{padding-bottom:20px}}.paykka-card-checkout-wechat-pay__error{margin-top:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__error{margin-top:20px}}.paykka-card-checkout-wechat-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__button{margin-top:20px}}.paykka-card-checkout-apple-pay__error{margin-bottom:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-apple-pay__error{margin-bottom:20px}}.paykka-card-checkout-apple-pay__button{width:100%;display:flex;align-items:center;justify-content:center;height:44px;--apple-pay-button-width: 100%;--apple-pay-button-height: 44px;--apple-pay-button-border-radius: 8px;--apple-pay-button-padding: 0px 0px;--apple-pay-button-box-sizing: border-box}.paykka-card-checkout-google-pay__error{margin-bottom:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-google-pay__error{margin-bottom:20px}}::-webkit-scrollbar{height:6px;width:6px}::-webkit-scrollbar-thumb{background-color:#00000040;border-radius:4px}::-webkit-scrollbar-button{display:none!important}::-moz-scrollbar-button{display:none!important}.paykka-card-checkout-sepa{min-width:280px}.paykka-card-checkout-sepa__field{margin-bottom:24px}.paykka-card-checkout-sepa__holder-name{padding-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-sepa__holder-name{padding-bottom:20px}}.paykka-card-checkout-sepa__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-sepa__button{margin-top:20px}}
|
|
1
|
+
.paykka-card-checkout,.paykka-card-checkout *{box-sizing:border-box}@media (min-width: 480px){.paykka-card-checkout-ali-pay__email{padding-bottom:20px}}.paykka-card-checkout-ali-pay__error{margin-top:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-ali-pay__error{margin-top:20px}}.paykka-card-checkout-ali-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-ali-pay__button{margin-top:20px}}.paykka-card-checkout-address-field__first-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-bottom-right-radius:0;border-bottom-left-radius:0}.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-radius:0;border-top:0}.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-address-field__mid-item .paykka-card-checkout-input__input-wrapper:focus{border-top:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper{padding:8px 0;border-top-right-radius:0;border-top-left-radius:0;border-top:0}.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-address-field__last-item .paykka-card-checkout-input__input-wrapper:focus{border-top:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-form-item{font-size:16px}.paykka-card-checkout-form-item__label{margin-bottom:8px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none}@media (min-width: 480px){.paykka-card-checkout-form-item__label{margin-bottom:10px}}.paykka-card-checkout-form-item__error-text{margin-top:4px;color:#f53f3f;font-size:14px}.paykka-card-checkout-input{position:relative;box-sizing:border-box;font-size:16px}.paykka-card-checkout-input__input-wrapper{display:flex;align-items:center;height:44px;width:100%;border-radius:8px;border:1px solid #E1E1E5;transition:border .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1);caret-color:var(--paykka-card-checkout-input-color, #4F43DF) .paykka-card-checkout-input__input-wrapper --error;caret-color-border:1px solid #F53F3F}.paykka-card-checkout-input__input-wrapper:active,.paykka-card-checkout-input__input-wrapper--focus,.paykka-card-checkout-input__input-wrapper:focus{border:1px solid var(--paykka-card-checkout-input-color, #4F43DF);box-shadow:0 0 0 1px var(--paykka-card-checkout-input-color, #4F43DF)}.paykka-card-checkout-input__input-wrapper-disabled{cursor:not-allowed;background:#f5f5f7}.paykka-card-checkout-input__input-wrapper-disabled:active,.paykka-card-checkout-input__input-wrapper-disabled--focus,.paykka-card-checkout-input__input-wrapper-disabled:focus{border:1px solid #F5F5F7;box-shadow:0 0 0 2px #f5f5f7}.paykka-card-checkout-input__input{outline:none;border:none;height:100%;width:100%;border-radius:8px;caret-color:var(--paykka-card-checkout-input-color, #4F43DF);font-size:16px;padding-left:12px;background-color:transparent}.paykka-card-checkout-input__input::placeholder{color:#c2c2c2}.paykka-card-checkout-input__input:-webkit-autofill,.paykka-card-checkout-input__input:-internal-autofill-selected{background-color:transparent!important}.paykka-card-checkout-input__right-icon{padding-right:12px;display:flex;align-items:center;flex-shrink:0;margin-left:12px}.paykka-card-checkout-input__left-icon{padding-left:12px;display:flex;align-items:center;flex-shrink:0;margin-right:12px}.paykka-card-checkout-select__wrapper{width:100%;position:relative;cursor:pointer}.paykka-card-checkout-select__render-label{position:absolute;top:0;line-height:44px;height:44px;padding:0 16px;display:flex}.paykka-card-checkout-select__render-label--placeholder{color:#c2c2c2}.paykka-card-checkout-select__render-label--hidden{visibility:hidden}.paykka-card-checkout-select__menu{margin-top:4px;width:100%;max-height:260px;background:#fff;box-shadow:0 4px 14px #0000001a;border-radius:4px;border:1px solid #EBEBEF;overflow-y:auto;z-index:999;position:absolute}.paykka-card-checkout-select__menu-item{padding:6px 12px;line-height:32px;color:#626266;cursor:pointer;display:flex;justify-content:space-between}.paykka-card-checkout-select__menu-item:hover,.paykka-card-checkout-select__menu-item:active,.paykka-card-checkout-select__menu-item--selected,.paykka-card-checkout-select__menu-item:focus{color:#1f1f1f;background:#f3f3f5}.paykka-card-checkout-select__menu-item-icon{margin-left:10px;display:flex;align-items:center}.paykka-card-checkout-select__menu-no-data{height:200px;display:flex;justify-content:center;align-items:center;color:#c2c2c2}.paykka-card-checkout-info{display:flex;align-items:center;padding:10px 14px;border-radius:4px}.paykka-card-checkout-info--error{background-color:#ffece8}.paykka-card-checkout-info__icon{margin-right:8px;height:1.3em;display:flex;align-items:center}.paykka-card-checkout-info__content{text-align:justify;word-break:break-all}.paykka-card-checkout-recurring-tip{display:flex;color:#a9a9a9}.paykka-card-checkout-recurring-tip__icon{width:20px;display:flex;padding-top:4px;padding-right:4px}.paykka-card-checkout-submit-button--success{opacity:1!important;background-color:#00b42a!important}.paykka-card-checkout-submit-button__text{line-height:1}.paykka-card-checkout-submit-button__text--not-verified{color:#fff9}.paykka-card-checkout-button{display:flex;align-items:center;justify-content:center;width:100%;height:44px;padding:0 14px;border-radius:8px;border:0;background-color:var(--paykka-card-checkout-button-bg-color, #4F43DF);color:var(--paykka-card-checkout-button-text-color, #fff);font-size:16px;cursor:pointer;text-decoration:none;transition:background-color .3s cubic-bezier(.4,0,.2,1)}.paykka-card-checkout-button:not(.paykka-card-checkout-button--loading).paykka-card-checkout-button:not(.paykka-card-checkout-button--disabled).paykka-card-checkout-button:not(.paykka-card-checkout-button--dashed):hover{background-color:var(--paykka-card-checkout-button-bg-color-hover, #3f33bb)}.paykka-card-checkout-button:not(.paykka-card-checkout-button--loading).paykka-card-checkout-button:not(.paykka-card-checkout-button--disabled).paykka-card-checkout-button:not(.paykka-card-checkout-button--dashed):active{background-color:var(--paykka-card-checkout-button-bg-color-active, #312498)}.paykka-card-checkout-button--loading{cursor:wait}.paykka-card-checkout-button--disabled{cursor:not-allowed;opacity:.5}.paykka-card-checkout-button--dashed{border:1px dashed #DFDFE5;color:#1f1f1f;background-color:transparent}.paykka-card-checkout-button__icon{display:flex;align-items:center;margin-right:12px}.paykka-card-checkout-loading-check{display:inline-flex;align-items:center;overflow:hidden;--circle-transition-time: .3s;--check-dashoffset: 50}.paykka-card-checkout-loading-check__circle{transition:stroke-dasharray var(--circle-transition-time) linear}.paykka-card-checkout-loading-check__circle--loading{animation:spin 1s infinite linear;transform-origin:center}.paykka-card-checkout-loading-check__check{stroke-dasharray:var(--check-dashoffset);stroke-dashoffset:var(--check-dashoffset);animation:tick .5s ease-out;animation-fill-mode:forwards;animation-delay:var(--circle-transition-time)}@keyframes tick{0%{stroke-dashoffset:var(--check-dashoffset)}to{stroke-dashoffset:0}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.paykka-card-checkout-card{min-width:280px}.paykka-card-checkout-card__field{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__field{margin-bottom:20px}}.paykka-card-checkout-card__center{display:flex;justify-content:space-between}.paykka-card-checkout-card__center>div{width:calc((100% - 20px)/2);transition:width .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-card__center>div{width:calc((100% - 32px)/2)}}.paykka-card-checkout-card__card-info{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__card-info{margin-bottom:20px}}.paykka-card-checkout-card__holder-name{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__holder-name{margin-bottom:20px}}.paykka-card-checkout-card__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-card__button{margin-top:20px}}.paykka-card-checkout-card__card-brands{margin-top:8px}.paykka-card-checkout-card__card-number-wrapper{position:relative}.paykka-card-checkout-card__change-box{display:flex;align-items:center;color:#4f43df;font-size:14px;position:absolute;top:0;right:0;cursor:pointer}.paykka-card-checkout-card__card-selector-wrapper{display:flex;justify-content:space-between}.paykka-card-checkout-card__address{margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-card__address{margin-bottom:20px}}.paykka-card-checkout-card__store-checkbox{margin-top:16px}@media (min-width: 480px){.paykka-card-checkout-card__store-checkbox{margin-top:20px}}.paykka-card-checkout-card-brands{display:flex;flex-wrap:wrap;gap:6px}.paykka-card-checkout-card-brands__more{line-height:32px;font-size:13px;color:#687282}.paykka-card-checkout-card-selector__action{padding:8px 12px}.paykka-card-checkout-card-selector__label{display:flex;align-items:center}.paykka-card-checkout-card-selector__card-no{margin-left:12px}.paykka-card-checkout-card-selector__change{display:flex;align-items:center;color:#4f43df;font-size:14px}.paykka-card-checkout-card-no__wrapper{display:flex;align-items:center}.paykka-card-checkout-card-no__dot{width:4px;height:4px;background:currentColor;margin-right:4px;border-radius:50%}.paykka-card-checkout-card-no__card-no{margin-left:4px}.paykka-card-checkout-check-box{display:inline-flex;align-items:center;font-size:14px;background-color:transparent;cursor:pointer}.paykka-card-checkout-check-box:hover .paykka-card-checkout-check-box__inner{border-color:#4f43df}.paykka-card-checkout-check-box--checked .paykka-card-checkout-check-box__inner{border-color:#4f43df;background-color:#4f43df}.paykka-card-checkout-check-box__inner{width:14px;height:14px;border:1px solid #E1E1E5;border-radius:2px;margin-right:8px;transition:border-color .2s cubic-bezier(.4,0,.2,1);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.paykka-card-checkout-modal{position:fixed;left:0;right:0;top:0;bottom:0;z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center}.paykka-card-checkout-modal__mask{position:fixed;left:0;right:0;top:0;bottom:0;background-color:#0006}.paykka-card-checkout-modal__content{position:relative;z-index:9999;border-radius:8px;background-color:#fff;box-shadow:0 8px 16px -8px #00000014,0 12px 32px #0000000f,0 16px 48px 16px #0000000a;display:flex;flex-direction:column}.paykka-card-checkout-modal__close{cursor:pointer;right:0;position:absolute;transform:translateY(-150%);color:#d2d2d2}.paykka-card-checkout-modal__close:hover{color:#fff}.paykka-card-checkout-modal__body{flex:1;padding:36px 28px 24px}.paykka-card-checkout-three-ds-auth__content{height:100%}.paykka-card-checkout-three-ds-auth__last-three-ds{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column}.paykka-card-checkout-three-ds-auth__last-three-ds-title{margin-top:20px;margin-bottom:40px;color:#1f1f1f;font-size:20px;font-weight:700;text-align:center}.paykka-card-checkout-combined-card-info{width:100%;height:100%;display:flex}.paykka-card-checkout-combined-card-info__card-number{flex:1}.paykka-card-checkout-combined-card-info__expire-date{width:100px}.paykka-card-checkout-combined-card-info__cvv{width:60px}.paykka-card-checkout-combined-card-info__blank-icon{width:16px;height:16px}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__email{padding-bottom:20px}}.paykka-card-checkout-wechat-pay__error{margin-top:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__error{margin-top:20px}}.paykka-card-checkout-wechat-pay__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-wechat-pay__button{margin-top:20px}}.paykka-card-checkout-apple-pay__error{margin-bottom:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-apple-pay__error{margin-bottom:20px}}.paykka-card-checkout-apple-pay__button{width:100%;display:flex;align-items:center;justify-content:center;height:44px;--apple-pay-button-width: 100%;--apple-pay-button-height: 44px;--apple-pay-button-border-radius: 8px;--apple-pay-button-padding: 0px 0px;--apple-pay-button-box-sizing: border-box}.paykka-card-checkout-google-pay__error{margin-bottom:16px;transition:margin-bottom .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-google-pay__error{margin-bottom:20px}}.paykka-card-checkout-sepa{min-width:280px}.paykka-card-checkout-sepa__field{margin-bottom:24px}.paykka-card-checkout-sepa__holder-name{padding-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-sepa__holder-name{padding-bottom:20px}}.paykka-card-checkout-sepa__button{margin-top:16px;transition:margin-top .1s cubic-bezier(.4,0,.2,1)}@media (min-width: 480px){.paykka-card-checkout-sepa__button{margin-top:20px}}.paykka-card-checkout-payment-tabs{display:flex;flex-wrap:nowrap;justify-content:start;column-gap:6px}.paykka-card-checkout-payment-tabs__tab{border:2px solid #E1E1E5;padding:12px;border-radius:12px;width:calc((100% - 12px) / 3)}@media (min-width: 480px){.paykka-card-checkout-payment-tabs__tab{padding:16px}}.paykka-card-checkout-payment-tabs__name{color:#626266}::-webkit-scrollbar{height:6px;width:6px}::-webkit-scrollbar-thumb{background-color:#00000040;border-radius:4px}::-webkit-scrollbar-button{display:none!important}::-moz-scrollbar-button{display:none!important}.paykka-card-checkout-drop-in__header-payment{margin-bottom:10px}.paykka-card-checkout-drop-in__other{display:flex;justify-content:center;align-items:center;margin-top:14px}@media (min-width: 480px){.paykka-card-checkout-drop-in__other{margin-top:30px}}.paykka-card-checkout-drop-in__other-text{margin:0 14px;color:#6e6e7e}.paykka-card-checkout-drop-in__other-line{background-color:#dfdfe5;flex-grow:.5;height:1px}.paykka-card-checkout-drop-in__tabs-wrapper{margin-top:16px;margin-bottom:16px}@media (min-width: 480px){.paykka-card-checkout-drop-in__tabs-wrapper{margin-top:24px;margin-bottom:24px}}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { CheckoutRes } from './type';
|
|
1
|
+
import type { AmountBreakdown, CheckoutRes } from './type';
|
|
2
2
|
export declare function formatPaymentMethodInfo(paymentMethods?: Recordable[]): Pick<CheckoutRes, 'paymentMethod' | 'channelParams'>;
|
|
3
|
+
export declare function formatAmountBreakdown(info?: Recordable): AmountBreakdown;
|
|
3
4
|
export declare function checkoutMap(res?: Recordable): CheckoutRes;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SessionMode } from '../../../constant';
|
|
1
|
+
import type { PaymentMethod, SessionMode } from '../../../constant';
|
|
2
2
|
import type { Amount } from '../type';
|
|
3
3
|
export interface CheckoutTheme {
|
|
4
4
|
merchantName: string;
|
|
@@ -42,7 +42,7 @@ export interface ChannelParams {
|
|
|
42
42
|
}
|
|
43
43
|
export interface CheckoutRes {
|
|
44
44
|
merchantId: string;
|
|
45
|
-
paymentMethod:
|
|
45
|
+
paymentMethod: PaymentMethod[];
|
|
46
46
|
sessionId: string;
|
|
47
47
|
status: 'PROCESSING' | 'SUCCESS' | 'EXPIRED';
|
|
48
48
|
transAmount: Amount;
|
|
@@ -60,6 +60,15 @@ export interface CheckoutRes {
|
|
|
60
60
|
storePaymentMethod?: boolean;
|
|
61
61
|
field: FieldStatusConfig;
|
|
62
62
|
country?: string;
|
|
63
|
+
cancelUrl?: string;
|
|
64
|
+
amountBreakdown?: AmountBreakdown;
|
|
65
|
+
}
|
|
66
|
+
export interface AmountBreakdown {
|
|
67
|
+
goodsTax?: Amount;
|
|
68
|
+
shippingAmount?: Amount;
|
|
69
|
+
shippingTax?: Amount;
|
|
70
|
+
discount?: Amount;
|
|
71
|
+
other?: Amount;
|
|
63
72
|
}
|
|
64
73
|
export interface FieldStatusConfig {
|
|
65
74
|
holderName: FieldStatus;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './ali-pay.scss';
|
|
2
2
|
import type { AliPayProps, AliPayRef } from './type';
|
|
3
|
-
|
|
3
|
+
import type { CoreProps } from '../../types';
|
|
4
|
+
export declare const AliPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<AliPayProps & CoreProps> & {
|
|
4
5
|
ref?: import("preact").Ref<AliPayRef> | undefined;
|
|
5
6
|
}>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { PayRes } from '../../api';
|
|
2
2
|
import type { PayKKaError } from '../../core';
|
|
3
|
-
import type { CoreProps } from '../../types';
|
|
4
3
|
import type { FormValidateError } from '../internal/Form';
|
|
5
|
-
export interface AliPayProps
|
|
4
|
+
export interface AliPayProps {
|
|
6
5
|
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
7
6
|
onSuccess?: (...args: any[]) => void;
|
|
8
7
|
onError?: (error: PayKKaError) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './apple-pay.scss';
|
|
2
2
|
import type { ApplePayProps, ApplePayRef } from './type';
|
|
3
|
-
|
|
3
|
+
import type { CoreProps } from '../../types';
|
|
4
|
+
export declare const ApplePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<ApplePayProps & CoreProps> & {
|
|
4
5
|
ref?: import("preact").Ref<ApplePayRef> | undefined;
|
|
5
6
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PayKKaError } from '../../core';
|
|
2
|
-
import type {
|
|
3
|
-
export interface ApplePayProps
|
|
2
|
+
import type { PaymentSuccessData } from '../../types';
|
|
3
|
+
export interface ApplePayProps {
|
|
4
4
|
/** 支付授权成功后触发 */
|
|
5
5
|
onSubmit?: () => void;
|
|
6
6
|
/** 支付成功后触发 */
|
|
@@ -13,16 +13,19 @@ export interface ApplePayProps extends CoreProps {
|
|
|
13
13
|
onTimeout?: (source: 'retry' | 'channel') => void;
|
|
14
14
|
/** 收银台已过期时触发 */
|
|
15
15
|
onExpired?: () => void;
|
|
16
|
-
/** 交易被风控拦截时触发 */
|
|
17
|
-
onAuthorized?: () => void;
|
|
18
16
|
/** 支付取消时触发 */
|
|
19
17
|
onCancel?: () => void;
|
|
20
18
|
/** Apple Pay 按钮是否可用 */
|
|
21
19
|
onCanUse?: (canUse: boolean) => void;
|
|
22
20
|
/**
|
|
23
|
-
*
|
|
21
|
+
* @internal
|
|
22
|
+
* 交易被风控拦截时触发
|
|
23
|
+
*/
|
|
24
|
+
onAuthorized?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
* 点击 GooglePay 按钮
|
|
24
28
|
*/
|
|
25
|
-
/** 点击 ApplePay 按钮 */
|
|
26
29
|
onBtnClick?: () => void;
|
|
27
30
|
}
|
|
28
31
|
export interface ApplePayRef {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './card.scss';
|
|
2
2
|
import type { CardProps, CardRef } from './type';
|
|
3
|
-
|
|
3
|
+
import { type CoreProps } from '../../types';
|
|
4
|
+
export declare const Card: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<CardProps & CoreProps> & {
|
|
4
5
|
ref?: import("preact").Ref<CardRef> | undefined;
|
|
5
6
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PayKKaError } from '../../core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ElementStylesConfig, PaymentSuccessData } from '../../types';
|
|
3
3
|
import type { FormValidateError } from '../internal/Form';
|
|
4
|
-
export interface CardProps
|
|
4
|
+
export interface CardProps {
|
|
5
5
|
/** 定义卡敏感信息表单布局展示,split 为分割布局,combine 为合并布局 */
|
|
6
6
|
cardInfoLayout?: CardInfoLayout;
|
|
7
7
|
/**
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type DropInProps, type DropInRefs } from './type';
|
|
2
|
+
import './drop-in.scss';
|
|
3
|
+
import type { CoreProps } from '../../types';
|
|
4
|
+
export declare const DropIn: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<DropInProps & CoreProps> & {
|
|
5
|
+
ref?: import("preact").Ref<DropInRefs> | undefined;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PaymentCategory } from '../../../../constant';
|
|
2
|
+
import type { PaymentTypeOptions } from '../../type';
|
|
3
|
+
export interface PaymentTabsProps {
|
|
4
|
+
value: PaymentCategory;
|
|
5
|
+
tabs: PaymentTypeOptions[];
|
|
6
|
+
enabled?: PaymentCategory;
|
|
7
|
+
themeColor?: string;
|
|
8
|
+
onChange?: (type: PaymentCategory) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface PaymentTabsRefs {
|
|
11
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ReactNode } from 'preact/compat';
|
|
2
|
+
import type { PaymentSuccessData } from '../../types';
|
|
3
|
+
import { PaymentCategory, PaymentMethod } from '../../constant';
|
|
4
|
+
import type { ComponentType } from 'preact';
|
|
5
|
+
import type { FormValidateError } from '../internal/Form';
|
|
6
|
+
import type { PayKKaError } from '../../core';
|
|
7
|
+
export interface DropInProps {
|
|
8
|
+
/**
|
|
9
|
+
* 配置各种支付方式的参数
|
|
10
|
+
* 最终展示的支付方式由创建收银台请求返回结果决定,而不是由该参数决定
|
|
11
|
+
*/
|
|
12
|
+
paymentMethods?: PaymentMethodsConfig;
|
|
13
|
+
/**
|
|
14
|
+
* 布局,tabs 表示在tab切换式布局,accordion 表示折叠式布局(手风琴)
|
|
15
|
+
* 目前暂不支持 accordion 布局
|
|
16
|
+
* @default tabs
|
|
17
|
+
*/
|
|
18
|
+
layout?: 'tabs' | 'accordion';
|
|
19
|
+
/** 提交表单时触发 */
|
|
20
|
+
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
21
|
+
/** 支付成功后触发 */
|
|
22
|
+
onSuccess?: (data: PaymentSuccessData) => void;
|
|
23
|
+
/** 支付失败时触发 */
|
|
24
|
+
onError?: (error: PayKKaError) => void;
|
|
25
|
+
/** 支付超时时触发 */
|
|
26
|
+
onTimeout?: () => void;
|
|
27
|
+
/** 收银台已过期时触发 */
|
|
28
|
+
onExpired?: () => void;
|
|
29
|
+
}
|
|
30
|
+
export interface DropInRefs {
|
|
31
|
+
/** 不展示支付按钮时,可调用该方法进行支付 */
|
|
32
|
+
payment: () => void;
|
|
33
|
+
}
|
|
34
|
+
export type PaymentMethodsConfig = {
|
|
35
|
+
[key in DropInPaymentCategory]: Partial<PaymentComponentProps<key>>;
|
|
36
|
+
};
|
|
37
|
+
export interface PaymentTypeOptions {
|
|
38
|
+
icon: ReactNode;
|
|
39
|
+
name: string;
|
|
40
|
+
type: DropInPaymentCategory;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 当前 drop in 支持的支付方式
|
|
44
|
+
* 目前暂不支持 WeChatPay 和 Alipay
|
|
45
|
+
*/
|
|
46
|
+
export declare const dropInSupportedPaymentMethods: PaymentMethod[];
|
|
47
|
+
export type DropInPaymentCategory = PaymentCategory.APPLE_PAY | PaymentCategory.GOOGLE_PAY | PaymentCategory.CARD;
|
|
48
|
+
export declare const PaymentComponentMap: Record<DropInPaymentCategory, ComponentType<any>>;
|
|
49
|
+
export type PaymentComponentProps<P extends keyof typeof PaymentComponentMap> = React.ComponentProps<(typeof PaymentComponentMap)[P]>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './google-pay.scss';
|
|
2
2
|
import type { GooglePayProps, GooglePayRef } from './type';
|
|
3
|
-
|
|
3
|
+
import type { CoreProps } from '../../types';
|
|
4
|
+
export declare const GooglePay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<GooglePayProps & CoreProps> & {
|
|
4
5
|
ref?: import("preact").Ref<GooglePayRef> | undefined;
|
|
5
6
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PayKKaError } from '../../core';
|
|
2
|
-
import type {
|
|
3
|
-
export interface GooglePayProps
|
|
2
|
+
import type { PaymentSuccessData } from '../../types';
|
|
3
|
+
export interface GooglePayProps {
|
|
4
4
|
/** 支付授权成功后触发 */
|
|
5
5
|
onSubmit?: () => void;
|
|
6
6
|
/** 支付成功后触发 */
|
|
@@ -13,19 +13,30 @@ export interface GooglePayProps extends CoreProps {
|
|
|
13
13
|
onTimeout?: (source: 'retry' | 'channel') => void;
|
|
14
14
|
/** 收银台已过期时触发 */
|
|
15
15
|
onExpired?: () => void;
|
|
16
|
-
/** 交易被风控拦截时触发 */
|
|
17
|
-
onAuthorized?: () => void;
|
|
18
|
-
/** 交易需要 3DS 验证时触发,url 为 3DS 验证链接,incomplete 为 false 表示目前要开始进行 3DS 验证,为 true 表示上一次 3DS 验证还未完成 */
|
|
19
|
-
onThreeDS?: (url: string, incomplete: boolean) => void;
|
|
20
16
|
/** 当前设备环境是否可用于 Google Pay 支付 */
|
|
21
17
|
onCanUse?: (canUse: boolean) => void;
|
|
22
18
|
/**
|
|
23
|
-
*
|
|
19
|
+
* @internal
|
|
20
|
+
* 交易被风控拦截时触发
|
|
21
|
+
*/
|
|
22
|
+
onAuthorized?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
* 交易需要 3DS 验证时触发
|
|
26
|
+
* url 为 3DS 验证链接
|
|
27
|
+
* incomplete 为 false 表示目前要开始进行 3DS 验证,为 true 表示上一次 3DS 验证还未完成
|
|
28
|
+
*/
|
|
29
|
+
onThreeDS?: (url: string, incomplete: boolean) => void;
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* 点击 GooglePay 按钮
|
|
24
33
|
*/
|
|
25
|
-
/** 点击 GooglePay 按钮 */
|
|
26
34
|
onBtnClick?: () => void;
|
|
27
35
|
}
|
|
28
36
|
export interface GooglePayRef {
|
|
29
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* 3DS 验证流程结束后可调用该方法轮询收银台支付状态
|
|
40
|
+
*/
|
|
30
41
|
checkThreeDS: () => void;
|
|
31
42
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './sepa.scss';
|
|
2
2
|
import type { SepaProps, SepaRef } from './type';
|
|
3
|
-
|
|
3
|
+
import type { CoreProps } from '../../types';
|
|
4
|
+
export declare const Sepa: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<SepaProps & CoreProps> & {
|
|
4
5
|
ref?: import("preact").Ref<SepaRef> | undefined;
|
|
5
6
|
}>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PayKKaError } from '../../core';
|
|
2
|
-
import type { CoreProps } from '../../types';
|
|
3
2
|
import type { FormValidateError } from '../internal/Form';
|
|
4
|
-
export interface SepaProps
|
|
3
|
+
export interface SepaProps {
|
|
5
4
|
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
6
5
|
onSuccess?: (returnUrl?: string) => void;
|
|
7
6
|
onError?: (error: PayKKaError) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './wechat-pay.scss';
|
|
2
2
|
import type { WechatPayProps, WechatPayRef } from './type';
|
|
3
|
-
|
|
3
|
+
import type { CoreProps } from '../../types';
|
|
4
|
+
export declare const WechatPay: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<WechatPayProps & CoreProps> & {
|
|
4
5
|
ref?: import("preact").Ref<WechatPayRef> | undefined;
|
|
5
6
|
}>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { PayRes } from '../../api';
|
|
2
2
|
import type { PayKKaError } from '../../core';
|
|
3
|
-
import type { CoreProps } from '../../types';
|
|
4
3
|
import type { FormValidateError } from '../internal/Form';
|
|
5
|
-
export interface WechatPayProps
|
|
4
|
+
export interface WechatPayProps {
|
|
6
5
|
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
7
6
|
onSuccess?: (...args: any[]) => void;
|
|
8
7
|
onError?: (error: PayKKaError) => void;
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from "preact/compat";
|
|
|
2
2
|
import type { CustomAttributes } from "../../../types";
|
|
3
3
|
export interface ModalProps extends CustomAttributes<HTMLDivElement> {
|
|
4
4
|
/** 是否展示弹框 */
|
|
5
|
-
show
|
|
5
|
+
show?: boolean;
|
|
6
6
|
/** 弹窗宽度,不传就自适应 */
|
|
7
7
|
width?: number | string;
|
|
8
8
|
/** 弹窗高度,不传就自适应 */
|
package/dist/types/constant.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const PREFIX = "paykka-card-checkout";
|
|
2
2
|
export declare const COMMON_CLASS_NAME = "paykka-card-checkout";
|
|
3
|
+
/** 具体的,未分类的支付方式,来自后端 */
|
|
3
4
|
export declare enum PaymentMethod {
|
|
4
5
|
ALL = "ALL",
|
|
5
6
|
ALI_PAY = "ALIPAY_PLUS",
|
|
@@ -16,6 +17,16 @@ export declare enum PaymentMethod {
|
|
|
16
17
|
BOC = "BOC",
|
|
17
18
|
SEPA_DEBIT = "SEPA_DEBIT"
|
|
18
19
|
}
|
|
20
|
+
/** 按照大类区分的支付方式 */
|
|
21
|
+
export declare enum PaymentCategory {
|
|
22
|
+
/** 所有卡支付(Visa、MasterCard等) */
|
|
23
|
+
CARD = "card",
|
|
24
|
+
APPLE_PAY = "applePay",
|
|
25
|
+
GOOGLE_PAY = "googlePay",
|
|
26
|
+
SEPA_DEBIT = "sepaDebit",
|
|
27
|
+
WECHAT_PAY = "wechatPay",
|
|
28
|
+
ALI_PAY = "aliPay"
|
|
29
|
+
}
|
|
19
30
|
export declare const CardPaymentMethods: PaymentMethod[];
|
|
20
31
|
export declare enum PaymentType {
|
|
21
32
|
PURCHASE = "PURCHASE",
|
|
@@ -22,6 +22,7 @@ export declare class PayKKaCheckout {
|
|
|
22
22
|
private initExtraParams;
|
|
23
23
|
get session(): Session;
|
|
24
24
|
get envConfig(): PayKKaEnvConfig;
|
|
25
|
+
get config(): PayKKaInitConfiguration;
|
|
25
26
|
/** 创建组件,把 session 作为组件的 props 传递 */
|
|
26
27
|
create<P extends Recordable>(component: ComponentType<P> | ((props: P) => JSX.Element), props?: Partial<P> | null): ComponentInst<P>;
|
|
27
28
|
getCoreProps(): CoreProps;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { CustomLocales, Translation } from './locales';
|
|
2
|
+
/**
|
|
3
|
+
* 获取最终在收银台展示的语言
|
|
4
|
+
* 如果 locale 不符合,则取浏览器语言,若仍然不符合则用 en-GB
|
|
5
|
+
*/
|
|
6
|
+
export declare const getRealLocale: (locale: string) => string;
|
|
2
7
|
export declare function loadTranslation(locale: string, customLocales?: CustomLocales): Promise<{
|
|
3
8
|
locale: string;
|
|
4
9
|
translation: Translation;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'preact/compat';
|
|
2
2
|
import type { LocaleKeyType } from '../i18n';
|
|
3
|
-
import type { PayKKaError, Session } from '../core';
|
|
3
|
+
import type { PayKKaCheckout, PayKKaError, Session } from '../core';
|
|
4
4
|
import type { FraudDetectionEnv } from './fraud-detection';
|
|
5
|
+
import type { FormValidateError } from '../components/internal/Form';
|
|
5
6
|
export * from './fraud-detection';
|
|
6
7
|
export * from './message';
|
|
7
8
|
export type CustomAttributes<T extends EventTarget, K extends keyof HTMLAttributes<T> = 'style' | 'className'> = Pick<HTMLAttributes<T>, K>;
|
|
@@ -22,17 +23,36 @@ export interface PayKKaInitConfiguration {
|
|
|
22
23
|
onPaymentMethodsReady?: (methods: string[]) => void;
|
|
23
24
|
/** 收银台创建时报错触发 */
|
|
24
25
|
onInitError?: (error: PayKKaError) => void;
|
|
26
|
+
/**
|
|
27
|
+
* 全局回调,可以统一处理支付状态
|
|
28
|
+
* 创建组件时传同名回调可覆盖
|
|
29
|
+
*/
|
|
30
|
+
/** 提交表单时触发 */
|
|
31
|
+
onSubmit?: (formValidateError?: Recordable<FormValidateError[]>) => void;
|
|
32
|
+
/** 支付成功后触发 */
|
|
33
|
+
onSuccess?: (data: PaymentSuccessData) => void;
|
|
34
|
+
/** 支付失败时触发 */
|
|
35
|
+
onError?: (error: PayKKaError) => void;
|
|
36
|
+
/** 支付超时时触发 */
|
|
37
|
+
onTimeout?: () => void;
|
|
38
|
+
/** 收银台已过期时触发 */
|
|
39
|
+
onExpired?: () => void;
|
|
25
40
|
/**
|
|
26
41
|
* 内部参数
|
|
27
42
|
*/
|
|
28
43
|
/** 环境配置,优先级大于 env 参数 */
|
|
29
44
|
_envConfig?: PayKKaEnvConfig;
|
|
30
45
|
}
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
/** 收银台创建组件时自动传入的内部属性 */
|
|
47
|
+
export type CoreProps = {
|
|
48
|
+
session: Session;
|
|
49
|
+
/** 收银台实例 */
|
|
50
|
+
core: PayKKaCheckout;
|
|
33
51
|
/** 定义 3DS 所需配置 */
|
|
34
52
|
threeDSFrame?: ThreeDSFrameConfig;
|
|
35
|
-
|
|
53
|
+
/** 组件是否通过 DropIn 创建 */
|
|
54
|
+
isDropIn?: boolean;
|
|
55
|
+
};
|
|
36
56
|
export interface ThreeDSFrameConfig {
|
|
37
57
|
/** 3DS 页面宽度 */
|
|
38
58
|
modalWidth?: number | string;
|