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

Added void action for transactions #1480

Closed
wants to merge 1 commit into from
Closed

Added void action for transactions #1480

wants to merge 1 commit into from

Conversation

jmauzyk
Copy link

@jmauzyk jmauzyk commented May 29, 2020

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!

@codecov
Copy link

codecov bot commented May 29, 2020

Codecov Report

Merging #1480 into develop will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             develop   #1480      +/-   ##
============================================
- Coverage       7.96%   7.92%   -0.04%     
- Complexity      5063    5086      +23     
============================================
  Files            256     256              
  Lines          16718   16796      +78     
============================================
  Hits            1331    1331              
- Misses         15387   15465      +78     
Impacted Files Coverage Δ Complexity Δ
src/Plugin.php 1.73% <0.00%> (-0.01%) 62.00 <0.00> (ø)
src/controllers/OrdersController.php 0.00% <0.00%> (ø) 200.00 <4.00> (+9.00)
src/models/Transaction.php 0.00% <0.00%> (ø) 22.00 <1.00> (+1.00)
src/records/Transaction.php 0.00% <ø> (ø) 5.00 <0.00> (ø)
src/services/Payments.php 0.00% <0.00%> (ø) 72.00 <5.00> (+5.00)
src/services/Transactions.php 0.00% <0.00%> (ø) 52.00 <6.00> (+8.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e57ded...dd9f07b. Read the comment docs.

@lukeholder
Copy link
Member

Thanks for the PR. Will review.

I think this solves #611

@lukeholder
Copy link
Member

Thanks for your start on this @jmauzyk - needed to make a few changes and working on it on this branch: #1579

@lukeholder lukeholder closed this Jul 20, 2020
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