%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/store/booking/
Upload File :
Create Path :
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/store/booking/payment.js

export const state = () => ({
  payment_intent: null,
  connect_id: null
})

export const mutations = {
  setPaymentIntent(state, intent) {
    state.payment_intent = intent
  },
  setAccountId(state, account_id) {
    state.connect_id = account_id
  }
}

export const actions = {
  async getPaymentIntent({ commit }, payload) {
    await this.$axios.post('/booking/payment/intent/'+payload.user_id, payload).then((response) => {
      if(response.status == 200) {
        commit('setPaymentIntent', response.data.payment_intent);
        commit('setAccountId', response.data.connect_id);
      }
    }).catch((response) => {
      this.loading = false;
    })
  }
}

Zerion Mini Shell 1.0