-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.d.ts
395 lines (395 loc) · 11.6 KB
/
common.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
import { Property, View } from '@nativescript/core';
export declare class CreditCardViewBase extends View {
static numberChangedEvent: string;
static expMonthChangedEvent: string;
static expYearChangedEvent: string;
static cvcChangedEvent: string;
static postalCodeChangedEvent: string;
showPostalCode: boolean;
isUSZipRequired: boolean;
}
export declare const showPostalCodeProperty: Property<CreditCardViewBase, boolean>;
export declare const isUSZipRequiredProperty: Property<CreditCardViewBase, boolean>;
export declare class CardMultilineWidgetBase extends CreditCardViewBase {
}
export declare function toPaymentMethodCardChecks(check: any): PaymentMethodCardCheckResult;
export declare function toPaymentMethodCardWalletType(type: any): PaymentMethodCardWalletType;
export declare function toCardFundingType(type: any): CardFundingType;
export declare function toSourceCard3DSecureStatus(status: any): SourceCard3DSecureStatus;
export declare function toSourceVerificationStatus(status: any): SourceVerificationStatus;
export declare function toSourceRedirectStatus(redirectStatus: any): SourceRedirectStatus;
export declare function toSourceType(type: any): SourceType;
export declare function toSourceUsage(usage: any): SourceUsage;
export declare function toSourceFlow(flow: any): SourceFlow;
export declare function toSourceStatus(status: any): SourceStatus;
export declare enum PaymentMethodCardCheckResult {
Pass = "pass",
Failed = "failed",
Unavailable = "unavailable",
Unchecked = "unchecked",
Unknown = "unknown"
}
export interface IPaymentMethodCardChecks {
readonly addressLine1Check: PaymentMethodCardCheckResult;
readonly addressPostalCodeCheck: PaymentMethodCardCheckResult;
readonly cvcCheck: PaymentMethodCardCheckResult;
}
export interface IPaymentMethodCardNetworks {
readonly available: string[];
readonly preferred: string;
}
export interface IPaymentMethodThreeDSecureUsage {
readonly supported: boolean;
}
export interface IPaymentMethodAddress {
readonly city: string;
readonly country: string;
readonly line1: string;
readonly line2: string;
readonly postalCode: string;
readonly state: string;
}
export interface IPaymentMethodCardWalletMasterpass {
readonly billingAddress: IPaymentMethodAddress;
readonly email: string;
readonly name: string;
readonly shippingAddress: IPaymentMethodAddress;
}
export declare enum PaymentMethodCardWalletType {
AmexExpressCheckout = "amexExpressCheckout",
ApplePay = "applePay",
GooglePay = "googlePay",
Masterpass = "masterpass",
SamsungPay = "samsungPay",
VisaCheckout = "visaCheckout",
Unknown = "unknown"
}
export interface IPaymentMethodCardWalletVisaCheckout {
readonly billingAddress: IPaymentMethodAddress;
readonly email: string;
readonly name: string;
readonly shippingAddress: IPaymentMethodAddress;
readonly dynamicLast4: string;
}
export interface IPaymentMethodCardWalletAmexExpressCheckout {
readonly dynamicLast4: string;
}
export interface IPaymentMethodCardWalletApplePay {
readonly dynamicLast4: string;
}
export interface IPaymentMethodCardWalletGooglePay {
readonly dynamicLast4: string;
}
export interface IPaymentMethodCardWalletSamsungPay {
readonly dynamicLast4: string;
}
export interface IPaymentMethodCardWallet {
readonly masterpass: IPaymentMethodCardWalletMasterpass;
readonly type: PaymentMethodCardWalletType;
readonly visaCheckout: IPaymentMethodCardWalletVisaCheckout;
}
export interface IPaymentMethodCard {
readonly brand: CardBrand;
readonly checks: IPaymentMethodCardChecks;
readonly country: string;
readonly expMonth: number;
readonly expYear: number;
readonly fingerprint: string;
readonly funding: string;
readonly last4: string;
readonly networks: IPaymentMethodCardNetworks;
readonly threeDSecureUsage: IPaymentMethodThreeDSecureUsage;
readonly wallet: IPaymentMethodCardWallet;
}
export interface IAddress {
city: string;
country: string;
email: string;
line1: string;
line2: string;
name: string;
phone: string;
postalCode: string;
state: string;
readonly ios: any;
readonly android: any;
}
export declare function GetBrand(brand: any): CardBrand;
export declare enum CardBrand {
AmericanExpress = "amex",
Discover = "discover",
JCB = "jcb",
DinersClub = "diners",
Visa = "visa",
MasterCard = "mastercard",
UnionPay = "unionpay",
Unknown = "unknown"
}
export declare enum CardFunding {
Credit = "credit",
Debit = "debit",
Prepaid = "prepaid",
Unknown = "unknown"
}
export declare enum PaymentMethodType {
Card = "card",
CardPresent = "cardPresent",
Fpx = "fpx",
Ideal = "ideal",
SepaDebit = "sepaDebit",
AuBecsDebit = "auBecsDebit",
BacsDebit = "bacsDebit",
Sofort = "sofort",
P24 = "p24",
Bancontact = "bancontact",
Giropay = "giropay",
Eps = "eps",
Oxxo = "oxxo",
Alipay = "alipay",
GrabPay = "grabPay",
PayPal = "payPal",
Unknown = "unknown"
}
export declare enum CaptureMethod {
Automatic = "automatic",
Manual = "manual"
}
export interface ICard {
readonly native: any;
readonly brand: CardBrand;
readonly name: string;
readonly address: IAddress;
readonly currency: string;
readonly last4: string;
readonly dynamicLast4: string;
readonly fingerprint: string;
readonly funding: CardFunding;
readonly country: string;
}
export interface ICardParams {
readonly native: any;
name: string;
currency: string;
address: IAddress;
number: string;
expMonth: number;
expYear: number;
cvc: string;
}
export interface IToken {
id: string;
bankAccount: IBankAccount;
card: ICard;
created: Date;
ios: any;
android: any;
liveMode: boolean;
}
export declare enum SourceFlow {
Redirect = "redirect",
Receiver = "receiver",
CodeVerification = "codeVerification",
None = "none"
}
export declare enum SourceStatus {
Canceled = "canceled",
Chargeable = "chargeable",
Consumed = "consumed",
Failed = "failed",
Pending = "pending"
}
export declare enum CardFundingType {
Debit = "debit",
Credit = "credit",
Prepaid = "prepaid",
Other = "other"
}
export declare enum SourceCard3DSecureStatus {
Required = "required",
Optional = "optional",
NotSupported = "notSupported",
Recommended = "recommended",
Unknown = "unknown"
}
export interface ISourceCardDetails {
readonly brand: CardBrand;
readonly country: string;
readonly expMonth: number;
readonly expYear: number;
readonly funding: CardFundingType;
readonly isApplePayCard: boolean;
readonly last4: string;
readonly threeDSecureUsage: SourceCard3DSecureStatus;
readonly android: any;
readonly ios: any;
readonly dynamicLast4: string;
}
export interface ISourceKlarnaDetails {
readonly clientToken: string;
readonly purchaseCountry: string;
}
export interface ISourceOwner {
readonly address: IAddress;
readonly email: string;
readonly name: string;
readonly phone: string;
readonly verifiedAddress: IAddress;
readonly verifiedEmail: string;
readonly verifiedName: string;
readonly verifiedPhone: string;
}
export interface ISourceReceiver {
readonly address: string;
readonly amountCharged: number;
readonly amountReceived: number;
readonly amountReturned: number;
readonly apiResponse: Readonly<{}>;
}
export declare enum SourceRedirectStatus {
Pending = "pending",
Succeeded = "succeeded",
Failed = "failed",
NotRequired = "notRequired",
Unknown = "unknown"
}
export interface ISourceRedirect {
readonly returnURL: string;
readonly status: SourceRedirectStatus;
readonly url: string;
readonly apiResponse: Readonly<{}>;
readonly ios: any;
readonly android: any;
}
export interface ISourceSEPADebitDetails {
readonly bankCode: string;
readonly country: string;
readonly fingerprint: string;
readonly last4: string;
readonly mandateReference: string;
readonly mandateURL: string;
readonly apiResponse: Readonly<{}>;
readonly ios: any;
readonly android: any;
}
export declare enum SourceType {
Bancontact = "bancontact",
Card = "card",
Giropay = "giropay",
IDEAL = "ideal",
SEPADebit = "sepaDebit",
Sofort = "sofor",
ThreeDSecure = "threeDSecure",
Alipay = "alipay",
P24 = "p24",
EPS = "eps",
Multibanco = "multibanco",
WeChatPay = "wechatPay",
Klarna = "klarna",
Unknown = "unknown"
}
export declare enum SourceUsage {
Reusable = "reusable",
SingleUse = "singleUser",
Unknown = "unknown"
}
export declare enum SourceVerificationStatus {
Pending = "pending",
Succeeded = "succeeded",
Failed = "failed",
Unknown = "unknown"
}
export interface ISourceVerification {
readonly attemptsRemaining: number;
readonly status: SourceVerificationStatus;
readonly apiResponse: Readonly<{}>;
}
export interface ISourceWeChatPayDetails {
readonly weChatAppURL: string;
readonly apiResponse: Readonly<{}>;
}
export interface ISource {
/**in pennies*/
readonly amount: number;
readonly cardDetails: ISourceCardDetails;
readonly clientSecret?: string;
readonly created: Date;
readonly currency?: string;
readonly details: Readonly<{}>;
readonly flow: SourceFlow;
readonly klarnaDetails: ISourceKlarnaDetails;
readonly metaData: Readonly<{}>;
readonly owner: ISourceOwner;
readonly receiver: ISourceReceiver;
readonly redirect: ISourceRedirect;
readonly sepaDebitDetails: ISourceSEPADebitDetails;
readonly type: SourceType;
readonly usage: SourceUsage;
readonly verification: ISourceVerification;
readonly weChatPayDetails: ISourceWeChatPayDetails;
readonly apiResponse: Readonly<{}>;
readonly id: string;
readonly liveMode: boolean;
readonly status: SourceStatus;
readonly android: any;
readonly ios: any;
}
export interface IPaymentMethod {
readonly native: any;
id: string;
created: Date;
type: PaymentMethodType;
billingDetails: object;
card: IPaymentMethodCard;
customerId: string;
metadata: object;
}
export interface IStripePaymentIntent {
readonly native: any;
id: string;
clientSecret: string;
amount: number;
captureMethod: 'manual' | 'automatic';
created: Date;
currency: string;
description: string;
requiresAction: boolean;
status: StripePaymentIntentStatus;
}
export declare const enum StripePaymentIntentStatus {
RequiresPaymentMethod = "requires_payment_method",
RequiresConfirmation = "requires_confirmation",
RequiresAction = "requires_action",
Processing = "processing",
Succeeded = "succeeded",
RequiresCapture = "requires_capture",
Canceled = "canceled"
}
export declare const enum StripeRedirectState {
NotStarted = 0,
InProgress = 1,
Cancelled = 2,
Completed = 3
}
export declare enum BankAccountHolderType {
Individual = "individual",
Company = "company"
}
export declare enum BankAccountStatus {
New = "new",
Validated = "validated",
Verified = "verified",
VerificationFailed = "verificationFailed",
Errored = "errored"
}
export interface IBankAccount {
readonly accountHolderName: string;
readonly accountHolderType: BankAccountHolderType;
readonly bankName: string;
readonly country: string;
readonly currency: string;
readonly fingerprint: string;
readonly last4: string;
readonly metadata: Readonly<{}>;
readonly routingNumber: string;
readonly status: BankAccountStatus;
}