Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Addon Payment Modules / Checkout Error

Checkout Error

Started by mike_m29 on 25 Apr 2012, 8:34 PM · Views: 5,601

Results 1 to 20 of 27
25 Apr 2012, 8:34 PM
#1
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Checkout Error

Hi

I am fairly new to this and am not sure if this is the right place, please re-direct me if it is not

I am just finishing up my cart and am testing the credit card processing. The system works properly including seeing the transaction approve and getting the order confirmation emails.

My problem is that instead of getting the proper "checkout_success" notification, I get a white page with an error that says "Warning: an error occurred, please refresh the page and try again"

If I refresh the page, it resends the information to be authorized and declines the second time because of a duplicate transaction.

I can't figure out why the proper checkout_success page is not being shown

any help would be greatly appreciated

26 Apr 2012, 2:47 PM
#3
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

thank you for the way to start...i have found an error that is occurring but my PHP is very very limited

Debug Error:

[26-Apr-2012 10:37:46] PHP Warning: Division by zero in /hermes/bosweb25c/b1102/nf.bow-shop/public_html/secure/store/includes/classes/shipping.php on line 106
[26-Apr-2012 10:37:46] PHP Warning: Division by zero in /hermes/bosweb25c/b1102/nf.bow-shop/public_html/secure/store/includes/classes/shipping.php on line 108

Below is the code for the section indicated: 3rd line (106) and 5th line (108)

if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes
// $shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT);
$zc_boxes = zen_round(($shipping_weight/SHIPPING_MAX_WEIGHT), 2);
$shipping_num_boxes = ceil($zc_boxes);
$shipping_weight = $shipping_weight/$shipping_num_boxes;
}
}
$this->notify('NOTIFY_SHIPPING_MODULE_CALCULATE_BOXES_AND_TARE');
}

