Added success state for Stripe Connect

no issue
- adds success message when Stripe Connect is successfully set up
- automatically closes the setting section on success
This commit is contained in:
Peter Zimon 2020-06-11 16:55:26 +02:00
parent 19f16f5a0d
commit ac27a4f2eb
2 changed files with 11 additions and 2 deletions

View File

@ -57,7 +57,12 @@
<h4 class="gh-setting-title">Connect to Stripe</h4>
{{#if this.stripeConnectIntegration}}
<p class="gh-setting-desc pa0 ma0">
Connected to <a href="https://dashboard.stripe.com/{{this.stripeConnectIntegration.id}}" target="_blank">{{this.stripeConnectIntegration.name}}</a>
{{#if this.stripeConnectSuccess}}
{{svg-jar "check-circle" class="stroke-green w4 h4 nudge-top--3"}} <span class="green-d1">Successfully connected to {{this.stripeConnectIntegration.name}}</span>
{{else}}
Connected to <a href="https://dashboard.stripe.com/{{this.stripeConnectIntegration.id}}" target="_blank">{{this.stripeConnectIntegration.name}}</a>
{{/if}}
{{#unless this.stripeConnectIntegration.livemode}}
<span class="gh-members-connect-testmodelabel">Test mode</span>
{{/unless}}

View File

@ -219,9 +219,13 @@ export default Component.extend({
saveStripeSettings: task(function* () {
this.set('stripeConnectError', null);
this.set('stripeConnectSuccess', null);
if (this.get('settings.stripeConnectIntegrationToken')) {
try {
return yield this.settings.save();
const response = yield this.settings.save();
this.set('membersStripeOpen', false);
this.set('stripeConnectSuccess', true);
return response;
} catch (error) {
if (error.payload && error.payload.errors) {
this.set('stripeConnectError', 'Invalid secure key');