Added void action for transactions #1480
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Taking a crack at creating a way to void transactions as requested in #611, using Omnipay
void()
method.When transactions have not yet been captured, the time period in which they can be voided varies by card issuer, so I've it set up to provide the Void action for any transactions that have not yet captured.
Once a transaction has been captured, the time period that a transaction can be voided in depends on the gateway and when they batch them, but generally is about 24 hours. I added a
voidWindow
property to the base Commerce Omnipay gateway (craftcms/commerce-omnipay#13), which defaults to 24 hours and can be overridden by each gateway plugin.I'm not very familiar with PostgreSQL, so for the migration I patterned it after a similar column change in a previous migration.
I tested using jmauzyk/commerce-cardconnect and craftcms/commerce-paypal and was able to successfully void transactions in both.
Thanks for your consideration!