Skip to content
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

Merged
merged 7 commits into from
Oct 11, 2020
Merged

fix: need to connect to your stripe account error #5287

merged 7 commits into from
Oct 11, 2020

Conversation

maze-runnar
Copy link
Contributor

Fixes #5262

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Oct 11, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/1o62ms4io
✅ Preview: https://open-event-frontend-git-lost.eventyay.vercel.app

@codecov
Copy link

codecov bot commented Oct 11, 2020

Codecov Report

Merging #5287 into development will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               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              
Impacted Files Coverage Δ
app/components/events/view/publish-bar.ts 15.62% <0.00%> (-1.62%) ⬇️
app/mixins/event-wizard.js 0.90% <0.00%> (-0.04%) ⬇️
app/models/event.js 57.14% <0.00%> (-4.40%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b16e56...808e5d3. Read the comment docs.

{
id: 'event_stripe'
});
return;
Copy link
Member

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

app/models/event.js Outdated Show resolved Hide resolved
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() {
Copy link
Member

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 😲

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.');
Copy link
Member

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?

@iamareebjamal iamareebjamal changed the title fix: need to connect to your Stripe account, if choosen Stripe as a payment fix: need to connect to your stripe account error Oct 11, 2020
@iamareebjamal iamareebjamal merged commit 6b96d3b into fossasia:development Oct 11, 2020
Copy link
Member

Codacy 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

@maze-runnar maze-runnar deleted the lost branch October 12, 2020 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wizard Step 1: Should not be possible to save when Stripe is ticked without Stripe connected
3 participants