-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
72 lines (67 loc) · 1.52 KB
/
index.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
export namespace Shuttle {
export type PaymentAction = 'PAYMENT' | 'AUTH';
export type PaymentFrequency = 'ONEOFF' | 'WEEKLY' | 'FORTNIGHTLY' | 'BIMONTHLY' |
'MONTHLY' | 'QUARTERLY' | 'ANNUALLY'
export interface Address {
line1?: string;
line2?: string;
line3?: string;
line4?: string;
line5?: string;
line6?: string;
country?: string;
}
export interface CreateAccount {
crm_key?: string;
tag?: string;
first_name?: string;
last_name?: string;
company?: string;
email?: string;
phone?: string;
address?: Address;
}
export interface LineItem {
sku: string;
name: string;
quantity: string;
unit_price: string;
total_amount: string;
total_tax?: string;
item_url: string;
image_url: string;
}
export interface DoPaymentParams {
id?: string;
instance_key: string;
alt_key?: string;
amount: string;
currency: string;
title?: string;
checkout_text?: string;
force_add?: boolean;
disable_receipt?: boolean;
disable_redirect?: boolean;
disable_new_window?: boolean;
success_url?: string;
cancel_url?: string;
description?: string;
nonce?: string;
action?: PaymentAction;
account?: string | { id: string } | CreateAccount;
frequency?: PaymentFrequency;
occurrences?: number;
start_date?: string;
start_days?: number;
save_card?: boolean;
shipping?: Address;
line_items?: LineItem[];
}
export interface Shuttle {
bind(): never;
doPayment(options: DoPaymentParams, signature: string): never;
}
}
declare global {
const Shuttle: Shuttle.Shuttle;
}