Forums / Addon Payment Modules / Adding Braintree payment module

Adding Braintree payment module

Views: 83,423

Results 21 to 40 of 214
18 Dec 2013, 10:03 PM
#21
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Adding Braintree payment module

Hello,

I am using the latest version of Braintree 1.1.0. Although, the checkout is working and the transaction is being received and processed at Braintree and the customer receives an order confirmation..., my Zencart Administration orders section does not show the entire order. It does not show anything BELOW the Payment Method line. So I cannot see what was ordered or change the order status.

All other payment methods work, (PayPal and Money orders)

I receive an error on the "Order" page that says "WARNING: An Error occurred, please refresh the page and try again."

So I checked my cache, and It says:
**[18-Dec-2013 15:57:37] PHP Fatal error: 1146:Table 'oskopool_zc1.TABLE_BRAINTREE' doesn't exist :: SELECT * FROM TABLE_BRAINTREE
WHERE order_id = 1010
AND parent_txn_id = ''
LIMIT 1 in /home4/oskopool/public_html/includes/classes/db/mysql/query_factory.php on line 101
**

But my database does have the file and it is called Braintree.., not zen_Braintree or table_braintree.

Does anyone have any ideas?

Thanks,
Danny

Daniel Osko

18 Dec 2013, 10:08 PM
#22
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Adding Braintree payment module

sounds like your missing your

catalog/includes/extra_datafiles/braintree_api.php file, do you have that file?

18 Dec 2013, 10:59 PM
#23
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Yes, The file is there. Here is what it says:

**<?php
define('TABLE_BRAINTREE', DB_PREFIX . 'braintree');
**

I am also receiving the following email notice every time that I attempt to look at any order which was processed via Braintree:

**braintree_api
Module disabled because SSL is not enabled on this site.
**

But, SSL has always been enabled on the websites checkout pages and I just enabled SSL in my configure.php file for the Admin area.

Any other thoughts?

Thanks,
Danny

Daniel Osko

19 Dec 2013, 4:41 PM
#24
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Still can't figure this out. In my > includes/modules/payment/braintree_api.php, This seams to be the area of the code that is preventing me from seeing the complete customer order in my Zencart Admin panel:

