forked from stripe/stripe-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mandates.d.ts
224 lines (170 loc) · 5.99 KB
/
Mandates.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
// File generated from our OpenAPI spec
declare module 'stripe' {
namespace Stripe {
/**
* A Mandate is a record of the permission a customer has given you to debit their payment method.
*/
interface Mandate {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'mandate';
customer_acceptance: Mandate.CustomerAcceptance;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
multi_use?: Mandate.MultiUse;
/**
* The account (if any) for which the mandate is intended.
*/
on_behalf_of?: string;
/**
* ID of the payment method associated with this mandate.
*/
payment_method: string | Stripe.PaymentMethod;
payment_method_details: Mandate.PaymentMethodDetails;
single_use?: Mandate.SingleUse;
/**
* The status of the mandate, which indicates whether it can be used to initiate a payment.
*/
status: Mandate.Status;
/**
* The type of the mandate.
*/
type: Mandate.Type;
}
namespace Mandate {
interface CustomerAcceptance {
/**
* The time at which the customer accepted the Mandate.
*/
accepted_at: number | null;
offline?: CustomerAcceptance.Offline;
online?: CustomerAcceptance.Online;
/**
* The type of customer acceptance information included with the Mandate. One of `online` or `offline`.
*/
type: CustomerAcceptance.Type;
}
namespace CustomerAcceptance {
interface Offline {}
interface Online {
/**
* The IP address from which the Mandate was accepted by the customer.
*/
ip_address: string | null;
/**
* The user agent of the browser from which the Mandate was accepted by the customer.
*/
user_agent: string | null;
}
type Type = 'offline' | 'online';
}
interface MultiUse {}
interface PaymentMethodDetails {
acss_debit?: PaymentMethodDetails.AcssDebit;
au_becs_debit?: PaymentMethodDetails.AuBecsDebit;
bacs_debit?: PaymentMethodDetails.BacsDebit;
card?: PaymentMethodDetails.Card;
cashapp?: PaymentMethodDetails.Cashapp;
link?: PaymentMethodDetails.Link;
paypal?: PaymentMethodDetails.Paypal;
sepa_debit?: PaymentMethodDetails.SepaDebit;
/**
* The type of the payment method associated with this mandate. An additional hash is included on `payment_method_details` with a name matching this value. It contains mandate information specific to the payment method.
*/
type: string;
us_bank_account?: PaymentMethodDetails.UsBankAccount;
}
namespace PaymentMethodDetails {
interface AcssDebit {
/**
* List of Stripe products where this mandate can be selected automatically.
*/
default_for?: Array<AcssDebit.DefaultFor>;
/**
* Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'.
*/
interval_description: string | null;
/**
* Payment schedule for the mandate.
*/
payment_schedule: AcssDebit.PaymentSchedule;
/**
* Transaction type of the mandate.
*/
transaction_type: AcssDebit.TransactionType;
}
namespace AcssDebit {
type DefaultFor = 'invoice' | 'subscription';
type PaymentSchedule = 'combined' | 'interval' | 'sporadic';
type TransactionType = 'business' | 'personal';
}
interface AuBecsDebit {
/**
* The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively.
*/
url: string;
}
interface BacsDebit {
/**
* The status of the mandate on the Bacs network. Can be one of `pending`, `revoked`, `refused`, or `accepted`.
*/
network_status: BacsDebit.NetworkStatus;
/**
* The unique reference identifying the mandate on the Bacs network.
*/
reference: string;
/**
* The URL that will contain the mandate that the customer has signed.
*/
url: string;
}
namespace BacsDebit {
type NetworkStatus = 'accepted' | 'pending' | 'refused' | 'revoked';
}
interface Card {}
interface Cashapp {}
interface Link {}
interface Paypal {
/**
* The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer.
*/
billing_agreement_id: string | null;
/**
* PayPal account PayerID. This identifier uniquely identifies the PayPal customer.
*/
payer_id?: string | null;
}
interface SepaDebit {
/**
* The unique reference of the mandate.
*/
reference: string;
/**
* The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively.
*/
url: string;
}
interface UsBankAccount {}
}
interface SingleUse {
/**
* On a single use mandate, the amount of the payment.
*/
amount: number;
/**
* On a single use mandate, the currency of the payment.
*/
currency: string;
}
type Status = 'active' | 'inactive' | 'pending';
type Type = 'multi_use' | 'single_use';
}
}
}