As with Authorize.Net / CyberSource, we need to add a local action form to payment transactions where authorizations can be captured.

Comments

c4rl’s picture

Subscribearoo

jpsalter’s picture

Subscribing

c4rl’s picture

Hey @jpsalter, you can stop subscribing and start following. Cheers :)

andyg5000’s picture

Here's a patch to get us started with this feature request.

Patch offers ability to capture funds from prior auth.

ToDo:
Allow multiple captures on the same auth.
Allow captures of 115% or $75 over auth amount as specified in WPP api

andyg5000’s picture

Here's an updated patch that allows multiple captures (up to the initial authorization amount). It also does the required reauth if the original authorization is more than 3 days old (not yet tested).

andyg5000’s picture

Status: Active » Needs review
rszrama’s picture

Title: Add a prior authorization capture form » Improve support for multiple prior authorization captures
Status: Needs review » Active

I've taken what you've done and committed it with a few changes and the todo filled in. PayPal's time limit is actually 29 days total, 3 days for the honor period. Frankly, it's pretty weird, and I think we'll need to do better, hence me repurposing this issue.

What is there now will work fine for most folks who just want to perform the single capture and be done, but in the case of multiple prior authorization captures we need to better accommodate the capture amount and reauthorization limits. According to the docs you can only reauthorize an authorization once within the 29 day time limit, but it's unclear if that includes failed reauthorizations or if a reauthorization can itself be reauthorized (since it has a new transaction ID).

Based on this info and whatever we can determine from real world tests (i.e. waiting for the honor period to pass and checking reauthorization results), we can update our access callback to prevent capture attempts that would require illegitimate reauthorizations.

Additionally, right now we're checking the 115% / +$75 limit on capture amounts based on the current transaction's authorization amount. On a follow-up transaction, though, since we don't take the original transaction amount into consideration, we're unnecessarily limiting the amount that can be captured. If the original auth was $100 and we capture $50, the most that could be captured on the follow-up transaction would be $57.5 with our current logic when it should actually be $65. Not a huge deal, but it's something we can improve.

All the necessary data should be there in the payload. I changed the way we were storing it for these capture transactions, because we would have ended up with a REQUEST_TIME collision for the reauthorization payload and the capture payload.

Commit: http://drupalcode.org/project/commerce_paypal.git/commitdiff/89d4c40

rszrama’s picture

Status: Active » Postponed

I don't think these follow-up features are high priority, so I'm marking this as postponed.

May just wait until we get a request here to revisit it.

deardagny’s picture

Hi all – It seems the "capture" feature is in various states of completion across the PayPal modules. I'm looking to implement this feature on the WPS module, but haven't found any mention of it.

I've previously cobbled together a working model for PayFlow pro that allows for captures, voids, and credits on prior auth transactions. Is there any reason I can't use the same methods that the WPP module uses to give the WPS module the ability to capture and credit?

  • rszrama committed 89d4c40 on 8.x-1.x
    Issue #1250424 by andyg5000, rszrama: add support for prior...
tomtech’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.