Forums / PayPal Express Checkout support / Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

Locked

Started by tj1 on 6 Apr 2008, 2:27 AM · Views: 8,478

Results 21 to 28 of 28
This thread is locked. New replies are disabled.
8 Jul 2009, 3:41 AM
#21
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

... and remember, you can't always refund certain transactions ... which is why the option is supposed to only appear in certain cases.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Jul 2009, 12:11 AM
#22
samcyh avatar

samcyh

New Zenner

Join Date:
Oct 2006
Posts:
13
Plugin Contributions:
0

Re: Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

Hi.. Can you upload the modify file to this page so I can download and try? I made the modify on the file still does not work..
Thanks
Sam

9 Jul 2009, 2:53 AM
#23
crunch avatar

crunch

Zen Follower

Join Date:
Mar 2009
Posts:
227
Plugin Contributions:
0

Re: Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

Here you go. This is the modified file with the new code TJ1 posted and the additional movement of the new code down a few lines as Phil020782 suggested (for PayPal Express in 1.3.8a).

Place in: /includes/modules/payment/paypal/

You will then get the Order Refunds box and it will be formatted next to the Voiding Order Authorizations box.

Backup the file you currently have before overwriting it with this one in case something goes wrong :shocking:

10 Jul 2009, 2:03 PM
#24
topcat24 avatar

topcat24

New Zenner

Join Date:
Jul 2007
Posts:
45
Plugin Contributions:
0

Re: Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

When making a partial refund it comes back with error code 10009 as the currency does not match, but the full refund does work.
I have the currency set as GBP only and currency as GBP in zencart, is anyone else having problems with partial refunds?

England's 1st Juggling Shop www.oddballs.co.uk

1 Oct 2009, 4:03 PM
#25
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

Crunch:

Just made the revisions that TJ1 posted on page 1, in addition to moving the new code down a few lines as Phil020782 suggested on page 2 so that the refund box shows up next to the void box.

Here is how it looks now with new code added in red in new location. I now have a Order Refunds box and it's formatted next to the Voiding Order Authorizations box. Thanks! Hope this sticks in future versions.

