@alipay/ams-checkout 0.0.1730107332-dev.32 → 0.0.1730107332-dev.34
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 +18 -10
- package/esm/config/index.js +3 -3
- package/esm/core/component/ckp/index.js +3 -2
- package/esm/core/component/element/components/address.d.ts +19 -0
- package/esm/core/component/element/components/address.js +68 -0
- package/esm/core/component/element/components/auth.d.ts +17 -0
- package/esm/core/component/element/components/auth.js +60 -0
- package/esm/core/component/element/components/payment.d.ts +19 -0
- package/esm/core/component/element/components/payment.js +74 -0
- package/esm/core/component/element/index.d.ts +47 -0
- package/esm/core/component/element/index.js +816 -0
- package/esm/core/component/element/mock.d.ts +4 -0
- package/esm/core/component/element/mock.js +491 -0
- package/esm/core/component/element/type.d.ts +184 -0
- package/esm/core/component/element/type.js +35 -0
- package/esm/core/component/element/utils.d.ts +13 -0
- package/esm/core/component/element/utils.js +6 -0
- package/esm/foundation/core/index.d.ts +1 -1
- package/esm/foundation/core/index.js +5 -5
- package/esm/foundation/index.d.ts +1 -0
- package/esm/foundation/service/container/index.js +1 -0
- package/esm/foundation/service/event-center.d.ts +2 -0
- package/esm/foundation/service/event-center.js +36 -2
- package/esm/foundation/service/security/index.js +20 -4
- package/esm/index.d.ts +5 -1
- package/esm/index.js +16 -1
- package/esm/plugin/component/cashierApp.d.ts +3 -1
- package/esm/plugin/component/cashierApp.js +12 -5
- package/esm/plugin/component/channel.d.ts +2 -2
- package/esm/plugin/component/component.inline.style.d.ts +1 -1
- package/esm/plugin/component/component.inline.style.js +6 -4
- package/esm/plugin/component/index.d.ts +1 -0
- package/esm/plugin/component/index.js +106 -55
- package/esm/service/element.d.ts +4 -0
- package/esm/service/element.js +51 -0
- package/esm/service/index.d.ts +1 -0
- package/esm/service/index.js +2 -0
- package/esm/types/index.d.ts +194 -17
- package/esm/types/index.js +44 -4
- package/package.json +2 -1
package/esm/types/index.d.ts
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
6
6
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
7
7
|
*/
|
8
|
+
export * from '../core/component/element/type';
|
8
9
|
export type onChange = () => onCnageResult;
|
9
10
|
interface onCnageResult {
|
10
11
|
complete: boolean;
|
@@ -100,6 +101,10 @@ export interface DeviceIdParameter {
|
|
100
101
|
export interface IcreateComponent {
|
101
102
|
sessionData: string;
|
102
103
|
paymentSessionData?: string;
|
104
|
+
debugProps?: {
|
105
|
+
localLink: string;
|
106
|
+
};
|
107
|
+
appendAliasContainerId?: boolean;
|
103
108
|
notRedirectAfterComplete?: boolean;
|
104
109
|
appearance?: {
|
105
110
|
[x: string]: any;
|
@@ -658,24 +663,197 @@ export type IAppendParams = {
|
|
658
663
|
componentSign: ComponentSignEnum;
|
659
664
|
iframeNodesParams: IappendIframeNodesParams;
|
660
665
|
};
|
661
|
-
export declare enum
|
662
|
-
|
663
|
-
|
666
|
+
export declare enum AccountStatusEnum {
|
667
|
+
EFFECTIVE = "EFFECTIVE",
|
668
|
+
UNREGISTERED = "UNREGISTERED"
|
669
|
+
}
|
670
|
+
export type IAccountInfo = {
|
671
|
+
email?: string;
|
672
|
+
verifyId?: string;
|
673
|
+
accountStatus?: AccountStatusEnum;
|
674
|
+
oneAccountId?: string;
|
675
|
+
needOtp?: boolean;
|
676
|
+
errorMsg?: string;
|
677
|
+
inputStatus?: 'success' | 'loading' | 'error' | 'focused' | '';
|
678
|
+
resendLeftTimes?: number;
|
679
|
+
};
|
680
|
+
export interface AccountQueryRequest {
|
681
|
+
paymentSessionData: string;
|
682
|
+
paymentSessionConfig: any;
|
683
|
+
accountInfo: IAccountInfo;
|
664
684
|
}
|
665
|
-
export interface
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
685
|
+
export interface ShippingsItem {
|
686
|
+
shippingName: {
|
687
|
+
firstName: string;
|
688
|
+
lastName: string;
|
689
|
+
};
|
690
|
+
prefer: '1' | '0';
|
691
|
+
shippingId: string;
|
692
|
+
shippingPhoneNo: string;
|
693
|
+
shippingAddress: {
|
694
|
+
region: string;
|
695
|
+
state: string;
|
696
|
+
city: string;
|
697
|
+
address1: string;
|
698
|
+
address2: string;
|
699
|
+
zipCode: string;
|
700
|
+
};
|
701
|
+
}
|
702
|
+
export interface ISubPaymentElementView {
|
703
|
+
defaultText: string;
|
704
|
+
defaultValue: string;
|
705
|
+
elementMandatory: boolean;
|
706
|
+
elementRegx?: string;
|
707
|
+
elementType: string;
|
708
|
+
extendInfo: string;
|
709
|
+
paramIllegalText: string;
|
710
|
+
paymentElementKey: string;
|
711
|
+
title: string;
|
712
|
+
validateFunction?: string;
|
713
|
+
isPart?: boolean;
|
714
|
+
isPartEnd?: boolean;
|
715
|
+
}
|
716
|
+
export interface IPaymentElement {
|
717
|
+
defaultValue: string;
|
718
|
+
elementMandatory: boolean;
|
719
|
+
elementType: string;
|
720
|
+
extendInfo: string;
|
721
|
+
paymentElementKey: string;
|
722
|
+
subPaymentElementView: ISubPaymentElementView[];
|
723
|
+
title: string;
|
724
|
+
}
|
725
|
+
export declare enum InterActionTypeEnum {
|
726
|
+
COLLECT_REDIRECT = "COLLECT_REDIRECT",
|
727
|
+
SHOW_CODE = "SHOW_CODE",
|
728
|
+
COLLECT_SHOW_CODE = "COLLECT_SHOW_CODE",
|
729
|
+
REDIRECT = "REDIRECT"
|
730
|
+
}
|
731
|
+
export interface IAmount {
|
732
|
+
amount?: string;
|
733
|
+
currency: string;
|
734
|
+
currencyLabel: string;
|
735
|
+
formattedAmount?: string;
|
736
|
+
formattedAmountWithCurrency?: string;
|
737
|
+
value: string;
|
738
|
+
}
|
739
|
+
export interface IAmountView {
|
740
|
+
currency: string;
|
741
|
+
currencyDivider: string;
|
742
|
+
currencyLabel: string;
|
743
|
+
currencySymbolPosition: 'L' | 'R';
|
744
|
+
formattedValue: string;
|
745
|
+
value: string;
|
746
|
+
}
|
747
|
+
export interface IPaymentMethod {
|
748
|
+
paymentMethodKey?: string;
|
749
|
+
antomPage?: string;
|
750
|
+
redirectUrl?: string;
|
751
|
+
icon?: string;
|
752
|
+
iconName?: string;
|
753
|
+
logoList?: Array<{
|
754
|
+
cardBrand: string;
|
755
|
+
logoUrl: string;
|
756
|
+
}>;
|
757
|
+
paymentMethod?: string;
|
758
|
+
paymentMethodName: string;
|
759
|
+
paymentMethodType: string;
|
760
|
+
category?: string;
|
761
|
+
paymentElements?: IPaymentElement[];
|
762
|
+
paymentMethodId?: string;
|
763
|
+
paymentMethodDetail?: {
|
764
|
+
last4?: string;
|
765
|
+
requireIssuerAuthentication?: string;
|
678
766
|
};
|
767
|
+
interActionType?: InterActionTypeEnum;
|
768
|
+
recommend?: boolean;
|
769
|
+
expressCheckout?: boolean;
|
770
|
+
webRedirectType?: string;
|
771
|
+
paymentCurrencyList?: string[];
|
772
|
+
paymentAmount?: IAmount;
|
773
|
+
paymentAmountView?: IAmountView;
|
774
|
+
paymentQuoteId?: string;
|
775
|
+
}
|
776
|
+
interface Estimate {
|
777
|
+
unit: string;
|
778
|
+
value: number;
|
779
|
+
}
|
780
|
+
interface DeliveryEstimate {
|
781
|
+
maximum: Estimate;
|
782
|
+
minimum: Estimate;
|
783
|
+
}
|
784
|
+
interface FixedAmount {
|
785
|
+
amount: number;
|
786
|
+
currency: string;
|
787
|
+
}
|
788
|
+
interface ShippingRateData {
|
789
|
+
displayName: string;
|
790
|
+
deliveryEstimate: DeliveryEstimate;
|
791
|
+
fixedAmount: FixedAmount;
|
792
|
+
}
|
793
|
+
export interface ShippingAddress {
|
794
|
+
address1: string;
|
795
|
+
address2: string;
|
796
|
+
city: string;
|
797
|
+
region: string;
|
798
|
+
state: string;
|
799
|
+
zipCode: string;
|
800
|
+
}
|
801
|
+
export interface IUserName {
|
802
|
+
firstName: string;
|
803
|
+
middleName?: string;
|
804
|
+
lastName: string;
|
805
|
+
fullName?: string;
|
806
|
+
}
|
807
|
+
export type Shippings = ShippingsItem[];
|
808
|
+
export type IPaymentMethods = IPaymentMethod[];
|
809
|
+
export interface CKPShipping {
|
810
|
+
shippingRateId?: string;
|
811
|
+
shippingRateData?: ShippingRateData;
|
812
|
+
shippingAddress: ShippingAddress;
|
813
|
+
shippingFee?: IAmount;
|
814
|
+
shippingFeeView?: IAmountView;
|
815
|
+
shippingDescription?: string;
|
816
|
+
deliveryEstimate?: DeliveryEstimate;
|
817
|
+
shippingFeeId?: string;
|
818
|
+
shippingName?: IUserName;
|
819
|
+
shippingPhoneNo?: string;
|
820
|
+
shipToEmail?: string;
|
821
|
+
notes?: string;
|
822
|
+
}
|
823
|
+
export interface AccountQueryResult {
|
824
|
+
accountInfo: IAccountInfo;
|
825
|
+
actionForm?: ActionForm;
|
826
|
+
paymentMethods: IPaymentMethods;
|
827
|
+
shippings: Shippings;
|
828
|
+
success: boolean;
|
829
|
+
errorCode?: string;
|
830
|
+
errorMessage?: string;
|
831
|
+
errorStatus?: string;
|
832
|
+
shippingInfo?: CKPShipping;
|
833
|
+
}
|
834
|
+
export declare enum ElementPaymentMethod {
|
835
|
+
CONTAINER_ELEMENT = "CONTAINER_ELEMENT",
|
836
|
+
AUTH_ELEMENT = "AUTH_ELEMENT",
|
837
|
+
ADDRESS_ELEMENT = "ADDRESS_ELEMENT",
|
838
|
+
PAYMENT_ELEMENT = "PAYMENT_ELEMENT"
|
839
|
+
}
|
840
|
+
export declare enum ElementPaymentEvent {
|
841
|
+
INITIAL_DATA_READY = "initialDataReady",
|
842
|
+
CAPTURE_ASSET = "onCaptureAsset",
|
843
|
+
SIGN_OUT = "onSignout",
|
844
|
+
BLUR = "onBlur",
|
845
|
+
VALIDATE = "validate",
|
846
|
+
SUBMIT_RISK = "onSubmitRisk",
|
847
|
+
AFTER_SUBMIT = "onAfterSubmit",
|
848
|
+
SIZE_CHANGE = "onSizeChange",
|
849
|
+
LAUNCH = "onLaunch",
|
850
|
+
CALLBACK = "callback",
|
851
|
+
LOG = "log"
|
852
|
+
}
|
853
|
+
export declare enum ConnectErrorCode {
|
854
|
+
RISK_REJECT = "RISK_REJECT",
|
855
|
+
USER_AUTH_VERIFICATION_FAILED = "USER_AUTH_VERIFICATION_FAILED",
|
856
|
+
USER_NOT_EXISTS = "USER_NOT_EXISTS"
|
679
857
|
}
|
680
858
|
export interface IoptionsAddressParams {
|
681
859
|
environment?: string;
|
@@ -687,4 +865,3 @@ export interface IoptionsAddressParams {
|
|
687
865
|
};
|
688
866
|
product?: string;
|
689
867
|
}
|
690
|
-
export {};
|
package/esm/types/index.js
CHANGED
@@ -6,6 +6,7 @@
|
|
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
8
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
9
|
+
export * from "../core/component/element/type";
|
9
10
|
|
10
11
|
/**
|
11
12
|
* SDK options
|
@@ -209,8 +210,47 @@ export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
|
|
209
210
|
ProductSceneVersion["V2"] = "2.0";
|
210
211
|
return ProductSceneVersion;
|
211
212
|
}({});
|
212
|
-
export var
|
213
|
-
|
214
|
-
|
215
|
-
return
|
213
|
+
export var AccountStatusEnum = /*#__PURE__*/function (AccountStatusEnum) {
|
214
|
+
AccountStatusEnum["EFFECTIVE"] = "EFFECTIVE";
|
215
|
+
AccountStatusEnum["UNREGISTERED"] = "UNREGISTERED";
|
216
|
+
return AccountStatusEnum;
|
217
|
+
}({});
|
218
|
+
|
219
|
+
// element 接口start
|
220
|
+
|
221
|
+
export var InterActionTypeEnum = /*#__PURE__*/function (InterActionTypeEnum) {
|
222
|
+
InterActionTypeEnum["COLLECT_REDIRECT"] = "COLLECT_REDIRECT";
|
223
|
+
InterActionTypeEnum["SHOW_CODE"] = "SHOW_CODE";
|
224
|
+
InterActionTypeEnum["COLLECT_SHOW_CODE"] = "COLLECT_SHOW_CODE";
|
225
|
+
InterActionTypeEnum["REDIRECT"] = "REDIRECT";
|
226
|
+
return InterActionTypeEnum;
|
227
|
+
}({});
|
228
|
+
// element 接口end
|
229
|
+
|
230
|
+
export var ElementPaymentMethod = /*#__PURE__*/function (ElementPaymentMethod) {
|
231
|
+
ElementPaymentMethod["CONTAINER_ELEMENT"] = "CONTAINER_ELEMENT";
|
232
|
+
ElementPaymentMethod["AUTH_ELEMENT"] = "AUTH_ELEMENT";
|
233
|
+
ElementPaymentMethod["ADDRESS_ELEMENT"] = "ADDRESS_ELEMENT";
|
234
|
+
ElementPaymentMethod["PAYMENT_ELEMENT"] = "PAYMENT_ELEMENT";
|
235
|
+
return ElementPaymentMethod;
|
236
|
+
}({});
|
237
|
+
export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
|
238
|
+
ElementPaymentEvent["INITIAL_DATA_READY"] = "initialDataReady";
|
239
|
+
ElementPaymentEvent["CAPTURE_ASSET"] = "onCaptureAsset";
|
240
|
+
ElementPaymentEvent["SIGN_OUT"] = "onSignout";
|
241
|
+
ElementPaymentEvent["BLUR"] = "onBlur";
|
242
|
+
ElementPaymentEvent["VALIDATE"] = "validate";
|
243
|
+
ElementPaymentEvent["SUBMIT_RISK"] = "onSubmitRisk";
|
244
|
+
ElementPaymentEvent["AFTER_SUBMIT"] = "onAfterSubmit";
|
245
|
+
ElementPaymentEvent["SIZE_CHANGE"] = "onSizeChange";
|
246
|
+
ElementPaymentEvent["LAUNCH"] = "onLaunch";
|
247
|
+
ElementPaymentEvent["CALLBACK"] = "callback";
|
248
|
+
ElementPaymentEvent["LOG"] = "log";
|
249
|
+
return ElementPaymentEvent;
|
250
|
+
}({});
|
251
|
+
export var ConnectErrorCode = /*#__PURE__*/function (ConnectErrorCode) {
|
252
|
+
ConnectErrorCode["RISK_REJECT"] = "RISK_REJECT";
|
253
|
+
ConnectErrorCode["USER_AUTH_VERIFICATION_FAILED"] = "USER_AUTH_VERIFICATION_FAILED";
|
254
|
+
ConnectErrorCode["USER_NOT_EXISTS"] = "USER_NOT_EXISTS";
|
255
|
+
return ConnectErrorCode;
|
216
256
|
}({});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@alipay/ams-checkout",
|
3
|
-
"version": "0.0.1730107332-dev.
|
3
|
+
"version": "0.0.1730107332-dev.34",
|
4
4
|
"description": "",
|
5
5
|
"author": "",
|
6
6
|
"main": "esm/index.js",
|
@@ -15,6 +15,7 @@
|
|
15
15
|
],
|
16
16
|
"scripts": {
|
17
17
|
"build": "father build",
|
18
|
+
"build:w": "father dev",
|
18
19
|
"dev": "father dev",
|
19
20
|
"ci": "npm run lint",
|
20
21
|
"cov": "jest --coverage",
|