function quote($method = '', $module = '', $calc_boxes_weight_tare = true) {
$quotes_array = array();

if ($calc_boxes_weight_tare) $this->calculate_boxes_weight_and_tare();

Any help on how to fix this would be very much appreciated, thank you

26 Apr 2012, 4:16 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Checkout Error

What do you have your maximum shipping weight set to ?

26 Apr 2012, 4:28 PM
#5
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

stevesh:

What do you have your maximum shipping weight set to ?

It was set to "nothing" like blank

26 Apr 2012, 6:30 PM
#6
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

I have now fixed the above errors with putting in a max shipping rate, not I get this error:

[26-Apr-2012 13:17:39] PHP Warning: Invalid argument supplied for foreach() in /hermes/bosweb25c/b1102/nf.bow-shop/public_html/secure/store/includes/modules/pages/checkout_shipping/header_php.php on line 191

Again I really have no idea how to fix this, since I really don't understand what the problem is

thanks again for the help, I really appreciate it

26 Apr 2012, 6:32 PM
#7
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

mike_m29:

I have now fixed the above errors with putting in a max shipping rate, not I get this error:

[26-Apr-2012 13:17:39] PHP Warning: Invalid argument supplied for foreach() in /hermes/bosweb25c/b1102/nf.bow-shop/public_html/secure/store/includes/modules/pages/checkout_shipping/header_php.php on line 191

Again I really have no idea how to fix this, since I really don't understand what the problem is

thanks again for the help, I really appreciate it

Sorry forgot to include the code:

// get all available shipping quotes
$quotes = $shipping_modules->quote();

// check that the currently selected shipping method is still valid (in case a zone restriction has disabled it, etc)
if (isset($_SESSION['shipping']) && $_SESSION['shipping'] != FALSE && $SESSION['shipping'] != '') {
$checklist = array();
foreach ($quotes as $key=>$val) {
foreach($val['methods'] as $key2=>$method) { --------------------------This is the code line indicated
$checklist[] = $val['id'] . '
' . $method['id'];
}
}
$checkval = (is_array($_SESSION['shipping']) ? $_SESSION['shipping']['id'] : $_SESSION['shipping']);
if (!in_array($checkval, $checklist)) {
$messageStack->add('checkout_shipping', ERROR_PLEASE_RESELECT_SHIPPING_METHOD, 'error');
}
}

26 Apr 2012, 8:31 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: Checkout Error

What shipping and payment modules are you using?

What settings would I have to change in my brand-new-fresh-install-and-uncustomized store to exactly recreate your symptoms on my store?

.
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.

26 Apr 2012, 8:53 PM
#9
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

I am using the Canada Post Shipping Module

  • using 66 for Max weight
  • all my products have weights assigned to them
  • enable CP handling charge
  • tax basis:shipping
  • I have tax definitions setup for Canada and a free shipping definition for 1 product group
  • I have all the proper boxes and settings done with Canada Post

I am not sure from there what else I can say

I have tried going back to the original Classic template as I read this is a good idea to ensure pages are working, except when I switched, I couldn't access my page or admin section. I had posted a thread about this and did not receive any responses, I eventually switched it back to my current template andover_modern directly in the database.

26 Apr 2012, 9:05 PM
#10
drbyte avatar

drbyte

Sensei

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

Re: Checkout Error

mike_m29:

I have tried going back to the original Classic template as I read this is a good idea to ensure pages are working, except when I switched, I couldn't access my page or admin section.
Assuming that your vague description of "I couldn't access" actually means "I got blank pages when trying to access", that's a very clear indication of having PHP errors which cause blank pages. Troubleshooting advice for that can be found at: https://www.zen-cart.com/tutorials/index.php?article=82

.
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.

26 Apr 2012, 9:08 PM
#11
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

My apologies, this was the thread I had posted earlier


index.php won't load after changing template
Hi Everyone

I switched back to the Classic Template to double check on a page that was not loading.

After I did this, I went to try a checkout in the Classic Template to find that my site will no longer load. I get the following error

Server error
The website encountered an error while retrieving http://www.bow-shop.com/secure/store/index.php. It may be down for maintenance or configured incorrectly.

The same goes for the admin area, I cannot login to it either to switch back, I get the following error:

Server error
The website encountered an error while retrieving https://www.bow-shop.com/secure/stor...9d0b043d41bfdb. It may be down for maintenance or configured incorrectly.

Any help in how to get this fixed and back to working again would be greatly appreciated.

26 Apr 2012, 9:09 PM
#12
drbyte avatar

drbyte

Sensei

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

Re: Checkout Error

mike_m29:

I am using the Canada Post Shipping Module
So is this really the same issue as the other thread you just started? http://www.zen-cart.com/showthread.php?195417-XML-parsing-error-Canada-Post

.
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.

26 Apr 2012, 9:11 PM
#13
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

DrByte:

Assuming that your vague description of "I couldn't access" actually means "I got blank pages when trying to access", that's a very clear indication of having PHP errors which cause blank pages. Troubleshooting advice for that can be found at: https://www.zen-cart.com/tutorials/index.php?article=82

I have been reading through that page, and have been using the Debug logs...I have solved a couple syntax errors, but this is the latest log entry since I solved the others on. The above error log only appeared after I fixed two others.

26 Apr 2012, 9:13 PM
#14
drbyte avatar

drbyte

Sensei

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

Re: Checkout Error

Oy oy oy oy oy

You're making me dizzy by copying and pasting complete other posts/discussions into other new discussions. If there's something that needs its own thread, start a thread for that. But if you're already talking about the same thing somewhere else, don't create another discussion for a topic you've already started a discussion on. And for goodness sake, don't copy stuff from the other threads into new threads. If it's worth creating a cross-reference, copy the URL so we can see the entire other discussion instead of just a paragraph that could be completely out of context.

.
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.

26 Apr 2012, 9:14 PM
#15
drbyte avatar

drbyte

Sensei

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

Re: Checkout Error

mike_m29:

I have been reading through that page, and have been using the Debug logs...I have solved a couple syntax errors, but this is the latest log entry since I solved the others on. The above error log only appeared after I fixed two others.
Okay ... then that begs an answer to a very important question: did the thing you changed to "solve" the other problem actually cause the new one?

.
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.

26 Apr 2012, 9:27 PM
#16
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

DrByte:

Oy oy oy oy oy

You're making me dizzy by copying and pasting complete other posts/discussions into other new discussions. If there's something that needs its own thread, start a thread for that. But if you're already talking about the same thing somewhere else, don't create another discussion for a topic you've already started a discussion on. And for goodness sake, don't copy stuff from the other threads into new threads. If it's worth creating a cross-reference, copy the URL so we can see the entire other discussion instead of just a paragraph that could be completely out of context.

Again I am sorry...at times I am unsure what is related to each other. Problem is I don't know if I my problems are related to each other or if they are different issues. For someone with only a beginning knowledge of PHP it is sometimes hard to figure that out.

My problem is that after checking out, when the card is declined I get a white screen with a URL that says the "card was declined" and when approved instead of the proper "checkout_success" page being loaded I get a white screen with an error ""Warning: an error occurred, please refresh the page and try again" but the transaction is approved and the order emails are properly sent. If I refresh the page as the warning says, it duplicates the sale.

I don't know if this is a shipping module, payment module or a base file problem. Been trying to figure that out from the start

sorry I have been posting multiple threads, just hoping I can get an answer from someone that will solve my problem. I am just not sure where or what to look at, at this point.

26 Apr 2012, 9:38 PM
#17
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

DrByte:

Okay ... then that begs an answer to a very important question: did the thing you changed to "solve" the other problem actually cause the new one?

the solution was completely syntax, at some point a ( ' ) had been removed, so I replaced it that was the only issue, at least on the debug logs I had first received

26 Apr 2012, 10:09 PM
#18
drbyte avatar

drbyte

Sensei

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

Re: Checkout Error

mike_m29:

My problem is that after checking out, when the card is declined I get a white screen with a URL that says the "card was declined" and when approved instead of the proper "checkout_success" page being loaded I get a white screen with an error ""Warning: an error occurred, please refresh the page and try again" but the transaction is approved and the order emails are properly sent. If I refresh the page as the warning says, it duplicates the sale.

I don't know if this is a shipping module, payment module or a base file problem.
I look at it this way: a payment-related issue such as "card declined" would be caused by a problem in either the payment module or (less likely) the core code that handles payments. If you've not customized the core code that handles checkout (and there's rarely any good reason to do so) then I would focus on the payment module.

In the case of "approved" but a blank screen, what is the URL in your address bar? You said you don't get your expected "checkout_success" ... so, what do you get?

Which payment module is involved, anyway? I think I asked that earlier.

I don't see this being related to shipping unless you've got something in your shipping module code that's intended to fire after payment is completed, which is highly unlikely.

.
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.

26 Apr 2012, 10:50 PM
#19
mike_m29 avatar

mike_m29

New Zenner

Join Date:
Nov 2011
Posts:
46
Plugin Contributions:
0

Re: Checkout Error

I think my issue with getting a white screen for "approved" transactions has been solved, I re-uploaded all the PSIGate files (for the 3rd time) and tried again and this time the proper checkout_success page came up as it should. I need to do more testing to ensure I am not getting anymore errors. But at least the proper response page returned this time.

As for "declined" transactions, I still get just a white screen with just a URL in the address bar that indicates it was declined. Is there a way to get a proper response page?

Again I apologize for all the jumping around, as I said, I am still learning and kind of jumping in head first.

I really appreciate the time you have taken to help me out

26 Apr 2012, 11:04 PM
#20
drbyte avatar

drbyte

Sensei

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

Re: Checkout Error

That blank page is either something that's happening by PSIGate, or by the module (either bad error handling which aborts everything else, instead of returning a nice error message .... or or a PHP error that's causing the script to abort).

.
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.