File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -407,7 +407,12 @@ export class ViURShopClient {
407
407
408
408
409
409
// --- Discount -----------------------------------------------------------
410
-
410
+ /**
411
+ * Add a Discount to the current Cart.
412
+ * @param {string } code Human readable Discount Code
413
+ * @param {string } discount_key Database Key from a Discount.
414
+ * @returns {Response<Response> }
415
+ */
411
416
discount_add ( {
412
417
code,
413
418
discount_key,
@@ -422,6 +427,21 @@ export class ViURShopClient {
422
427
. then ( req => req . json ( ) ) ;
423
428
}
424
429
430
+ /**
431
+ * Removes a Discount by the Database Key
432
+ * @param {string } discount_key Database Key from a Discount.
433
+ * @returns {Promise<Response> }
434
+ */
435
+ discount_remove ( {
436
+ discount_key,
437
+ } = { } ) {
438
+ return request ( `${ this . shop_api_url } /discount_remove` , {
439
+ method : 'POST' ,
440
+ params : { discount_key} ,
441
+ } )
442
+ . then ( req => req . json ( ) ) ;
443
+ }
444
+
425
445
426
446
// --- Shipping -----------------------------------------------------------
427
447
You can’t perform that action at this time.
0 commit comments