Zen Cart Logo
Forums / Upgrading to 2.x.x / Payment Capture in ZC 2.1.0? How/where is it?

Payment Capture in ZC 2.1.0? How/where is it?

Views: 8,908

Results 1 to 20 of 28
23 Jan 2025, 6:12 AM
#1
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Payment Capture in ZC 2.1.0? How/where is it?

Zen Cart: 2.1.0
PHP Version:
8.3.15 (Zend: 4.3.15)
Database Engine: MySQL 10.5.27-MariaDB

I ran a couple of test orders, one for credit card and the other for PayPal,
every thing went fine. by default, all orders are authorization until goods are shipped.

Now i do not see a way to Capture the payment on the order page, i see "Voiding Order Authorizations" and "Order Refunds". Am I missing anything?

23 Jan 2025, 10:27 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,710
Plugin Contributions:
56

Re: Payment Capture in ZC 2.1.0? How/where is it?

Perhaps you have your payment methods set to Authorize+Capture already? (vs. just Authorize?)

This documentation might clarify:
https://docs.zen-cart.com/user/payment/auth_only/

23 Jan 2025, 11:11 AM
#3
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

swguy:

Perhaps you have your payment methods set to Authorize+Capture already? (vs. just Authorize?)

Thanks for the reply, i doubled check that before posting
This is the settings
Payment Action
Auth Only

This from the order in the Admin

Trans. Type: cart
Payment Type: instant
Payment Status: Pending
Pending Reason: authorization

Paypal also shows as pending.

23 Jan 2025, 11:18 AM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,710
Plugin Contributions:
56

Re: Payment Capture in ZC 2.1.0? How/where is it?

Which PayPal are you using? (Built-in or RESTful?). Which variant (Express, Website Payments Pro? Standard?)

23 Jan 2025, 1:02 PM
#5
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

swguy:

Which PayPal are you using? (Built-in or RESTful?). Which variant (Express, Website Payments Pro? Standard?)

I am using built-in PayPal
Express and Website Payments Pro

23 Jan 2025, 1:18 PM
#6
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

Attachment 20876

This what i see.

18 Feb 2025, 12:49 PM
#7
spminis avatar

spminis

Zen Follower

Join Date:
Feb 2015
Location:
USA
Posts:
194
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

I'm having the same problem. Was this ever resolved?
Thanks
Carol

19 Feb 2025, 2:40 PM
#8
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

spminis:

I'm having the same problem. Was this ever resolved?
Thanks
Carol
Not to my knowledge.

20 Jun 2025, 8:43 PM
#9
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

spminis:

I'm having the same problem. Was this ever resolved?
Thanks
Carol

Hi Carol,

Have you resolved this problem? It is getting annoying to capture payment from PayPal rather than doing it from the admin. Thanks.:frusty:

24 Jun 2025, 11:49 AM
#10
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

Does anyone else have this problem?
It seems it is something to do with settings since not many users are talking about, i searched and searched and could not find any help with this issue

27 Jun 2025, 4:39 PM
#11
dsc7050 avatar

dsc7050

New Zenner

Join Date:
Sep 2018
Location:
UUSA
Posts:
44
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

we have the same issue. anyone have the solution?

27 Jun 2025, 5:19 PM
#12
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,097
Plugin Contributions:
56

Re: Payment Capture in ZC 2.1.0? How/where is it?

spminis:

I'm having the same problem. Was this ever resolved?
Thanks
Carol

TamyA:

Hi Carol,

Have you resolved this problem? It is getting annoying to capture payment from PayPal rather than doing it from the admin. Thanks.:frusty:

TamyA:

Not to my knowledge.

TamyA:

Does anyone else have this problem?
It seems it is something to do with settings since not many users are talking about, i searched and searched and could not find any help with this issue

dsc7050:

we have the same issue. anyone have the solution?
For all of you having this issue, do you have both paypalwpp (PayPal Express Checkout) and paypaldp (PayPal Payments Pro) enabled?

I'm guessing both, since without paypaldp enabled I'd expect you to be getting PHP Fatal (or Warning) errors logged each time you view an order in the admin.

27 Jun 2025, 6:06 PM
#13
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,097
Plugin Contributions:
56

Re: Payment Capture in ZC 2.1.0? How/where is it?

