Skip to content

Commit

Permalink
Added support for the VSF v1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cnviradiya committed Oct 8, 2019
1 parent fd28c19 commit 9e58683
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion components/PaymentRazorpay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
3 changes: 1 addition & 2 deletions hooks/beforeRegistration.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
16 changes: 8 additions & 8 deletions store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export const actions: ActionTree<RazorpayState, any> = {
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', {
Expand Down
10 changes: 5 additions & 5 deletions types/Order.ts
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 9e58683

Please sign in to comment.