Jump to content

Paypal 3.10.10 redirect loop with Website Payments Pro Integral Evo


Mias-Accessories

Recommended Posts

The Double // dosen't look good. 

 

MYSHOP/en/modules// <--

 

Take a look at the code in submit.php, look for code that looks like this,

 

if (version_compare(_PS_VERSION_, '1.5', '<')) {

        $customer = new Customer(Context::getContext()->cookie->id_customer);
        $values['key'] = $customer->secure_key;
        $url = _MODULE_DIR_.'/paypal/integral_evolution/submit.php';
        Tools::redirectLink($url.'?'.http_build_query($values, '', '&'));
    } else {
        $values['key'] = Context::getContext()->customer->secure_key;
        $link = Context::getContext()->link->getModuleLink('paypal', 'submit', $values);
        Tools::redirect($link);
    }
} else {
    Tools::redirectLink(__PS_BASE_URI__);
}
Link to comment
Share on other sites

In submit.php for a search on version compare I only have

 

 if (version_compare(_PS_VERSION_, '1.5', '>')) {
            $this->context->smarty->assign(array(
                'reference_order' => Order::getUniqReferenceOf($paypal_order['id_order']),
            ));
        }
 
        if (($this->context->customer->is_guest) || $this->context->customer->id == false) {
            $this->context->smarty->assign(
                array(
                    'id_order' => (int) $this->id_order,
                    'id_order_formatted' => sprintf('#%06d', (int) $this->id_order),
                    'order_reference' => $order->reference,
                )

            ); 

Link to comment
Share on other sites

Thanks Bill almost there - it worked - but well it was a little strange because it comes up with the re-direct error screen first of all and chrome shows an error and reload button but then 5 secs later the screen refreshes with the confirmation page and the order is created so it is 99% there.

The address in the address bar still has the double //  modules//paypal/integral_evolution/ - a little strange.

Is this a cookie / cache problem or still something a little off in the module or the redirects?

Should I run update modules in the backwards compatability module or leave it?

Many thanks for your help,

Kind regards,

Ian

Link to comment
Share on other sites

Is it normal also for the working module when accepting card payments to confirm with the customer

"You have chosen the PayPal method. " and to give a paypal transaction number - this may alarm some of the paypal haters out there :-)

I see in the back office also the card orders look no different from paypal account orders - is that normal for the module?

Many thanks,

Ian

Link to comment
Share on other sites

Yes, Paypal looks just like normal payment. It may be possible that you have a server configuration error. If so you should contact your host and let them know of the // problem.

 

That said have you tried it with friendly urls on and off to see if this happens in both states? This will also regenerate your .htaccess file.

Link to comment
Share on other sites

Thanks Bill, I played with the friendly URL settings on the generator page and also on the SEO & URLs page. And also with apache multiviews on/off but no change.

 

I guess it must be a problem with the .htaccess / seo / urls but not sure where...

does anything jump out at you from the htaccess?

Thanks for your help,

 

 
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##
 
 
<IfModule mod_rewrite.c>
# MY RE-WRITE RULES
RewriteEngine on
 
#FIX OLD LANGUAGE URL
RewriteRule ^lang-([a-z]{2})(/?)(.*)$ $2$1/$3 [R]
 
#FIX PAYPAL CHECKOUT RE-DIRECT LOOP
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
RewriteRule . %1/%2 [R=301,L]
 
#FIX GOOGLE CHECKOUT RE-DIRECT LOOP
RewriteRule ^([a-z]{2}/)(modules/gcheckout/payment.php)$ /$2 [R]
 
#MOVE OLD PRODUCT LINKS TO NEW
RewriteRule ^us/bendy-wire-headbands/766-bendy-wire-denim-headband-5060225240006.html /us/bendy-wire-usagi-headbands/875-bendy-wire-denim-headband-hearts-and-bows.html [R]
 
</IfModule>
<IfModule mod_rewrite.c>
 
# Disable Multiviews
Options -Multiviews
 
# URL rewriting module activation
RewriteEngine on
 
