-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add tests #224
Add tests #224
Conversation
for some reason getRecurInfo() is nested within run() which prevents the page from being loaded twice (since getRecurInfo is defined twice).
Specifically adding api call to setup a test PP.
this will make it easier to selectively replay
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.
How are you using this later?
$params['subscription_id'] = $subscription_id;
When testing, passive Webhooks simply don't work (we can't get Stripe to ping a development machine). So, after the test recurring contribution is made, we have to actively query Stripe to find the single exact event that was triggered by the recurring contribution so we can process that event through the Webhook code. To do so, we query all events on Stripe that happened after the recurring contribution was made. In probably 99.999% of cases there will be only one event (since this is a matter of seconds), however, to be safe we check the subscription id generated by the contribution so we are 100% sure we are processing the Stripe Event that was triggered by the given contribution. |
Closing in favor of #242 (now refactored against 4.7-dev) |
See #223
This pull requests makes minor changes to the production code in order to facilitate the tests - so it should not have much impact on current installations.
However, it does add a lot of testing and api code which will help as we refactor and add new features moving forward.