From e4bc3f766c824b9719688374e7c770b10f2e9005 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Tue, 23 Jun 2020 14:47:06 -0400 Subject: [PATCH 1/4] better handling of payment information for new bubble --- src/account/NewNetworkPage.vue | 75 +++++++++++++++++++-------- src/account/payment/StripePayment.vue | 12 ++++- 2 files changed, 63 insertions(+), 24 deletions(-) diff --git a/src/account/NewNetworkPage.vue b/src/account/NewNetworkPage.vue index 1b5852f..c43815a 100644 --- a/src/account/NewNetworkPage.vue +++ b/src/account/NewNetworkPage.vue @@ -20,6 +20,55 @@
+
+ + +
+

{{messages.field_label_choose_plan}}

+ {{messages['plan_name_'+defaults.plan]}} - {{messages.price_format.parseExpression({messages: messages, ...findPlan(defaults.plan)})}} + + +
+
+ {{messages['plan_description_'+accountPlan.plan]}} +
+
• {{messages.message_plan_max_accounts.parseExpression({max: selectedPlan.maxAccounts})}}
+
• {{messages.message_plan_no_max_accounts}}
+
+
+
+ +
+

+
{{messages.title_account_promotions}}
+ + + + + +
{{messages['label_promotion_'+promo.name]}}:{{messages['label_promotion_'+promo.name+'_description']}}
+
+
+
+

+
+ + + +
+ + + +
+
+
+ + + + +
+
+
@@ -75,7 +124,7 @@
- + @@ -253,26 +302,6 @@

- - - -
-
{{messages.err_noPaymentMethods}}
-
-
- - - -
- - -
-
- - - - -
@@ -281,7 +310,7 @@ - + @@ -742,6 +771,8 @@ created() { this.inboundAction = util.setInboundAction(this.$route); this.initDefaults(); + const vue = this; + window.setTimeout(() => { vue.inboundAction = null; }, 5000) } }; \ No newline at end of file diff --git a/src/account/payment/StripePayment.vue b/src/account/payment/StripePayment.vue index 2665858..b5479e7 100644 --- a/src/account/payment/StripePayment.vue +++ b/src/account/payment/StripePayment.vue @@ -28,7 +28,7 @@ } }, computed: { - ...mapState('paymentMethods', ['paymentMethod', 'paymentStatus', 'paymentInfo']), + ...mapState('paymentMethods', ['paymentMethod', 'paymentStatus', 'paymentInfo', 'accountPaymentMethods']), ...mapState('system', ['messages']), }, created () { @@ -41,7 +41,7 @@ this.card.mount(this.$refs.card); }, methods: { - ...mapActions('paymentMethods', ['addAccountPaymentMethod']), + ...mapActions('paymentMethods', ['addAccountPaymentMethod', 'getAllAccountPaymentMethods']), authorizeCard(e) { util.setSkipRegistration(); const comp = this; @@ -66,6 +66,14 @@ }); return false; } + }, + watch: { + paymentStatus (ps) { + if (ps && ps.addedPaymentMethod) { + // refresh account payment methods + this.getAllAccountPaymentMethods({userId: this.user.uuid, messages: this.messages, errors: this.errors}) + } + } } }; \ No newline at end of file From 5c2da71518c8b97a9656c09ac337332cc4763bb5 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Tue, 23 Jun 2020 17:05:28 -0400 Subject: [PATCH 2/4] remove payment info from registration, capture at bubble launch time --- src/account/NewNetworkPage.vue | 8 +++-- src/auth/RegisterPage.vue | 62 +++++++++++++++++----------------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src/account/NewNetworkPage.vue b/src/account/NewNetworkPage.vue index c43815a..25fbff2 100644 --- a/src/account/NewNetworkPage.vue +++ b/src/account/NewNetworkPage.vue @@ -39,7 +39,8 @@
-

+

{{messages.messages.payment_first_details_with_promos}}

+
{{messages.title_account_promotions}}
{{messages.field_label_plan}}:{{selectedPlanName}}{{selectedPlanName}} - {{messages.price_format.parseExpression({messages: messages, ...selectedPlan})}}
{{messages.field_label_network_name}}:
@@ -47,11 +48,12 @@
{{messages['label_promotion_'+promo.name+'_description']}}
-
+

{{messages.payment_first_details_with_promos_details}}

+
@@ -68,6 +70,8 @@ +
+
diff --git a/src/auth/RegisterPage.vue b/src/auth/RegisterPage.vue index db7c8a4..7324f67 100644 --- a/src/auth/RegisterPage.vue +++ b/src/auth/RegisterPage.vue @@ -26,31 +26,31 @@ {{messages.message_request_promoCode}}
-
- -
-
{{messages.err_noPaymentMethods}}
-
-
- - - -
+ + + + + + + + + + -
-
- - - - -
-
-
{{ errors.first('paymentInfo') }}
-
{{ errors.first('paymentMethod') }}
-
{{ errors.first('paymentMethodInfo') }}
-
{{ errors.first('paymentMethodType') }}
-
{{ errors.first('paymentMethodService') }}
-
+ + + + + + + + + + + + + +
@@ -133,15 +133,15 @@ export default { this.errors.add({field: 'confirmPassword', msg: this.messages['err_confirmPassword_mismatch']}) } else { if (this.plan !== null) { - if (this.paymentMethodObject === null) { - this.errors.add({field: 'paymentMethod', msg: this.messages['err_paymentMethod_required']}); - return; - } else { + // if (this.paymentMethodObject === null) { + // this.errors.add({field: 'paymentMethod', msg: this.messages['err_paymentMethod_required']}); + // return; + // } else { console.log('handleSubmit: setting this.user.preferredPlan = '+this.plan.uuid); this.user.preferredPlan = this.plan.uuid; - this.user.paymentMethodObject = this.paymentMethodObject; - this.user.paymentMethodObject.cloud = this.selectedPaymentMethod.name; - } + // this.user.paymentMethodObject = this.paymentMethodObject; + // this.user.paymentMethodObject.cloud = this.selectedPaymentMethod.name; + // } } this.register({ user: this.user, From 52b39399eb12849535ff25efbf53b3fa776a48d9 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Tue, 23 Jun 2020 17:16:20 -0400 Subject: [PATCH 3/4] simplify launch page --- src/account/NetworksPage.vue | 2 +- src/account/NewNetworkPage.vue | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/account/NetworksPage.vue b/src/account/NetworksPage.vue index 7b83a73..e096799 100644 --- a/src/account/NetworksPage.vue +++ b/src/account/NetworksPage.vue @@ -27,7 +27,7 @@
- {{messages.message_empty_networks}} +
diff --git a/src/account/NewNetworkPage.vue b/src/account/NewNetworkPage.vue index 25fbff2..42e9ba6 100644 --- a/src/account/NewNetworkPage.vue +++ b/src/account/NewNetworkPage.vue @@ -1,7 +1,7 @@