diff --git a/src/_helpers/router.js b/src/_helpers/router.js index 88d1cfe..7dad770 100644 --- a/src/_helpers/router.js +++ b/src/_helpers/router.js @@ -9,10 +9,25 @@ import NetworksPage from '../account/NetworksPage' import NewNetworkPage from '../account/NewNetworkPage' import NetworkPage from '../account/NetworkPage' import AccountsPage from '../admin/AccountsPage' +import StripePayment from "../account/payment/StripePayment"; +import InviteCodePayment from "../account/payment/InviteCodePayment"; +import UnknownPayment from "../account/payment/UnknownPayment"; import { currentUser } from '../_helpers' Vue.use(Router); +const newNetworkChildren = [ + { path: '', component: NewNetworkPage, + children: [{ + 'path': '', components: { + 'stripe': StripePayment, + 'invite': InviteCodePayment, + 'unknown': UnknownPayment + } + }] + }, +]; + export const router = new Router({ mode: 'history', routes: [ @@ -21,18 +36,21 @@ export const router = new Router({ children: [ { path: '', component: NetworksPage, - children: [ - { path: '', component: NewNetworkPage }, - ] + children: newNetworkChildren }, { path: '/profile', component: ProfilePage }, { path: '/networks', component: NetworksPage , children: [ - { path: '', component: NewNetworkPage }, + { + path: '', component: NewNetworkPage, + children: newNetworkChildren + }, ] }, - { path: '/networks/new', component: NewNetworkPage }, + { path: '/networks/new', component: NewNetworkPage, + children: newNetworkChildren + }, { path: '/networks/:uuid', component: NetworkPage } ] }, diff --git a/src/_store/paymentMethods.module.js b/src/_store/paymentMethods.module.js index e4eed88..b671bd6 100644 --- a/src/_store/paymentMethods.module.js +++ b/src/_store/paymentMethods.module.js @@ -4,7 +4,8 @@ const state = { loading: null, error: null, paymentMethods: null, - paymentMethod: null + paymentMethod: null, + paymentInfo: null }; const actions = { @@ -17,13 +18,24 @@ const actions = { ); }, - getByUuid({ commit }, uuid) { + getById({ commit }, uuid) { commit('getByUuidRequest'); paymentMethodService.getById(uuid) .then( paymentMethod => commit('getByUuidSuccess', paymentMethod), error => commit('getByUuidFailure', error) ); + }, + + setPaymentMethod({ commit }, pm) { + console.log('setPaymentMethod: setting: '+JSON.stringify(pm)); + commit('setPaymentMethodSuccess', pm); + }, + setPaymentInfo({ commit }, info) { + commit('setPaymentInfoSuccess', info); + }, + clearPaymentInfo({ commit }) { + commit('clearPaymentInfoSuccess'); } }; @@ -49,6 +61,15 @@ const mutations = { getByUuidFailure(state, error) { state.loading = false; state.error = { error }; + }, + setPaymentMethodSuccess(state, pm) { + state.paymentMethod = pm; + }, + setPaymentInfoSuccess(state, info) { + state.paymentInfo = info; + }, + clearPaymentInfoSuccess(state) { + state.paymentInfo = null; } }; @@ -57,4 +78,4 @@ export const paymentMethods = { state, actions, mutations -}; +}; \ No newline at end of file diff --git a/src/account/NewNetworkPage.vue b/src/account/NewNetworkPage.vue index 3aa5a44..ee11379 100644 --- a/src/account/NewNetworkPage.vue +++ b/src/account/NewNetworkPage.vue @@ -42,14 +42,17 @@