**function update_status() {
global $order, $db;

	// if store is not running in SSL, cannot offer credit card module, for PCI reasons
	if(!defined('ENABLE_SSL') || ENABLE_SSL != 'true') {
		$this->enabled = FALSE;
		$this->zcLog('update_status', 'Module disabled because SSL is not enabled on this site.');
	}

**

Any Thoughts, Anyone?

Thank You,
Danny

Daniel Osko

19 Dec 2013, 4:44 PM
#25
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Adding Braintree payment module

please confirm that your ADMIN/includes/configure.php looks like this (change the directory/domains etc

/**
 * WE RECOMMEND THAT YOU USE SSL PROTECTION FOR YOUR ENTIRE ADMIN:
 * To do that, make sure you use a "https:" URL for BOTH the HTTP_SERVER and HTTPS_SERVER entries:
 */
  define('HTTP_SERVER', 'https://www.zencartstore.com');
  define('HTTPS_SERVER', 'https://www.zencartstore.com');
  define('HTTP_CATALOG_SERVER', 'https://www.zencartstore.com');
  define('HTTPS_CATALOG_SERVER', 'https://www.zencartstore.com');

  // secure webserver for admin?  Valid choices are 'true' or 'false' (including quotes).
  define('ENABLE_SSL_ADMIN', 'true');

  // secure webserver for storefront?  Valid choices are 'true' or 'false' (including quotes).
  define('ENABLE_SSL_CATALOG', 'true');
19 Dec 2013, 5:42 PM
#26
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Thanks for your reply, I really appreciate it.

However, I changed the configure file as you suggested, and I am still getting the same error.

Any other ideas?

Thanks,
Danny

Daniel Osko

19 Dec 2013, 5:45 PM
#27
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Adding Braintree payment module

Not sure if it is what I'm thinking but can you should have changed it in the
CATALOG/includes/configure.php
(remember you usually have to change the permissions to save it to the server and then set it back.)

19 Dec 2013, 7:40 PM
#28
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Thanks Again, but I'm still having the same problem.

Same two errors:

From my email:
**braintree_api
Module disabled because SSL is not enabled on this site.
**

From my cache:
[19-Dec-2013 10:28:38] PHP Fatal error: 1146:Table 'oskopool_zc1.TABLE_BRAINTREE' doesn't exist :: SELECT * FROM TABLE_BRAINTREE
WHERE order_id = 1010
AND parent_txn_id = ''
LIMIT 1 in /home4/oskopool/public_html/includes/classes/db/mysql/query_factory.php on line 101

My /includes/configure.php permissions are set to 444
and
My ADMIN/includes/configure.php permissions are set to 664

But yet Braintree is receiving all the orders, the customer gets their email, I can see their orders on the main orders page in my Zencart admin:

Attachment 13576

I can also click on "Invoice" or "Packing Slip" and see all of the information. But when I click on the GREEN CIRCLED "e" or click "Edit", I get this:

Attachment 13578
Totally confused now. PayPal and Money Order options seem to work without any errors.

Thanks for any advice,
Danny

Daniel Osko

19 Dec 2013, 9:22 PM
#29
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Adding Braintree payment module

ok, lets try, this...

taking this file:
catalog/includes/extra_datafiles/braintree_api.php

and also putting it here:

catalog/ADMIN/includes/extra_datafiles/braintree_api.php

19 Dec 2013, 10:41 PM
#30
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Tried it, but it had no effect.

I figure, if the other payment options work..., it's probably the Braintree code?

Thanks,
Danny

Daniel Osko

20 Dec 2013, 5:11 PM
#31
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Hello Larry,

I PM'd you the FTP info. THANKS!

Anyway, I am also wondering if the problem is within the step 3 of 3 in the checkout process.

Attachment 13586

(Since, my EDIT the customer order page only shows information down to and including the Card Expiration Date and nothing else below that).

It's has been my experience that errors like this are usually caused by one dumb mistake that the user has caused.., but I just can't see it.:blush:

Thanks again,
Danny

Daniel Osko

22 Dec 2013, 3:47 PM
#32
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Hello Larry,

I set up an unique ftp account for you and sent you the FTP information for my website two days ago and I have not heard from you since. I hope everything is ok.

Anyway, I do not feel comfortable allowing this FTP account enabled and open since you haven't replied to my PM's. So, I've deleted the FTP user account.

If you can find time to take a look at the code, please let me know and I will set up another user account.

Thanks,
Danny

Daniel Osko

22 Dec 2013, 3:50 PM
#33
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Adding Braintree payment module

Sorry I'v been outta town, I'll be back in a few days

26 Dec 2013, 5:41 PM
#34
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Hi Larry,

Don't know if your back in town yet, but I discovered the following:

The Braintree Plugin is writing all information to the data base under the file name: braintree
But when you try to edit an order in the Zencart admin panel, it is looking for all information from the data base under the file name: TABLE_BRAINTREE
(neither have the zen_)

I know this because I created a new data file called TABLE_BRAINTREE in my SQL database and now I CAN edit the order in my Zencart admin panel. However, I still get the errors in my cache folder and in my email notification. I also do not know if this plugin will now work with both the braintree and TABLE_BRAINTREE data files.

I guess I'll know more when another order is placed.

Danny
:wacko:

Daniel Osko

31 Dec 2013, 2:13 PM
#35
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Hi All,

Well, I have another order and the statements in my last posting are still true.

Any Ideas? Anyone?

Thanks,
Danny

Daniel Osko

31 Dec 2013, 3:15 PM
#36
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Adding Braintree payment module

ok I have updated the module so versions 1.1.1 and forward should be correct but you may need to make a small change to the includes/extra_datafiles/braintree_api.php file for older installations.
change:

define('TABLE_BRAINTREE', DB_PREFIX . 'braintree');

to:

define('TABLE_BRAINTREE', 'braintree');

This is because it looks like the table 'braintree' was coded into the module, rather the TABLE_BRAINTREE.

If that doesn't then try adding that file to your admin/includes/extra_datafiles/

Please let us know so we can help others.

1 Jan 2014, 5:02 PM
#37
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

Hello Larry,

THANK YOU!!!!

I replaced the code, as you directed, in the includes/extra_datafiles/braintree_api.php file and also added the same file ini the admin/includes/extra_datafiles/braintree_api.php

I also DELETED the TABLE_BRAINTREE file in the SQL database and left only the braintree file.

I can now see all of the "EDIT" orders info in my Zencart Admin panel and I am no longer seeing an error in my FTP's cache file! YEAH!!

Attachment 13627

The only error I now receive is via email:
braintree_api
Module disabled because SSL is not enabled on this site.

However, I am not to concerned so long as I do not have any future problems with PCI compliancy.

I'll give an update after the next order.

Thanks a Million!
Danny

Daniel Osko

1 Jan 2014, 5:17 PM
#38
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Adding Braintree payment module

In both your config.php files make sure you have https and SSL set to true

1 Jan 2014, 6:08 PM
#39
danielosko avatar

danielosko

Zen Follower

Join Date:
Dec 2008
Location:
Hanover Township PA, USA
Posts:
122
Plugin Contributions:
0

Re: Adding Braintree payment module

They are both set correctly.

Could this be happening because I am have the Braintree Payment Module set to DEBUG in my Zencart Admin Panel?

Danny

Daniel Osko

4 Jan 2014, 1:58 PM
#40
amomandherblog avatar

amomandherblog

New Zenner

Join Date:
Jul 2010
Posts:
16
Plugin Contributions:
0

Re: Adding Braintree payment module

It's been added to the plugins on Zen Cart. Does that mean there is now a support thread? Because I need one!