Christopher Short Posted March 13, 2016 Share Posted March 13, 2016 I keep getting this error when I try to use braintree as a payment method: 404 Not Found The requested URL /index.php?_a=gateway&payment_error does not exist. Any ideas for the fix? Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 13, 2016 Share Posted March 13, 2016 Just making notes as I trace through the code... The URL the browser uses when having chosen a gateway and moving on the next step, is: index.php?_a=checkout with 'gateway'=>"BraintreePayments" in POST. CubeCart does a few things with this info. The next step is to have the browser 302 Bounce to: index.php?_a=gateway. So, obviously, "payment_error" is getting into the $_GET array when httpredir() is rebuilding it. More later. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 13, 2016 Share Posted March 13, 2016 The URL, /index.php?_a=gateway&payment_error, is constructed by the module's payment form javascript. Is the 404 message situated inside CubeCart's normal page structure, or is the message just a bare message as if it came from the web server? I ask because the URL starts off with /index.php and not /store/index.php. (The web server has no reason to reject a URL based on the contents of the querystring.) Am I correct if I say that BrainTree keeps the customer at your store? If so, there is a payment form displayed by CubeCart for BrainTree. In the module's file, /skin/form.tpl, line 55-56, the javascript tells the browser to open the existing window to /index.php?_a=gateway&payment_error. This does not take into account the /store/ sub-directory. Please examine the .htaccess file in CubeCart's installed directory. Verify there is the following: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /store/ Specifically, the RewriteBase directive. If the directive is present, we may need to edit the BrainTree template. Line 55-56: Was: // Redirect back to payment page with payment error flag true. window.location.href = '/index.php?_a=gateway&payment_error'; Now: // Redirect back to payment page with payment error flag true. window.location.href = '{/literal}{$STORE_URL}{literal}/index.php?_a=gateway&payment_error'; If the directive is not present, are you aware of a reason why not? Would this interfere with the redirect from www.example.com to https: protocol www.example.com/store/? Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted March 14, 2016 Author Share Posted March 14, 2016 The page was on the website. No clue about the directive question, but when I made the changes to match what you put, it redirects back to the enter payment page. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 14, 2016 Share Posted March 14, 2016 I can only hope that is what the module is supposed to do, along with a banner message saying "There was a problem with your payment, please check your payment information and try again. If the problem persists please contact us." Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.