save state and close tab afetr success

This commit is contained in:
Matteo Pagliazzi 2018-11-21 11:42:32 +01:00
parent 433c73c9d3
commit cc751960ac
2 changed files with 5 additions and 4 deletions

View file

@ -45,7 +45,7 @@ export default {
},
openPaypal (url) {
const appState = {
path: this.$route.fullPath,
inProgress: 'payment',
paymentMethod: 'paypal',
};
setLocalSetting(CONSTANTS.savedAppStateValues.SAVED_APP_STATE, JSON.stringify(appState));

View file

@ -1,12 +1,13 @@
import { CONSTANTS, removeLocalSetting } from 'client/libs/userlocalManager';
export default function (to, from, next) {
const redirect = to.params.redirect;
switch (redirect) {
case 'paypal-success-checkout':
console.log('checkout');
break;
case 'paypal-success-subscribe':
console.log('subscribe');
removeLocalSetting(CONSTANTS.savedAppStateValues.SAVED_APP_STATE);
window.close();
break;
default:
next({name: 'notFound'});