-
Notifications
You must be signed in to change notification settings - Fork 77
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
Gracefully handle unrefundable ticket refund attempts #577
Comments
Comment by slackbot: This ticket was mentioned in Slack in #meta by netweb. View the logs. |
Comment by @actual-saurabh:
|
Added a patch. A summary of changes:
However, I need advice
also adds another error because $result happens to be false. So, it seems rather unusable because the second error is confusing: Should we convert this if statement into a switch statement? And, should I just continue return false and check for that or create a new status constant in the Camptix class and return that instead of false? |
|
This looks really good, thanks Saurabh :) Instead of returning As far as the current path goes, the only big thing I would change would be to modularize the logic that determines if a transaction is refundable, and then just call that method, instead of building it all into the refund method. Modularity helps keep things simple, reusable, de-coupled, and unit-testable. Other than that, I'd just recommend a few minor changes:
|
Comment by @actual-saurabh:
|
@iandunn I've made the changes that you suggested; agree with every single one. |
Doh, Right now, this is what the user will experience:
It'd be better if instead we told them up front that they can't get the refund. So instead of saying, There is some existing logic that we can leverage. So, I'm thinking we can add to that to check if the transaction itself is refundable, and also show an alternate message to the user if it's not.
|
Comment by slackbot: This ticket was mentioned in Slack in #meta-wordcamp by iandunn. View the logs. |
Comment by slackbot: This ticket was mentioned in Slack in #meta-wordcamp by iandunn. View the logs. |
Imported from https://meta.trac.wordpress.org/ticket/1074
Created by @iandunn:
CampTix allows users to refund their ticket purchases, but PayPal only allows refunds within 60 days of the ticket purchase.
We should add some logic to the PayPal addon to short-circuit the refund process if the ticket was purchased more than 60 days ago, and show the user a friendly error.
The text was updated successfully, but these errors were encountered: