Jump to content

Braintree


Christopher Short

Recommended Posts

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.

Link to comment
Share on other sites

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/?

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...