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

Add tests #224

Closed
wants to merge 29 commits into from
Closed

Add tests #224

wants to merge 29 commits into from

Conversation

jmcclelland
Copy link
Contributor

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.

this will make it easier to selectively replay
Copy link
Collaborator

@h-c-c h-c-c left a 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;

@jmcclelland
Copy link
Contributor Author

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.

@jmcclelland
Copy link
Contributor Author

Closing in favor of #242 (now refactored against 4.7-dev)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants