methods: {
updateUserToPremium(userId) {
axios.post(`/user/${userId}`, {}, {
headers: { "Authorization": `Bearer ${this.$store.state.token}` }
}).then(res => {
console.log('Success session creation');
this.routeToStartpage()
}).catch(error => {
console.log(error);
return error;
})
},
testing(userId) {
var rp = new Reepay.ModalSubscription(sessionId);
rp.addEventHandler(Reepay.Event.Accept, function(data) {
console.log('Success', data);
updateUserToPremium(userId); // <--- This triggers updateUserToPremium is not defined'
rp.destroy();
})
},
}