mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
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:
parent
2e11d235c0
commit
6a4db52205
2 changed files with 11 additions and 2 deletions
|
@ -57,7 +57,12 @@
|
||||||
<h4 class="gh-setting-title">Connect to Stripe</h4>
|
<h4 class="gh-setting-title">Connect to Stripe</h4>
|
||||||
{{#if this.stripeConnectIntegration}}
|
{{#if this.stripeConnectIntegration}}
|
||||||
<p class="gh-setting-desc pa0 ma0">
|
<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}}
|
{{#unless this.stripeConnectIntegration.livemode}}
|
||||||
<span class="gh-members-connect-testmodelabel">Test mode</span>
|
<span class="gh-members-connect-testmodelabel">Test mode</span>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
|
@ -219,9 +219,13 @@ export default Component.extend({
|
||||||
|
|
||||||
saveStripeSettings: task(function* () {
|
saveStripeSettings: task(function* () {
|
||||||
this.set('stripeConnectError', null);
|
this.set('stripeConnectError', null);
|
||||||
|
this.set('stripeConnectSuccess', null);
|
||||||
if (this.get('settings.stripeConnectIntegrationToken')) {
|
if (this.get('settings.stripeConnectIntegrationToken')) {
|
||||||
try {
|
try {
|
||||||
return yield this.settings.save();
|
const response = yield this.settings.save();
|
||||||
|
this.set('membersStripeOpen', false);
|
||||||
|
this.set('stripeConnectSuccess', true);
|
||||||
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.payload && error.payload.errors) {
|
if (error.payload && error.payload.errors) {
|
||||||
this.set('stripeConnectError', 'Invalid secure key');
|
this.set('stripeConnectError', 'Invalid secure key');
|
||||||
|
|
Loading…
Add table
Reference in a new issue