Let's give this a try. First, make a backup of your site's /includes/modules/payment/paypal/paypalwpp_admin_notification.php. Then find this section (starting at line 448 in the as-shipped zc210 version):

$authcapt_on = (isset($_GET['authcapt']) && $_GET['authcapt'] == 'on');

if (isset($response['RESPMSG']) /*|| defined('MODULE_PAYMENT_PAYFLOW_STATUS')*/) { // payflow
    $output .= $outputPFmain;
    if (method_exists($this, '_doVoid') && (MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only' || (defined('MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE') && MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only') || $authcapt_on)) {
        $output .= $outputVoid;
    }
    if (method_exists($this, '_doCapt') && (MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only' || (defined('MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE') && MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only') || $authcapt_on)) {
        $output .= $outputCapt;
    }
    if (method_exists($this, '_doRefund')) {
        $output .= $outputRefund;
    }
} else {  // PayPal
    $output .= $outputPayPal; // one table row, four cells, one table in each
    $output .= $outputEndBlock; // close first table

    if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') || defined('MODULE_PAYMENT_PAYPALDP_STATUS')) {
        $output .= $outputStartBlock; //start second table

        $transaction_type_authorization = (isset($response['TRANSACTION_TYPE']) && $response['TRANSACTION_TYPE'] == 'Authorization');
        $transactiontype_payment = (isset($response['TRANSACTION_TYPE']) && in_array($response['TRANSACTIONTYPE'], ['cart', 'expresscheckout', 'webaccept']));
        if ($transaction_type_authorization || ($transactiontype_payment && $response['PAYMENTTYPE'] == 'instant' && $response['PENDINGREASON'] == 'authorization') || $authcapt_on) {
            if (method_exists($this, '_doRefund') && ($response['PAYMENTTYPE'] != 'instant' || $module == 'paypaldp')) {
                $output .= $outputRefund;
            }
            if (MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE == 'Auth Only' || MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only') {
                if (method_exists($this, '_doAuth')) {
                    $output .= $outputAuth;
                }
                if (method_exists($this, '_doCapt')) {
                    $output .= $outputCapt;
                }
            }

Make the highlighted changes/additions:

$authcapt_on = (isset($_GET['authcapt']) && $_GET['authcapt'] == 'on');
[B]$transaction_mode = ($this->code === 'paypaldp') ? MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE : MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE;[/B]

if (isset($response['RESPMSG']) /*|| defined('MODULE_PAYMENT_PAYFLOW_STATUS')*/) { // payflow
    $output .= $outputPFmain;

    if (method_exists($this, '_doVoid') && ([B]$transaction_mode ===[/B] 'Auth Only' || (defined('MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE') && MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only') || $authcapt_on)) {
        $output .= $outputVoid;
    }
    if (method_exists($this, '_doCapt') && ([B]$transaction_mode ===[/B] 'Auth Only' || (defined('MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE') && MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only') || $authcapt_on)) {
        $output .= $outputCapt;
    }
    if (method_exists($this, '_doRefund')) {
        $output .= $outputRefund;
    }
} else {  // PayPal
    $output .= $outputPayPal; // one table row, four cells, one table in each
    $output .= $outputEndBlock; // close first table

    if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') || defined('MODULE_PAYMENT_PAYPALDP_STATUS')) {
        $output .= $outputStartBlock; //start second table

        $transaction_type_authorization = (isset($response['TRANSACTION_TYPE']) && $response['TRANSACTION_TYPE'] == 'Authorization');
        $transactiontype_payment = (isset($response['TRANSACTION_TYPE']) && in_array($response['TRANSACTIONTYPE'], ['cart', 'expresscheckout', 'webaccept']));
        if ($transaction_type_authorization || ($transactiontype_payment && $response['PAYMENTTYPE'] == 'instant' && $response['PENDINGREASON'] == 'authorization') || $authcapt_on) {
            if (method_exists($this, '_doRefund') && ($response['PAYMENTTYPE'] != 'instant' || $module == 'paypaldp')) {
                $output .= $outputRefund;
            }
            if ([B]$transaction_mode === 'Auth Only'[/B]) {
                if (method_exists($this, '_doAuth')) {
                    $output .= $outputAuth;
                }
                if (method_exists($this, '_doCapt')) {
                    $output .= $outputCapt;
                }
27 Jun 2025, 8:08 PM
#14
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

lat9:

Let's give this a try. First, make a backup of your site's /includes/modules/payment/paypal/paypalwpp_admin_notification.php. Then find this section (starting at line 448 in the as-shipped zc210 version):

$authcapt_on = (isset($_GET['authcapt']) && $_GET['authcapt'] == 'on');

if (isset($response['RESPMSG']) /|| defined('MODULE_PAYMENT_PAYFLOW_STATUS')/) { // payflow
$output .= $outputPFmain;
if (method_exists($this, '_doVoid') && (MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only' || (defined('MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE') && MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only') || $authcapt_on)) {
$output .= $outputVoid;
}
if (method_exists($this, '_doCapt') && (MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only' || (defined('MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE') && MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only') || $authcapt_on)) {
$output .= $outputCapt;
}
if (method_exists($this, '_doRefund')) {
$output .= $outputRefund;
}
} else { // PayPal
$output .= $outputPayPal; // one table row, four cells, one table in each
$output .= $outputEndBlock; // close first table

if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') || defined('MODULE_PAYMENT_PAYPALDP_STATUS')) {
    $output .= $outputStartBlock; //start second table

    $transaction_type_authorization = (isset($response['TRANSACTION_TYPE']) && $response['TRANSACTION_TYPE'] == 'Authorization');
    $transactiontype_payment = (isset($response['TRANSACTION_TYPE']) && in_array($response['TRANSACTIONTYPE'], ['cart', 'expresscheckout', 'webaccept']));
    if ($transaction_type_authorization || ($transactiontype_payment && $response['PAYMENTTYPE'] == 'instant' && $response['PENDINGREASON'] == 'authorization') || $authcapt_on) {
        if (method_exists($this, '_doRefund') && ($response['PAYMENTTYPE'] != 'instant' || $module == 'paypaldp')) {
            $output .= $outputRefund;
        }
        if (MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE == 'Auth Only' || MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only') {
            if (method_exists($this, '_doAuth')) {
                $output .= $outputAuth;
            }
            if (method_exists($this, '_doCapt')) {
                $output .= $outputCapt;
            }
        }
> Make the highlighted changes/additions:
> ```
$authcapt_on = (isset($_GET['authcapt']) && $_GET['authcapt'] == 'on');
[B]$transaction_mode = ($this->code === 'paypaldp') ? MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE : MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE;[/B]

if (isset($response['RESPMSG']) /*|| defined('MODULE_PAYMENT_PAYFLOW_STATUS')*/) { // payflow
    $output .= $outputPFmain;

    if (method_exists($this, '_doVoid') && ([B]$transaction_mode ===[/B] 'Auth Only' || (defined('MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE') && MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only') || $authcapt_on)) {
        $output .= $outputVoid;
    }
    if (method_exists($this, '_doCapt') && ([B]$transaction_mode ===[/B] 'Auth Only' || (defined('MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE') && MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only') || $authcapt_on)) {
        $output .= $outputCapt;
    }
    if (method_exists($this, '_doRefund')) {
        $output .= $outputRefund;
    }
} else {  // PayPal
    $output .= $outputPayPal; // one table row, four cells, one table in each
    $output .= $outputEndBlock; // close first table

    if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') || defined('MODULE_PAYMENT_PAYPALDP_STATUS')) {
        $output .= $outputStartBlock; //start second table

        $transaction_type_authorization = (isset($response['TRANSACTION_TYPE']) && $response['TRANSACTION_TYPE'] == 'Authorization');
        $transactiontype_payment = (isset($response['TRANSACTION_TYPE']) && in_array($response['TRANSACTIONTYPE'], ['cart', 'expresscheckout', 'webaccept']));
        if ($transaction_type_authorization || ($transactiontype_payment && $response['PAYMENTTYPE'] == 'instant' && $response['PENDINGREASON'] == 'authorization') || $authcapt_on) {
            if (method_exists($this, '_doRefund') && ($response['PAYMENTTYPE'] != 'instant' || $module == 'paypaldp')) {
                $output .= $outputRefund;
            }
            if ([B]$transaction_mode === 'Auth Only'[/B]) {
                if (method_exists($this, '_doAuth')) {
                    $output .= $outputAuth;
                }
                if (method_exists($this, '_doCapt')) {
                    $output .= $outputCapt;
                }

Hi Cindy,

I changed the code in the 4 locations in red and i placed a small test order using credit card and the result is the same but without the void option.
Attachment 20997

27 Jun 2025, 9:56 PM
#15
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,097
Plugin Contributions:
56

Re: Payment Capture in ZC 2.1.0? How/where is it?

TamyA:

Hi Cindy,

I changed the code in the 4 locations in red and i placed a small test order using credit card and the result is the same but without the void option.
Attachment 20997
Thanks for giving that a shot; I'm back to the "drawing board".

28 Jun 2025, 12:44 PM
#16
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,097
Plugin Contributions:
56

Re: Payment Capture in ZC 2.1.0? How/where is it?

lat9:

Thanks for giving that a shot; I'm back to the "drawing board".
Let's start with the basics:

  1. Which of the two payment modules (paypalwpp and paypaldp) are enabled?
  2. For each enabled module, what is the setting for the "Transaction Mode" (Final Sale vs. Auth Only)?
28 Jun 2025, 12:46 PM
#17
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

lat9:

Thanks for giving that a shot; I'm back to the "drawing board".
I also noticed that i am getting a warning when i select the PayPal button when i check out.

[27-Jun-2025 19:36:18 UTC] Request URI: /ipn_main_handler.php?type=ec, IP address: x.x.x.x, Language id 1
#1 ot_shipping->process() called at [/includes/classes/order_total.php:229]
#2 order_total->pre_confirmation_check() called at [/includes/modules/payment/paypalwpp.php:1636]
#3 paypalwpp->ec_step1() called at [/ipn_main_handler.php:81]
--> PHP Warning: Undefined array key "country_id" in /includes/modules/order_total/ot_shipping.php on line 67.

[27-Jun-2025 19:36:18 UTC] Request URI: /ipn_main_handler.php?type=ec, IP address: x.x.x.x, Language id 1
#1 ot_shipping->process() called at [/includes/classes/order_total.php:96]
#2 order_total->process() called at [/includes/modules/payment/paypalwpp.php:1637]
#3 paypalwpp->ec_step1() called at [/ipn_main_handler.php:81]
--> PHP Warning: Undefined array key "country_id" in /includes/modules/order_total/ot_shipping.php on line 67.

I am not sure if that helps or not.

28 Jun 2025, 12:52 PM
#18
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

lat9:

Let's start with the basics:

  1. Which of the two payment modules (paypalwpp and paypaldp) are enabled?
    Attachment 20998
    lat9:

Let's start with the basics:
2) For each enabled module, what is the setting for the "Transaction Mode" (Final Sale vs. Auth Only)?
Payment Action
Auth Only
for both of them

30 Jun 2025, 2:24 PM
#19
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,097
Plugin Contributions:
56

Re: Payment Capture in ZC 2.1.0? How/where is it?

@TamyA gave me admin and FTP access (thanks!) and I've found the source of the issue.

I've submitted the correction to GitHub (https://github.com/zencart/zencart/pull/7146/files) for the issue that started in zc201. For a quick patch, see line 471 of /includes/modules/payment/paypal/paypalwpp_admin_notification.php:

        $transactiontype_payment = (isset($response['TRANSACTION_TYPE']) && in_array($response['TRANSACTIONTYPE'], ['cart', 'expresscheckout', 'webaccept']));

and change to

        $transactiontype_payment = (isset($response['[B]TRANSACTIONTYPE[/B]']) && in_array($response['TRANSACTIONTYPE'], ['cart', 'expresscheckout', 'webaccept']));

... essentially, losing that underscore in the field name.

30 Jun 2025, 5:52 PM
#20
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Payment Capture in ZC 2.1.0? How/where is it?

lat9:

@TamyA gave me admin and FTP access (thanks!) and I've found the source of the issue.

I've submitted the correction to GitHub (https://github.com/zencart/zencart/pull/7146/files) for the issue that started in zc201. For a quick patch, see line 471 of /includes/modules/payment/paypal/paypalwpp_admin_notification.php:

    $transactiontype_payment = (isset($response['TRANSACTION_TYPE']) && in_array($response['TRANSACTIONTYPE'], ['cart', 'expresscheckout', 'webaccept']));
> and change to
> ```
        $transactiontype_payment = (isset($response['[B]TRANSACTIONTYPE[/B]']) && in_array($response['TRANSACTIONTYPE'], ['cart', 'expresscheckout', 'webaccept']));

... essentially, losing that underscore in the field name.

Thank you Cindy.