-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: need to connect to your stripe account error #5287
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/1o62ms4io |
Codecov Report
@@ Coverage Diff @@
## development #5287 +/- ##
===============================================
- Coverage 22.90% 22.87% -0.04%
===============================================
Files 491 491
Lines 5230 5238 +8
Branches 36 37 +1
===============================================
Hits 1198 1198
- Misses 4027 4035 +8
Partials 5 5
Continue to review full report at Codecov.
|
{ | ||
id: 'event_stripe' | ||
}); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate logic. Move in the event model
Co-authored-by: Areeb Jamal <jamal.areeb@gmail.com>
@@ -181,6 +181,10 @@ export default class Event extends ModelBase.extend(CustomPrimaryKeyMixin, { | |||
|
|||
sessionsByState: computed('sessions', function() { | |||
return groupBy(this.sessions.toArray(), 'data.state'); | |||
}), | |||
|
|||
isStripeConnectionValid: computed('canPayByStripe', 'stripeAuthorization.stripeAuthCode', 'stripeAuthorization.stripePublishableKey', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is isStripeConnectionValid and returns true when the connection is invalid 😲
app/mixins/event-wizard.js
Outdated
this.set('data.event.state', 'draft'); | ||
this.sendAction('save'); | ||
if (this.data.event.isStripeConnectionValid) { | ||
this.notify.error('You need to connect to your Stripe account, if you choose Stripe as a payment gateway.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the connection is valid, show an error?
Here is an overview of what got changed by this pull request: Complexity increasing per file
==============================
- app/components/events/view/publish-bar.ts 8
- app/mixins/event-wizard.js 29
See the complete overview on Codacy |
Fixes #5262
Checklist
development
branch.