@cloudcommerce/types 0.0.35

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.
@@ -0,0 +1,261 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * Triggered when order is being closed, must create payment transaction and return info
10
+ */
11
+ export interface CreateTransactionResponse {
12
+ /**
13
+ * Created payment transaction object
14
+ */
15
+ transaction: {
16
+ /**
17
+ * Direct link to pay current transaction
18
+ */
19
+ payment_link?: string;
20
+ /**
21
+ * Additional text instructions for manual payments
22
+ */
23
+ payment_instructions?: string;
24
+ /**
25
+ * Transaction properties in the intermediator
26
+ */
27
+ intermediator?: {
28
+ /**
29
+ * Transaction ID in the intermediator
30
+ */
31
+ transaction_id?: string;
32
+ /**
33
+ * Transaction code in the intermediator
34
+ */
35
+ transaction_code?: string;
36
+ /**
37
+ * Transaction reference code
38
+ */
39
+ transaction_reference?: string;
40
+ /**
41
+ * Payment method as defined by intermediator
42
+ */
43
+ payment_method?: {
44
+ /**
45
+ * Payment method code
46
+ */
47
+ code: string;
48
+ /**
49
+ * Short description for payment method
50
+ */
51
+ name?: string;
52
+ };
53
+ /**
54
+ * ID of customer account in the intermediator
55
+ */
56
+ buyer_id?: string;
57
+ };
58
+ /**
59
+ * Credit card data, if payment was done with credit card
60
+ */
61
+ credit_card?: {
62
+ /**
63
+ * Full name of the holder, as it is on the credit card
64
+ */
65
+ holder_name?: string;
66
+ /**
67
+ * Response code from AVS: http://www.emsecommerce.net/avs_cvv2_response_codes.htm
68
+ */
69
+ avs_result_code?: string | null;
70
+ /**
71
+ * Response code from credit card company, such as AVS result code
72
+ */
73
+ cvv_result_code?: string | null;
74
+ /**
75
+ * Issuer identification number (IIN), known as bank identification number (BIN)
76
+ */
77
+ bin?: number;
78
+ /**
79
+ * Credit card issuer name, eg.: Visa, American Express, MasterCard
80
+ */
81
+ company?: string;
82
+ /**
83
+ * Last digits (up to 4) of credit card number
84
+ */
85
+ last_digits?: string;
86
+ /**
87
+ * Unique credit card token
88
+ */
89
+ token?: string;
90
+ /**
91
+ * Credit card processing standardized error code
92
+ */
93
+ error_code?:
94
+ | 'incorrect_number'
95
+ | 'invalid_number'
96
+ | 'invalid_expiry_date'
97
+ | 'invalid_cvc'
98
+ | 'expired_card'
99
+ | 'incorrect_cvc'
100
+ | 'incorrect_zip'
101
+ | 'incorrect_address'
102
+ | 'card_declined'
103
+ | 'processing_error'
104
+ | 'call_issuer'
105
+ | 'pick_up_card';
106
+ };
107
+ /**
108
+ * Banking billet data, if payment was done with banking billet
109
+ */
110
+ banking_billet?: {
111
+ /**
112
+ * Ticket code, generally a barcode number
113
+ */
114
+ code?: string;
115
+ /**
116
+ * Date and time of expiration, in ISO 8601 standard representation
117
+ */
118
+ valid_thru?: string;
119
+ /**
120
+ * Text lines on ticket
121
+ *
122
+ * @maxItems 5
123
+ */
124
+ text_lines?: string[];
125
+ /**
126
+ * Direct link (URI) to banking billet
127
+ */
128
+ link?: string;
129
+ };
130
+ /**
131
+ * If paid with loyalty points, specify how many points and what program was consumed
132
+ */
133
+ loyalty_points?: {
134
+ /**
135
+ * The name of the loyalty points program
136
+ */
137
+ name?: string;
138
+ /**
139
+ * Unique identifier, program name using only lowercase, numbers and underscore
140
+ */
141
+ program_id: string;
142
+ /**
143
+ * Number of loyalty points applied from customer account
144
+ */
145
+ points_value: number;
146
+ /**
147
+ * The ratio of a point when converted to currency
148
+ */
149
+ ratio?: number;
150
+ };
151
+ /**
152
+ * Currency ID specific for this transaction, if different of order currency ID
153
+ */
154
+ currency_id?: string;
155
+ /**
156
+ * Currency symbol specific for this transaction
157
+ */
158
+ currency_symbol?: string;
159
+ /**
160
+ * Discount by payment method, negative if value was additionated (not discounted)
161
+ */
162
+ discount?: number;
163
+ /**
164
+ * Transaction amount, disregarding installment rates
165
+ */
166
+ amount: number;
167
+ /**
168
+ * Installments option
169
+ */
170
+ installments?: {
171
+ /**
172
+ * Number of installments
173
+ */
174
+ number: number;
175
+ /**
176
+ * Installment value
177
+ */
178
+ value?: number;
179
+ /**
180
+ * Tax applied
181
+ */
182
+ tax?: boolean;
183
+ /**
184
+ * Total value, sum of all plots
185
+ */
186
+ total?: number;
187
+ };
188
+ /**
189
+ * Cost data collected
190
+ */
191
+ creditor_fees?: {
192
+ /**
193
+ * Installment fee
194
+ */
195
+ installment?: number;
196
+ /**
197
+ * Operation fee
198
+ */
199
+ operational?: number;
200
+ /**
201
+ * Intermediation fee, if transaction have an intermediary
202
+ */
203
+ intermediation?: number;
204
+ /**
205
+ * Sum of other transaction rates
206
+ */
207
+ other?: number;
208
+ };
209
+ /**
210
+ * Financial status and date of change
211
+ */
212
+ status?: {
213
+ /**
214
+ * Last status change, date and time in ISO 8601 standard representation
215
+ */
216
+ updated_at?: string;
217
+ /**
218
+ * Payment status
219
+ */
220
+ current:
221
+ | 'pending'
222
+ | 'under_analysis'
223
+ | 'authorized'
224
+ | 'unauthorized'
225
+ | 'paid'
226
+ | 'in_dispute'
227
+ | 'refunded'
228
+ | 'voided'
229
+ | 'unknown';
230
+ };
231
+ /**
232
+ * Flags to associate additional info
233
+ *
234
+ * @maxItems 10
235
+ */
236
+ flags?: string[];
237
+ /**
238
+ * List of custom fields
239
+ *
240
+ * @maxItems 10
241
+ */
242
+ custom_fields?: {
243
+ /**
244
+ * Field name
245
+ */
246
+ field: string;
247
+ /**
248
+ * Field value
249
+ */
250
+ value: string;
251
+ }[];
252
+ /**
253
+ * Optional notes with additional info about this transaction
254
+ */
255
+ notes?: string;
256
+ };
257
+ /**
258
+ * Whether the buyer should be redirected to payment link right after checkout
259
+ */
260
+ redirect_to_payment?: boolean;
261
+ }
@@ -0,0 +1,323 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * Triggered when listing payments, must return available methods
10
+ */
11
+ export interface ListPaymentsParams {
12
+ /**
13
+ * Products composing the cart
14
+ *
15
+ * @maxItems 3000
16
+ */
17
+ items?: {
18
+ /**
19
+ * Product ID
20
+ */
21
+ product_id: string;
22
+ /**
23
+ * ID to specify the variation added to cart, if product has variations
24
+ */
25
+ variation_id?: string;
26
+ /**
27
+ * Product or variation unique reference code
28
+ */
29
+ sku?: string;
30
+ /**
31
+ * Product or variation full name, or other label for this cart item
32
+ */
33
+ name?: string;
34
+ /**
35
+ * Item quantity in cart
36
+ */
37
+ quantity: number;
38
+ /**
39
+ * Designator of currency according to ISO 4217 (3 uppercase letters)
40
+ */
41
+ currency_id?: string;
42
+ /**
43
+ * Graphic symbol used as a shorthand for currency's name
44
+ */
45
+ currency_symbol?: string;
46
+ /**
47
+ * Product sale price specifically for this cart
48
+ */
49
+ price: number;
50
+ /**
51
+ * Final item price including additions due to customizations and gift wrap
52
+ */
53
+ final_price?: number;
54
+ }[];
55
+ /**
56
+ * Designator of currency according to ISO 4217 (3 uppercase letters)
57
+ */
58
+ currency_id?: string;
59
+ /**
60
+ * Graphic symbol used as a shorthand for currency's name
61
+ */
62
+ currency_symbol?: string;
63
+ /**
64
+ * Object with sums of values
65
+ */
66
+ amount?: {
67
+ /**
68
+ * Order total amount
69
+ */
70
+ total: number;
71
+ /**
72
+ * The sum of all items prices
73
+ */
74
+ subtotal?: number;
75
+ /**
76
+ * Order freight cost
77
+ */
78
+ freight?: number;
79
+ /**
80
+ * Applied discount value
81
+ */
82
+ discount?: number;
83
+ /**
84
+ * The sum of all the taxes applied to the order
85
+ */
86
+ tax?: number;
87
+ /**
88
+ * Sum of optional extra costs applied
89
+ */
90
+ extra?: number;
91
+ };
92
+ /**
93
+ * Language two letters code, sometimes with region, eg.: pt_br, fr, en_us
94
+ */
95
+ lang?: string;
96
+ /**
97
+ * Store domain name (numbers and lowercase letters, eg.: www.myshop.sample)
98
+ */
99
+ domain?: string;
100
+ /**
101
+ * Customer object
102
+ */
103
+ customer?: {
104
+ /**
105
+ * Customer ID
106
+ */
107
+ _id?: null | string;
108
+ /**
109
+ * Customer language two letter code, sometimes with region, eg.: pt_br, fr, en_us
110
+ */
111
+ locale?: string;
112
+ /**
113
+ * Customer main email address
114
+ */
115
+ main_email: string;
116
+ /**
117
+ * List of customer email addresses
118
+ *
119
+ * @maxItems 20
120
+ */
121
+ emails?: {
122
+ /**
123
+ * The actual email address
124
+ */
125
+ address: string;
126
+ /**
127
+ * The type of email
128
+ */
129
+ type?: 'work' | 'home' | 'other';
130
+ /**
131
+ * States whether or not the email address has been verified
132
+ */
133
+ verified?: boolean;
134
+ }[];
135
+ /**
136
+ * The name of this Customer, suitable for display
137
+ */
138
+ display_name?: string;
139
+ /**
140
+ * Customer name object
141
+ */
142
+ name: {
143
+ /**
144
+ * The family name of this user, or "last name"
145
+ */
146
+ family_name?: string;
147
+ /**
148
+ * The "first name" of this user
149
+ */
150
+ given_name?: string;
151
+ /**
152
+ * The middle name(s) of this user
153
+ */
154
+ middle_name?: string;
155
+ };
156
+ /**
157
+ * Customer gender, female, male or third gender (X)
158
+ */
159
+ gender?: 'f' | 'm' | 'x';
160
+ /**
161
+ * User profile pictures
162
+ *
163
+ * @maxItems 20
164
+ */
165
+ photos?: string[];
166
+ /**
167
+ * List of customer phone numbers
168
+ *
169
+ * @maxItems 20
170
+ */
171
+ phones?: {
172
+ /**
173
+ * Country calling code (without +), defined by standards E.123 and E.164
174
+ */
175
+ country_code?: number;
176
+ /**
177
+ * The actual phone number, digits only
178
+ */
179
+ number: string;
180
+ /**
181
+ * The type of phone
182
+ */
183
+ type?: 'home' | 'personal' | 'work' | 'other';
184
+ }[];
185
+ /**
186
+ * Physical or juridical (company) person
187
+ */
188
+ registry_type?: 'p' | 'j';
189
+ /**
190
+ * Country of document origin, an ISO 3166-2 code
191
+ */
192
+ doc_country?: string;
193
+ /**
194
+ * Responsible person or organization document number (only numbers)
195
+ */
196
+ doc_number?: string;
197
+ /**
198
+ * Municipal or state registration if exists
199
+ */
200
+ inscription_type?: 'State' | 'Municipal';
201
+ /**
202
+ * Municipal or state registration number (with characters) if exists
203
+ */
204
+ inscription_number?: string;
205
+ /**
206
+ * Registered company name or responsible fullname
207
+ */
208
+ corporate_name?: string;
209
+ /**
210
+ * List of customer addresses
211
+ *
212
+ * @maxItems 40
213
+ */
214
+ addresses?: {
215
+ /**
216
+ * Unique ID (ObjectID)
217
+ */
218
+ _id: string;
219
+ /**
220
+ * ZIP (CEP, postal...) code
221
+ */
222
+ zip: string;
223
+ /**
224
+ * Street or public place name
225
+ */
226
+ street?: string;
227
+ /**
228
+ * House or building street number
229
+ */
230
+ number?: number;
231
+ /**
232
+ * Address complement or second line, such as apartment number
233
+ */
234
+ complement?: string;
235
+ /**
236
+ * Borough name
237
+ */
238
+ borough?: string;
239
+ /**
240
+ * Some optional other reference for this address
241
+ */
242
+ near_to?: string;
243
+ /**
244
+ * Full in line mailing address, should include street, number and borough
245
+ */
246
+ line_address?: string;
247
+ /**
248
+ * City name
249
+ */
250
+ city?: string;
251
+ /**
252
+ * Country name
253
+ */
254
+ country?: string;
255
+ /**
256
+ * An ISO 3166-2 country code
257
+ */
258
+ country_code?: string;
259
+ /**
260
+ * Province or state name
261
+ */
262
+ province?: string;
263
+ /**
264
+ * The two-letter code for the province or state
265
+ */
266
+ province_code?: string;
267
+ /**
268
+ * The name of recipient, generally is the customer's name
269
+ */
270
+ name?: string;
271
+ /**
272
+ * The recipient's last name
273
+ */
274
+ last_name?: string;
275
+ /**
276
+ * Customer phone number for this mailing address
277
+ */
278
+ phone?: {
279
+ /**
280
+ * Country calling code (without +), defined by standards E.123 and E.164
281
+ */
282
+ country_code?: number;
283
+ /**
284
+ * The actual phone number, digits only
285
+ */
286
+ number: string;
287
+ };
288
+ /**
289
+ * Indicates whether this address is the default address for the customer
290
+ */
291
+ default?: boolean;
292
+ }[];
293
+ };
294
+ /**
295
+ * Optional payment method selected by customer (if already selected)
296
+ */
297
+ payment_method?: {
298
+ /**
299
+ * Standardized payment method code
300
+ */
301
+ code:
302
+ | 'credit_card'
303
+ | 'banking_billet'
304
+ | 'online_debit'
305
+ | 'account_deposit'
306
+ | 'debit_card'
307
+ | 'balance_on_intermediary'
308
+ | 'loyalty_points'
309
+ | 'other';
310
+ /**
311
+ * Short description for payment method
312
+ */
313
+ name?: string;
314
+ };
315
+ /**
316
+ * Whether list payments can be refetched on client when payment selected
317
+ */
318
+ can_fetch_when_selected?: boolean;
319
+ /**
320
+ * Whether payment were already chosen and is just being confirmed to complete checkout
321
+ */
322
+ is_checkout_confirmation?: boolean;
323
+ }