/includes/modules/payment/paypal/paypalwpp_admin_notification.php:

} else { // PayPal
$output .= $outputPayPal;
if ($response['TRANSACTION_TYPE'] == 'Authorization' || ($response['TRANSACTIONTYPE'] == 'cart' && $response['PAYMENTTYPE'] == 'instant' && $response['PENDINGREASON'] == 'authorization') || (isset($_GET['authcapt']) && $_GET['authcapt']=='on')) {
$output .= $outputEndBlock;
$output .= $outputEndBlock;
$output .= $outputStartBlock;
$output .= $outputStartBlock;
if (method_exists($this, '_doRefund') && ($response['PAYMENTTYPE'] != 'instant' || $module == 'paypaldp')) $output .= $outputRefund;
if (method_exists($this, '_doAuth') && MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only') $output .= $outputAuth;
if (method_exists($this, '_doCapt') && MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only') $output .= $outputCapt;
if (method_exists($this, '_doVoid')) $output .= $outputVoid;
} else {
if (method_exists($this, '_doRefund') && ($response['PAYMENTTYPE'] != 'instant' || $module == 'paypaldp')) $output .= $outputRefund;
if (method_exists($this, '_doVoid') && $response['PAYMENTTYPE'] == 'instant' && $response['PAYMENTSTATUS'] != 'Voided' && $module != 'paypaldp') $output .= $outputVoid;
if (method_exists($this, '_doCapt') && (MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE == 'Auth Only' || (isset($_GET['authcapt']) && $_GET['authcapt']=='on'))) $output .= $outputCapt;
if (method_exists($this, '_doRefund')) $output .= $outputRefund;
}
}

 
 
I added Crunch's red code and it seems to work fine for the item I went to paypal and captured (the capture and refund boxes are showing) .... execpt on a new order these boxes are not showing....   and I would like the capture box to show so that I don't have to go to Paypal to capture.... thoughts?
1 Oct 2009, 4:44 PM
#26
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

tj1:

For anyone interested, I just want to confirm that the edit I mentioned above works.

I'm still not sure if I'm the only one with this issue or if this is in fact missing from ZC 1.3.8

For those of you coming from the other thread about 'No Refunds', please try this, just like in the previous code, edit the file paypalwpp_admin_notification.php

Almost at the bottom of the file right after

} else { // PayPal

>  
> insert this:
> ```php
if (method_exists($this, '_doCapt') && (MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE == 'Auth Only' || (isset($_GET['authcapt']) && $_GET['authcapt']=='on'))) $output .= $outputCapt;
if (method_exists($this, '_doRefund')) $output .= $outputRefund;

This should give you the capture and refunds boxes.

Please report if it works.

Followed TJ1's instructions and now capture is showing.

18 Oct 2009, 11:40 PM
#27
tick avatar

tick

New Zenner

Join Date:
Jun 2007
Location:
Phoenix, AZ
Posts:
66
Plugin Contributions:
0

Re: Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

First of all, thank you very much to everyone who has contributed to this thread. We just decided to start doing authorizations instead of payments and experienced this issue. This thread saved me hours of slogging though the PayPal code!

I do however, have one recommended change to address Dr. Byte's comment about not all orders being refundable/capturable. Rather than thwart the logic in the if statement by moving the capture logic outside of it, simply correct the logic so that:

if ($response['TRANSACTION_TYPE'] == 'Authorization' || ($response['TRANSACTIONTYPE'] == 'cart' && $response['PAYMENTTYPE'] == 'instant' && $response['PENDINGREASON'] == 'authorization') || (isset($_GET['authcapt']) && $_GET['authcapt']=='on')) {
```becomes

```php
if ($response['TRANSACTION_TYPE'] == 'Authorization' || (in_array($response['TRANSACTIONTYPE'], array('cart','expresscheckout','webaccept') ) && $response['PAYMENTTYPE'] == 'instant' && $response['PENDINGREASON'] == 'authorization') || (isset($_GET['authcapt']) && $_GET['authcapt']=='on')) {
```Now express checkouts, normal checkouts, and checkouts that don't send line-item details (which we get a lot of) will show the capture section on the order screen.

Thanks again everyone!

Generations Crafting (Our Zen-Cart storefront)
"
And that's just it, Doc - my mind has always been my Achilles' heel!" -- The Tick

1 Dec 2009, 2:44 AM
#28
talk2kmf avatar

talk2kmf

New Zenner

Join Date:
Mar 2008
Posts:
18
Plugin Contributions:
0

Re: Help, how do you capture funds from within ZC 1.3.8? (PayPal Express)

So now those of us just using PayPal Express Checkout can get the buttons to show up in the Order Admin. However...

There's still a problem.

Using the capture function works. The funds are captured in Paypal and the transaction details show in the comments area. (Except there is no Recepit ID in the response message and a blank Auth Code in the comments).

However the Transaction ID is NOT updated. In the PayPal logs the original transaction id for the authorization becomes the "Parent ID" (parent_txn_id) and a new number is assigned to the "Transaction ID" (txn_id) which is associated with the capture transaction (transfer of funds).

But in the details on the order page, no Parent ID is shown and the old Transaction ID is still there. When I check the database I see that the Capture function did not write to the parent_txn_id nor update the txn_id which should have the new id #.

The log from Paypal shows that PayPal sent over the new data.

Relevant data from POST: 
txn_type = parent 
parent_txn_id = 9AG04XXXXXX4120E 
txn_id = 26R27XXXX898700A

Without this update, Refunds do not work. They give a 10009 error "You can not refund this type of transaction" because Zen Cart is sending the Authorization's Transaction ID (i.e. 9AG04...) instead of the Capture's Transaction ID (i.e. 26R27...)

When I manually update the Transaction ID in the database I can process the refund without a problem. So I don't believe this is a problem with the refund function. (In fact, the refund function DOES update the transaction id AND parent id in the database).

If anyone using 1.3.8a has capture and refunds working with PayPal Express (ONLY), can you tell me if processing a capture updates the Transaction ID and the Parent ID on your order admin page?
Are you getting a receipt id? Auth code?

One workaround would be to enter the ID as part of the refund function just like with Voids. Now if I could just figure out how to make that happen...

Any help, suggestions, insights would be much appreciated!

KMF