From 9e5868336b2885953df49c0bdb6357052739c2bd Mon Sep 17 00:00:00 2001 From: Chirag Viradya Date: Tue, 8 Oct 2019 15:52:13 +0530 Subject: [PATCH] Added support for the VSF v1.10.0 --- components/PaymentRazorpay.vue | 2 +- hooks/beforeRegistration.ts | 3 +-- store/actions.ts | 16 ++++++++-------- types/Order.ts | 10 +++++----- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/components/PaymentRazorpay.vue b/components/PaymentRazorpay.vue index c58efde..836c700 100644 --- a/components/PaymentRazorpay.vue +++ b/components/PaymentRazorpay.vue @@ -43,7 +43,7 @@ export default { }, computed: { getGrandTotal () { - let cartTotals = store.getters['cart/totals'] + let cartTotals = store.getters['cart/getTotals'] return cartTotals.find(seg => seg.code === 'grand_total').value }, getpersonalDetails () { diff --git a/hooks/beforeRegistration.ts b/hooks/beforeRegistration.ts index 2749228..85222d2 100644 --- a/hooks/beforeRegistration.ts +++ b/hooks/beforeRegistration.ts @@ -1,8 +1,7 @@ import PaymentRazorpay from '../components/PaymentRazorpay.vue' import i18n from '@vue-storefront/i18n' -export function beforeRegistration({ Vue, config, store, isServer }) { - +export function beforeRegistration ({ Vue, config, store, isServer }) { const VSF_PAYMENT_CODE = config.razorpay.method_code || 'razorpay' let paymentMethodConfig = { diff --git a/store/actions.ts b/store/actions.ts index 2415eee..47f1d1a 100644 --- a/store/actions.ts +++ b/store/actions.ts @@ -24,14 +24,14 @@ export const actions: ActionTree = { mode: 'cors', body: JSON.stringify(orderData) }) - .then(response => response.json()) - .then(data => { - if (data.code === 200) { - commit(types.CREATE_RAZORPAY_ORDER, data.result) - } else { - commit(types.REMOVE_RAZORPAY_ORDER) - } - }) + .then(response => response.json()) + .then(data => { + if (data.code === 200) { + commit(types.CREATE_RAZORPAY_ORDER, data.result) + } else { + commit(types.REMOVE_RAZORPAY_ORDER) + } + }) } catch (e) { commit(types.REMOVE_RAZORPAY_ORDER) rootStore.dispatch('notification/spawnNotification', { diff --git a/types/Order.ts b/types/Order.ts index d44081e..8e0272f 100644 --- a/types/Order.ts +++ b/types/Order.ts @@ -1,6 +1,6 @@ -export default interface razorpayOrder { - amount: string; - currency: string; - receipt: string; - payment_capture: string; +export default interface RazorpayOrder { + amount: string, + currency: string, + receipt: string, + payment_capture: string }