X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   X-Payments issues & questions (https://forum.x-cart.com/forumdisplay.php?f=50)
-   -   X-Payments Form not showing during checkout (https://forum.x-cart.com/showthread.php?t=70565)

deepblue_tiano 11-19-2014 01:45 PM

X-Payments Form not showing during checkout
 
Hi, we upgraded our store to the latest version of x-cart 4.6.5 currently it was under development and we subscribe to x-payments to accept credit cards on our site.

The problem we encounter is during checkout the credit card form from x-payments doesn't show up. It was just loading (please wait), we have to refresh the page before the form to show up. Our development site is under sub-directory of our live site.

http://www.stanley-home-products.com/shp/

What seems to be the problem here?

I am suspecting SSL issues since certificate is not present at the subdirectory where our dev store is located.

random 11-20-2014 03:20 AM

Re: X-Payments Form not showing during checkout
 
1 Attachment(s)
Quote:

Originally Posted by deepblue_tiano
Hi, we upgraded our store to the latest version of x-cart 4.6.5 currently it was under development and we subscribe to x-payments to accept credit cards on our site.

The problem we encounter is during checkout the credit card form from x-payments doesn't show up. It was just loading (please wait), we have to refresh the page before the form to show up. Our development site is under sub-directory of our live site.

http://www.stanley-home-products.com/shp/

What seems to be the problem here?

I am suspecting SSL issues since certificate is not present at the subdirectory where our dev store is located.


This is seems to be a known issue related to a PayPal payment methods only. Please apply the attached patch file to fix this issue.

It doesn't look like an SSL issue (because you see a form after page reload). But if X-Payments iframe is not loaded at all it can be caused by invalid certificate. To avoid this just open the X-Payments admin in the same browser first and approve/ignore all precautions about certificate. After that iframe should work correctly. Of course this is only related to a development copy.

cflsystems 11-20-2014 05:47 AM

Re: X-Payments Form not showing during checkout
 
Vladimir this patch, and the original which I believe is part of some XP patch, have bug. Just the other day I had to fix one cart because of this patch - the func_paypal_adjust_payment_data function is undefined in this case

x_load('paypal');

needs to be added before that line

random 11-20-2014 09:08 PM

Re: X-Payments Form not showing during checkout
 
Quote:

Originally Posted by cflsystems
Vladimir this patch, and the original which I believe is part of some XP patch, have bug. Just the other day I had to fix one cart because of this patch - the func_paypal_adjust_payment_data function is undefined in this case

x_load('paypal');

needs to be added before that line


The function "func_ajax_block_opc_payment()" we modify in this patch was added in X-Cart 4.6.0 and "x_load('paypal');" is already present here.
Earlier versions don't need this patch, so you may have been refering to some another issue. Generally, yes, if any custom code uses that function they should do "x_load('paypal');" prior calling it.

cflsystems 11-20-2014 10:50 PM

Re: X-Payments Form not showing during checkout
 
Ok then this is again discrepancy between upgrades and actual stock cart code. XC 4.4.5

/modules/One_Page_Checkout/checkout.php
the code in the store file
PHP Code:

if (!empty($payment_methods)) {

    foreach (
$payment_methods as $k => $payment_data) {

        
$payment_data['payment_script_url'] = (($payment_data['protocol'] == 'https' || $HTTPS) ? $https_location $http_location) . '/payment/' $payment_data['payment_script'];

        if (
$payment_data['paymentid'] == $paymentid) {
            
$smarty->assign('payment_script_url'$payment_data['payment_script_url']);
            
$smarty->assign('payment_method',     $payment_data['payment_method']);
        }

        if (
$payment_data['processor_file'] == 'ps_paypal_pro.php') {
            
// Adjust cc_data and payment template for paypal
            
list($payment_data) = func_paypal_adjust_payment_data($payment_data'One_Page_Checkout');
        }

        
$payment_methods[$k] = $payment_data;
    }



the code in the latest stock 4.4.5 installation
PHP Code:

if (!empty($payment_methods)) {
     
x_load('paypal');

    foreach (
$payment_methods as $k => $payment_data) {

        
$payment_data['payment_script_url'] = (($payment_data['protocol'] == 'https' || $HTTPS) ? $https_location $http_location) . '/payment/' $payment_data['payment_script'];

        if (
$payment_data['paymentid'] == $paymentid) {
            
$smarty->assign('payment_script_url'$payment_data['payment_script_url']);
            
$smarty->assign('payment_method',     $payment_data['payment_method']);
        }

        if (
$payment_data['processor_file'] == 'ps_paypal_pro.php') {
            
// Adjust cc_data and payment template for paypal
            
list($payment_data) = func_paypal_adjust_payment_data($payment_data'One_Page_Checkout');
        }

        
$payment_methods[$k] = $payment_data;
    }



cflsystems 11-20-2014 10:54 PM

Re: X-Payments Form not showing during checkout
 
You can see the missing x_load('paypal');
I am not sure how this had happen or the upgrade path for the store. It is just missing from there.
It is possible of course to be an upgrade mistake and not the files...

deepblue_tiano 11-21-2014 01:06 PM

Re: X-Payments Form not showing during checkout
 
Quote:

Originally Posted by random
The function "func_ajax_block_opc_payment()" we modify in this patch was added in X-Cart 4.6.0 and "x_load('paypal');" is already present here.
Earlier versions don't need this patch, so you may have been refering to some another issue. Generally, yes, if any custom code uses that function they should do "x_load('paypal');" prior calling it.


We are using 4.6.5 version if that patch is present in 4.6.0 why is that bug appear on our site? The patch solve the problem. Thanks!

BrianY 11-22-2014 03:27 PM

Re: X-Payments Form not showing during checkout
 
Don't know if this helps, but I believe the patch Random offered here is fairly new because it is the same patch they gave me to fix the issue reported in a bug tracker (https://bt.x-cart.com/view.php?id=44112) ticket I created on November 18th.

Very glad to have this issue fixed. We have been trying to use the iFrame with X-Cart OPC many times over the years through many versions of X-Cart and always had to revert to using the separate page. Now it seems to be working. Note: We use PayPal Pro. Did not know it was special, but the patch does seem to deal specifically with PayPal Pro. Very pleased to finally be able to use the iFrame.:D/

ambal 11-22-2014 10:47 PM

Re: X-Payments Form not showing during checkout
 
Brian, yes the issue was PayPal-specific and the patch addressed it.

random 11-24-2014 01:56 AM

Re: X-Payments Form not showing during checkout
 
Quote:

Originally Posted by deepblue_tiano
We are using 4.6.5 version if that patch is present in 4.6.0 why is that bug appear on our site? The patch solve the problem. Thanks!


I've only mentioned that the patch fixes a function, that was added in 4.6.0. So, that function (including the mentioned bug) still exists in 4.6.5 and will work properly out-of-the-box only in the next X-Cart releases.


All times are GMT -8. The time now is 01:20 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.