Skip to content

Commit bc28b26

Browse files
committed
discount by payment methods
1 parent bf54578 commit bc28b26

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

routes/list_payments.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,32 @@ const responseSchema = {
160160
'maximum': 999,
161161
'description': 'Optional maximum number of installments without tax'
162162
},
163+
'discount_option': {
164+
'type': 'object',
165+
'required': [ 'value' ],
166+
'additionalProperties': false,
167+
'properties': {
168+
'label': {
169+
'type': 'string',
170+
'maxLength': 50,
171+
'description': 'Name of payment method that handle the discount'
172+
},
173+
'type': {
174+
'type': 'string',
175+
'enum': [ 'percentage', 'fixed' ],
176+
'default': 'percentage',
177+
'description': 'Discount type'
178+
},
179+
'value': {
180+
'type': 'number',
181+
'multipleOf': 0.0001,
182+
'minimum': -99999999,
183+
'maximum': 99999999,
184+
'description': 'Discount value, percentage or fixed'
185+
}
186+
},
187+
'description': 'Default discount option by payment method'
188+
},
163189
'payment_gateways': {
164190
'type': 'array',
165191
'maxItems': 30,
@@ -244,6 +270,33 @@ const responseSchema = {
244270
},
245271
'description': 'Payment method object'
246272
},
273+
'discount': {
274+
'type': 'object',
275+
'required': [ 'value' ],
276+
'additionalProperties': false,
277+
'properties': {
278+
'apply_at': {
279+
'type': 'string',
280+
'enum': [ 'total', 'subtotal', 'freight' ],
281+
'default': 'subtotal',
282+
'description': 'In which value the discount will be applied at checkout'
283+
},
284+
'type': {
285+
'type': 'string',
286+
'enum': [ 'percentage', 'fixed' ],
287+
'default': 'percentage',
288+
'description': 'Discount type'
289+
},
290+
'value': {
291+
'type': 'number',
292+
'multipleOf': 0.0001,
293+
'minimum': -99999999,
294+
'maximum': 99999999,
295+
'description': 'Discount value, percentage or fixed'
296+
}
297+
},
298+
'description': 'Discount to be applied by payment method'
299+
},
247300
'card_companies': {
248301
'type': 'array',
249302
'maxItems': 30,

0 commit comments

Comments
 (0)