diff --git a/resources/assets/vue/components/bookings/elements/BookingConfirmationComponent.vue b/resources/assets/vue/components/bookings/elements/BookingConfirmationComponent.vue index 2c129007..536c07e0 100644 --- a/resources/assets/vue/components/bookings/elements/BookingConfirmationComponent.vue +++ b/resources/assets/vue/components/bookings/elements/BookingConfirmationComponent.vue @@ -270,15 +270,22 @@
-
+
Promo Code
- +
+
+
+ +
+
@@ -312,6 +319,7 @@ dropdownStatus: false, account_no: '', step:1, + promoCode:"" } }, @@ -342,6 +350,46 @@ this.createBank = false; this.account_no = ''; this.parameters.bankAccount = {}; + }, + applyPromocoe(){ + let promoRequestObj = { + category : 'New cat 4', + discount: { + "percent_off": 10.0, + "type": "PERCENT" + }, + redemption: { + quantity: 10 + }, + start_date: "2016-01-01T00:00:00Z", + expiration_date: "2016-12-31T23:59:59Z", + order: { + amount: 10, + currency: "USD", + id: "order_1234523" + } + }; + this.isLoading = true; + return fetch('https://as1.api.voucherify.io/v1/vouchers/dummy2/redemption', { + method: 'POST', + responseType: 'json', + body: promoRequestObj, + headers: { + 'content-type': 'application/json', + 'X-App-Token': '09a22aa9-f287-4813-9c65-6baa43091a6e', + 'X-App-Id': 'e12347c6-b072-4318-9a2b-179a7a3b1414' + } + }).then(response => { + + console.log(response); + + if(response.status === 401 && window.location.href !== route('login')){ + dispatch('userAuthentication', {access_token: '', redirect_url: '/'}); + } + + return response; + + }) } }, mixins: [FormHandler]