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

Verify email address is verified before allowing payment method to be available #59

Merged
merged 2 commits into from
Jul 16, 2020

Conversation

seand7565
Copy link
Contributor

@seand7565 seand7565 commented Jul 9, 2020

We want to ensure that the users PayPal email is verified before
accepting payments with this payment_method, so we're defaulting
payment method availability to false and requiring the user to verify
that their email is confirmed before allowing the payment_method
to be available to users.

image

Fixes #9

@seand7565 seand7565 added solidus admin Touches the Solidus backend/admin chore Needs to be done, for necessity or for the well-being of the project, not related to a feature labels Jul 9, 2020
We want to ensure that the users PayPal email is verified before
accepting payments with this payment_method, so we're starting
by defaulting user availability  to false on payment_method creation.
@seand7565 seand7565 marked this pull request as ready for review July 14, 2020 18:56
@seand7565 seand7565 requested a review from elia July 14, 2020 19:00
Copy link
Member

@elia elia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Just a possible change to support translations for the hint

Comment on lines 3 to 5
<span class="hint-tooltip" title="" data-content="You must verify that your email is confirmed with PayPal before allowing users to check out.">
<i class="fa fa-info-circle"></i>
</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to fully support translations with

Suggested change
<span class="hint-tooltip" title="" data-content="You must verify that your email is confirmed with PayPal before allowing users to check out.">
<i class="fa fa-info-circle"></i>
</span>
<%= f.field_hint :available_to_users %>

plus adding spree.hints.solidus_paypal_commerce_platform/payment_method.available_to_users to locales.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, I always forget the translations. Also, I had no idea f.field_hint was a thing, that's seriously cool. Thanks!

Unless `paypal_email_confirmed` is checked, `available_to_user` will
be disabled - this is to provide a reminder to the user that they need
to verify their email with PayPal.
@seand7565
Copy link
Contributor Author

Not sure if GitHub is having issues or if the problem is on my end, but pushing to my branch didn't update this PR. Closing this one to get an updated PR up!

@seand7565 seand7565 closed this Jul 15, 2020
@seand7565
Copy link
Contributor Author

Oookay, reopening - as soon as I closed it the PR updated. 🤔

@seand7565 seand7565 reopened this Jul 15, 2020
@seand7565 seand7565 merged commit ca27d64 into solidusio:master Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Needs to be done, for necessity or for the well-being of the project, not related to a feature solidus admin Touches the Solidus backend/admin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure the email is verified before activating the payment method
2 participants