# URL rewriting rules
RewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [QSA,L]
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2$3.jpg [L]
RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2.jpg [L]
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$1$2.jpg [L]
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L]
RewriteRule ^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$ /img/c/$1.jpg [L]
RewriteRule ^([a-z]{2})/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$2&isolang=$1 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$2&isolang=$1 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+ /category.php?id_category=$2&isolang=$1&noredirect=1 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$2&isolang=$1 [QSA,L]
RewriteRule ^([a-z]{2})/content/([0-9]+)\-[a-zA-Z0-9-]* /cms.php?isolang=$1&id_cms=$2 [QSA,L]
RewriteRule ^([a-z]{2})/content/category/([0-9]+)\-[a-zA-Z0-9-]* /cms.php?isolang=$1&id_cms_category=$2 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)__[a-zA-Z0-9-]* /supplier.php?isolang=$1&id_supplier=$2 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)_[a-zA-Z0-9-]* /manufacturer.php?isolang=$1&id_manufacturer=$2 [QSA,L]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]
RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+ /category.php?id_category=$1&noredirect=1 [QSA,L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$1 [QSA,L]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*) /supplier.php?id_supplier=$1 [QSA,L]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*) /manufacturer.php?id_manufacturer=$1 [QSA,L]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$1 [QSA,L]
RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms_category=$1 [QSA,L]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html /product.php?id_product=$3&isolang=$1 [QSA,L]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html /product.php?id_product=$2&isolang=$1 [QSA,L]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*) /category.php?id_category=$2&isolang=$1 [QSA,L]
RewriteRule ^en/page-not-found$ /404.php?isolang=en [QSA,L]
RewriteRule ^en/address$ /address.php?isolang=en [QSA,L]
RewriteRule ^en/addresses$ /addresses.php?isolang=en [QSA,L]
RewriteRule ^en/authentication$ /authentication.php?isolang=en [QSA,L]
RewriteRule ^en/our-top-selling-accessories$ /best-sales.php?isolang=en [QSA,L]
RewriteRule ^en/cart$ /cart.php?isolang=en [QSA,L]
RewriteRule ^en/contact-us-now-by-email$ /contact-form.php?isolang=en [QSA,L]
RewriteRule ^en/discount$ /discount.php?isolang=en [QSA,L]
RewriteRule ^en/guest-tracking$ /guest-tracking.php?isolang=en [QSA,L]
RewriteRule ^en/order-history$ /history.php?isolang=en [QSA,L]
RewriteRule ^en/identity$ /identity.php?isolang=en [QSA,L]
RewriteRule ^en/manufacturers$ /manufacturer.php?isolang=en [QSA,L]
RewriteRule ^en/my-account$ /my-account.php?isolang=en [QSA,L]
RewriteRule ^en/new-products-recently-added-to-our-shop$ /new-products.php?isolang=en [QSA,L]
RewriteRule ^en/order$ /order.php?isolang=en [QSA,L]
RewriteRule ^en/confirmation-of-your-order$ /order-confirmation.php?isolang=en [QSA,L]
RewriteRule ^en/order-follow$ /order-follow.php?isolang=en [QSA,L]
RewriteRule ^en/quick-order$ /order-opc.php?isolang=en [QSA,L]
RewriteRule ^en/order-slip$ /order-slip.php?isolang=en [QSA,L]
RewriteRule ^en/forgot-your-password$ /password.php?isolang=en [QSA,L]
RewriteRule ^en/see-what-s-on-special-offer$ /prices-drop.php?isolang=en [QSA,L]
RewriteRule ^en/search$ /search.php?isolang=en [QSA,L]
RewriteRule ^en/sitemap-find-what-you-are-looking-for$ /sitemap.php?isolang=en [QSA,L]
RewriteRule ^en/stores$ /stores.php?isolang=en [QSA,L]
RewriteRule ^en/suppliers$ /supplier.php?isolang=en [QSA,L]
RewriteRule ^en$ /en/ [QSA,L]
RewriteRule ^en/([^?&]*)$ /$1?isolang=en [QSA,L]
Link to comment
Share on other sites

Did you add these?

 

#FIX OLD LANGUAGE URL

RewriteRule ^lang-([a-z]{2})(/?)(.*)$ $2$1/$3 [R]

 

#FIX PAYPAL CHECKOUT RE-DIRECT LOOP

RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$

RewriteRule . %1/%2 [R=301,L]

 

#FIX GOOGLE CHECKOUT RE-DIRECT LOOP

RewriteRule ^([a-z]{2}/)(modules/gcheckout/payment.php)$ /$2 [R]

 

If not someone did, they are not generated by PS. Have you tried removing those lines and checking the result?

Link to comment
Share on other sites

Yeah forgot to mention I added those - some a long time ago - commented out the results are the same. I just added the #FIX PAYPAL ...LOOP one to get rid of the // it works but only after hitting refresh.

I am looking into the code in the module - currently focusing on redirect.php - I feel like the answer maybe in there - trying to work out what is going on.

Thanks

Link to comment
Share on other sites

Thanks Bill, I have gone back to the latest module.

Disabled multi-view no change and I have seen that thread before - the commenting out of the tools currency redirect did not work for me.

It seems the redirect loop is caused because $id_order=0.

I think maybe there needs to be a Wait screen in there to stop the redirects maxing out before the order is created since until it is created $id_order=0 and the redirects keep firing.

I found the // problem and believe I have fixed that

 

if (version_compare(_PS_VERSION_, '1.5', '<')) {
        $customer = new Customer(Context::getContext()->cookie->id_customer);
        $values['key'] = $customer->secure_key;
// I.D. EDIT REMOVED THE / BEFORE PAYPAL BELOW
        $url = _MODULE_DIR_.'paypal/integral_evolution/submit.php';
        Tools::redirectLink($url.'?'.http_build_query($values, '', '&'));
    } else {
Link to comment
Share on other sites

Thanks for all your help Bill - I did try that commenting that out - I have given up on this and bough the paid one which worked straight off once I updated the backward comparability app. The prestashop online live sales assistant claimed the free module only works in a few countries and not UK. Paid module is much nicer. Hopefully will run trouble free now it is live - test payment worked well.

Many thanks for all your help,

Kind regards,

Ian

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...