Post by OC2PS » Fri Jan 28, 2022 7:18 am

On my website arcfestek.hu
which has only one currency (Ft / HUF )
On the Checkout page (checkout/checkout)
the Payment Details section shows the following error:

Code: Select all

Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 25
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 25
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 26
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 26
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 27
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 27
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 30
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 30
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 25
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 25
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 26
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 26
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 27
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 27
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 30
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 30
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 25
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 25
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 26
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 26
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 27
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 27
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 30
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 30
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 25
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 25
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 26
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 26
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 27
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 27
Notice: Undefined index: in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 30
Notice: Trying to access array offset on value of type null in /home/customer/www/arcfestek.hu/public_html/system/library/cart/currency.php on line 30
which prevents checkout.

Any suggestions or ideas?

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by mikeinterserv » Fri Jan 28, 2022 7:38 am

Contact the theme developer
It is a theme issue.

These are Notices and would not display if error reporting was turned off.
I would fix the problem first though anyway.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by khnaz35 » Fri Jan 28, 2022 8:13 am

Have you deleted the default currency USD?

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by ADD Creative » Fri Jan 28, 2022 5:47 pm

OC2PS wrote:
Fri Jan 28, 2022 7:18 am
Any suggestions or ideas?
Could be an issue with your one page checkout and your payment extension. Try disabling your one page checkout.

Once you have fixed it, you need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, like you have found, it can also be a security risk.

1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.

2. In system/config/default.php set error_display to false.

3. In your OpenCart Setting on the server tab set Display Errors to No.
Last edited by ADD Creative on Fri Jan 28, 2022 10:23 pm, edited 1 time in total.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by OC2PS » Fri Jan 28, 2022 9:38 pm

khnaz35 wrote:
Fri Jan 28, 2022 8:13 am
Have you deleted the default currency USD?
I have, yes.

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by OC2PS » Fri Jan 28, 2022 9:49 pm

ADD Creative wrote:
Fri Jan 28, 2022 5:47 pm
Could be an issue with your one page checkout and your payment extension. Try disabling your one page checkout.
Yeah, I know it is coming from the payment extension Stripe Payments Pro by DigitalBird as it occures only when this payment extension is enabled.

If I try to check out regardless, I get a popup/toast:

Code: Select all

Error sessionPost
And Chrome Console says:

Code: Select all

=== initStripeSafe
module: journal3
initTypeCheckoutPage
<b>Notice</b>: Undefined index: REQUEST_SCHEME in <b>/home/customer/www/arcfestek.hu/public_html/system/library/bird/esp/front.php</b> on line <b>254</b><br />
<b>Fatal error</b>: Uncaught (Status 400) (Request req_0OyE0jXmsd4fSo) Not a valid URL
thrown in <b>/home/customer/www/arcfestek.hu/public_html/system/library/stripe-php-7.46.1/lib/Exception/ApiErrorException.php</b> on line <b>38</b><br />

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by khnaz35 » Fri Jan 28, 2022 10:31 pm

Then, I will suggest adding back the currency, and you can just disable it; the error should go off.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by ADD Creative » Fri Jan 28, 2022 10:44 pm

That last error is a problem with your payment extension. It's using $_SERVER['REQUEST_SCHEME'] to build a URL. However, not all servers (including yours) support $_SERVER['REQUEST_SCHEME'].

Your currency issue could be a result of that error or another assumption made by the payment extension. Checking both your PHP and OpenCart error logs may give you more information. Probably best to contact the extension developer.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by OC2PS » Sat Jan 29, 2022 10:36 am

khnaz35 wrote:
Fri Jan 28, 2022 10:31 pm
I will suggest adding back the currency, and you can just disable it; the error should go off.
Tried. Didn't help.

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by khnaz35 » Sat Jan 29, 2022 10:43 am

Noted

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by OC2PS » Sat Jan 29, 2022 10:52 am

ADD Creative wrote:
Fri Jan 28, 2022 10:44 pm
That last error is a problem with your payment extension. It's using $_SERVER['REQUEST_SCHEME'] to build a URL. However, not all servers (including yours) support $_SERVER['REQUEST_SCHEME'].

Your currency issue could be a result of that error or another assumption made by the payment extension. Checking both your PHP and OpenCart error logs may give you more information. Probably best to contact the extension developer.
The extension developer seems unresponsive. :-\

PHP log has this

Code: Select all

[28-Jan-2022 13:16:11 UTC] PHP Fatal error:  Uncaught (Status 400) (Request req_0OyE0jXmsd4fSo) Not a valid URL
  thrown in /home/customer/www/arcfestek.hu/public_html/system/library/stripe-php-7.46.1/lib/Exception/ApiErrorException.php on line 38
ApiErrorException.php line 38 is the start of public function factory

Code: Select all

30    public static function factory(
31        $message,
32        $httpStatus = null,
33        $httpBody = null,
34        $jsonBody = null,
35        $httpHeaders = null,
36        $stripeCode = null
37    ) {
38        $instance = new static($message);
What's the substitute for

Code: Select all

$_SERVER['REQUEST_SCHEME']
?

I found it in /system/library/bird/esp/front.php line 254

Code: Select all

249    public function sessionPost() {
250        $json = array();
251        $this->load->language($this->full_route);
252        $cur  = $this->getConfig('license_key');
253        $ver  = $this->language->get('version') . $this->getVerSuffix();
254        $b    = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER["SERVER_NAME"] . '/';
255
256        // order info
257        $this->load->model('checkout/order');
258        $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
259        $this->load->model('tool/image');
260        $this->config->get('config_customer_price');
261
262        $seed = $this->random_int(2, 100);
263        $sessiondata = $this->post739($b, $ver, $cur, $seed, $order_info);

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by OC2PS » Sat Jan 29, 2022 11:18 am

ADD Creative wrote:
Fri Jan 28, 2022 10:44 pm
That last error is a problem with your payment extension. It's using $_SERVER['REQUEST_SCHEME'] to build a URL. However, not all servers (including yours) support $_SERVER['REQUEST_SCHEME'].
I hardcoded line 254 to

Code: Select all

254        $b    = 'https://' . $_SERVER["SERVER_NAME"] . '/';
and the bigger error (i.e. #2, i.e. checkout not working) went away.

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by ADD Creative » Sat Jan 29, 2022 11:27 pm

As long as your server can only be accessed with https then hardcoding it shouldn't be a problem. In fact it's probably better.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 258 guests