-
Notifications
You must be signed in to change notification settings - Fork 13
/
node-nestpay.d.ts
105 lines (88 loc) · 2.68 KB
/
node-nestpay.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
/**
* @author Tümay Çeber <[email protected]>
* @date 08.04.2018
*/
export type endpoint = "test" | "asseco" | "isbank" | "akbank" | "finansbank" | "denizbank" | "kuveytturk" | "halkbank" | "anadolubank" | "hsbc" | "ziraatbank" | "ingbank" | "citibank" | "teb";
export interface INestPayConfiguration {
name: string;
password: string;
clientId: number;
mode?: "P" | "T";
currency?: string;
orderId?: string;
secureFormat?: string;
endpoint?: endpoint;
lang?: string;
}
export interface INestPayConfiguration3d extends INestPayConfiguration {
storekey: string;
callbackSuccess?: string;
callbackFail?: string;
}
interface INestPaymentRequestMinimal {
number: string;
year: string;
month: string;
cvv: string;
amount: string;
}
export interface INestPaymentRequest extends INestPaymentRequestMinimal {
installment?: number;
orderId?: string;
groupId?: string;
transId?: string;
}
export interface INestSecure3dRequest extends INestPaymentRequestMinimal {
orderId?: string;
lang?: string;
timestamp?: string;
secureFormat?: string;
storekey?: string;
callbackSuccess?: string;
callbackFail?: string;
}
export interface INestSecure3dRequestReturn {
form: {
clientId: string,
oid: string,
amount: string,
okUrl: string,
failUrl: string,
rnd: string,
currency: string,
pan: string,
Ecom_Payment_Card_ExpDate_Year: string,
Ecom_Payment_Card_ExpDate_Month: string,
cv2: string,
storetype: '3d',
lang: string,
hash: string,
};
url: string;
}
export interface INestSecure3dPurchaseRequest {
HASHPARAMSVAL: string;
HASH: string;
md: string;
xid: string;
eci: string;
cavv: string;
amount: string;
installment?: number;
orderId?: string;
groupId?: string;
transId?: string;
userId?: string;
}
export default class NestPay {
constructor(options: INestPayConfiguration | INestPayConfiguration3d);
public authorize(options: INestPaymentRequest): Promise<any>;
public capture(options: { orderId: string }): Promise<any>;
public purchase(options: INestPaymentRequest): Promise<any>;
public refund(options: { amount: number, orderId: string }): Promise<any>;
public request(url: any, data: any): Promise<any>;
public secure3d(options: INestSecure3dRequest): Promise<INestSecure3dRequestReturn | string>;
public secureAuthorize(options: INestSecure3dPurchaseRequest): Promise<any>;
public securePurchase(options: INestSecure3dPurchaseRequest): Promise<any>;
public void(options: { orderId: string }): Promise<any>;
}