@tonder.io/ionic-full-sdk 0.0.62-beta.DEV-2106.1 → 0.0.62-beta.DEV-2106.b837b8f
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/README.md +39 -4
- package/dist/classes/3dsHandler.d.ts +39 -0
- package/dist/classes/checkout.d.ts +31 -0
- package/dist/index.js +1 -1
- package/dist/shared/enums/ErrorKeyEnum.d.ts +2 -1
- package/dist/shared/utils/appError.d.ts +15 -4
- package/dist/types/inlineCheckout.d.ts +0 -1
- package/package.json +2 -2
- package/rollup.config.js +2 -1
- package/src/classes/inlineCheckout.ts +25 -34
- package/src/shared/constants/messages.ts +2 -0
- package/src/shared/enums/ErrorKeyEnum.ts +1 -0
- package/src/shared/utils/appError.ts +220 -47
- package/src/types/inlineCheckout.ts +0 -2
- package/dist/helpers/card_on_file.d.ts +0 -177
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
export interface AcquirerInstance {
|
|
2
|
-
requestSecureInit: (params: SecureInitParams, callback: (response: SecureInitResponse | AcquirerErrorResponse) => void) => void;
|
|
3
|
-
requestValidate3DS: (params: Validate3DSParams, callback: (response: Validate3DSResponse | AcquirerErrorResponse) => void) => void;
|
|
4
|
-
}
|
|
5
|
-
export interface SecureInitParams {
|
|
6
|
-
card: {
|
|
7
|
-
number: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export interface SecureInitResponse {
|
|
11
|
-
jwt: string;
|
|
12
|
-
}
|
|
13
|
-
export interface Validate3DSParams {
|
|
14
|
-
secureId: string;
|
|
15
|
-
security: SecurityInfo;
|
|
16
|
-
}
|
|
17
|
-
export interface Validate3DSResponse {
|
|
18
|
-
code?: string;
|
|
19
|
-
message?: string;
|
|
20
|
-
isValid?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface AcquirerErrorResponse {
|
|
23
|
-
code: string;
|
|
24
|
-
message: string;
|
|
25
|
-
}
|
|
26
|
-
export interface SecurityInfo {
|
|
27
|
-
acsURL: string;
|
|
28
|
-
authenticationTransactionId: string;
|
|
29
|
-
authRequired: boolean;
|
|
30
|
-
paReq: string;
|
|
31
|
-
specificationVersion: string;
|
|
32
|
-
}
|
|
33
|
-
export interface CardOnFileTokenRequest {
|
|
34
|
-
card: {
|
|
35
|
-
name: string;
|
|
36
|
-
number: string;
|
|
37
|
-
expiryMonth: string;
|
|
38
|
-
expiryYear: string;
|
|
39
|
-
cvv: string;
|
|
40
|
-
};
|
|
41
|
-
currency: string;
|
|
42
|
-
jwt: string;
|
|
43
|
-
}
|
|
44
|
-
export interface CardOnFileTokenResponse {
|
|
45
|
-
token: string;
|
|
46
|
-
secureId?: string;
|
|
47
|
-
secureService?: string;
|
|
48
|
-
security?: SecurityInfo;
|
|
49
|
-
details?: {
|
|
50
|
-
secureId?: string;
|
|
51
|
-
security?: SecurityInfo;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export interface CardOnFileSubscriptionRequest {
|
|
55
|
-
token: string;
|
|
56
|
-
contactDetails: {
|
|
57
|
-
firstName: string;
|
|
58
|
-
lastName: string;
|
|
59
|
-
email: string;
|
|
60
|
-
};
|
|
61
|
-
metadata: {
|
|
62
|
-
customerId: string;
|
|
63
|
-
notes?: string;
|
|
64
|
-
};
|
|
65
|
-
currency: string;
|
|
66
|
-
}
|
|
67
|
-
export interface CardOnFileSubscriptionResponse {
|
|
68
|
-
details: {
|
|
69
|
-
amount: {
|
|
70
|
-
subtotalIva: number;
|
|
71
|
-
subtotalIva0: number;
|
|
72
|
-
ice: number;
|
|
73
|
-
iva: number;
|
|
74
|
-
currency: string;
|
|
75
|
-
};
|
|
76
|
-
binCard: string;
|
|
77
|
-
binInfo: {
|
|
78
|
-
bank: string;
|
|
79
|
-
type: string;
|
|
80
|
-
};
|
|
81
|
-
cardHolderName: string;
|
|
82
|
-
contactDetails: {
|
|
83
|
-
firstName: string;
|
|
84
|
-
lastName: string;
|
|
85
|
-
email: string;
|
|
86
|
-
};
|
|
87
|
-
created: string;
|
|
88
|
-
lastFourDigits: string;
|
|
89
|
-
maskedCreditCard: string;
|
|
90
|
-
merchantId: string;
|
|
91
|
-
merchantName: string;
|
|
92
|
-
paymentBrand: string;
|
|
93
|
-
periodicity: string;
|
|
94
|
-
planName: string;
|
|
95
|
-
processorBankName: string;
|
|
96
|
-
startDate: string;
|
|
97
|
-
};
|
|
98
|
-
subscriptionId: string;
|
|
99
|
-
}
|
|
100
|
-
export interface SkyflowCollectFields {
|
|
101
|
-
card_number: string;
|
|
102
|
-
cvv: string;
|
|
103
|
-
expiration_month: string;
|
|
104
|
-
expiration_year: string;
|
|
105
|
-
cardholder_name: string;
|
|
106
|
-
skyflow_id: string;
|
|
107
|
-
[key: string]: string;
|
|
108
|
-
}
|
|
109
|
-
export interface SkyflowCollectRecord {
|
|
110
|
-
fields: SkyflowCollectFields;
|
|
111
|
-
}
|
|
112
|
-
export interface SkyflowCollectResponse {
|
|
113
|
-
records?: SkyflowCollectRecord[];
|
|
114
|
-
}
|
|
115
|
-
export interface CardTokens {
|
|
116
|
-
name: string;
|
|
117
|
-
number: string;
|
|
118
|
-
expiryMonth: string;
|
|
119
|
-
expiryYear: string;
|
|
120
|
-
cvv: string;
|
|
121
|
-
}
|
|
122
|
-
export interface ContactDetails {
|
|
123
|
-
firstName: string;
|
|
124
|
-
lastName: string;
|
|
125
|
-
email: string;
|
|
126
|
-
}
|
|
127
|
-
export interface ProcessParams {
|
|
128
|
-
cardTokens: CardTokens;
|
|
129
|
-
cardBin: string;
|
|
130
|
-
contactDetails: ContactDetails;
|
|
131
|
-
customerId: string;
|
|
132
|
-
currency: string;
|
|
133
|
-
}
|
|
134
|
-
declare global {
|
|
135
|
-
interface Window {
|
|
136
|
-
Kushki: new (config: {
|
|
137
|
-
merchantId: string;
|
|
138
|
-
inTestEnvironment: boolean;
|
|
139
|
-
}) => AcquirerInstance;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
export declare class CardOnFile {
|
|
143
|
-
private readonly apiUrl;
|
|
144
|
-
private readonly merchantId;
|
|
145
|
-
private readonly apiKey;
|
|
146
|
-
private readonly isTestEnvironment;
|
|
147
|
-
private acquirerInstance;
|
|
148
|
-
constructor(config: {
|
|
149
|
-
merchantId: string;
|
|
150
|
-
apiKey: string;
|
|
151
|
-
isTestEnvironment?: boolean;
|
|
152
|
-
});
|
|
153
|
-
initialize(): Promise<void>;
|
|
154
|
-
private getAcquirerInstance;
|
|
155
|
-
/**
|
|
156
|
-
* Get JWT for 3DS authentication
|
|
157
|
-
* @param cardBin - First 8 digits of the card number
|
|
158
|
-
*/
|
|
159
|
-
getJwt(cardBin: string): Promise<string>;
|
|
160
|
-
/**
|
|
161
|
-
* Generate a recurring charge token
|
|
162
|
-
*/
|
|
163
|
-
generateToken(request: CardOnFileTokenRequest): Promise<CardOnFileTokenResponse>;
|
|
164
|
-
/**
|
|
165
|
-
* Create a subscription with the generated token
|
|
166
|
-
*/
|
|
167
|
-
createSubscription(request: CardOnFileSubscriptionRequest): Promise<CardOnFileSubscriptionResponse>;
|
|
168
|
-
/**
|
|
169
|
-
* Validate 3DS challenge
|
|
170
|
-
* @returns true if validation passed, throws error otherwise
|
|
171
|
-
*/
|
|
172
|
-
validate3DS(secureId: string, security: SecurityInfo): Promise<boolean>;
|
|
173
|
-
/**
|
|
174
|
-
* Complete flow: JWT → Token → 3DS validation → Subscription
|
|
175
|
-
*/
|
|
176
|
-
process(params: ProcessParams): Promise<CardOnFileSubscriptionResponse>;
|
|
177
|
-
}
|