Braintree

Installation

The Braintree App is bundled with osCommerce Online Merchant v2.3.5 onwards and can be downloaded separately to install on existing or earlier installations. The App is compatible with and can be installed from osCommerce Online Merchant v2.2RC2a onwards.

Usage of advanced features of the App require additional changes to be applied to existing installations. Please review the Legacy Changes section below.

Download

The full Braintree App download package is available at:

http://addons.oscommerce.com/info/9524

After extracting the App package, copy the files located in the catalog directory to your osCommerce Online Merchant installation directory on the server. The files must be copied in the correct directory structure as extracted from the App package.

Please do not copy the docs directory to your webserver as this directory contains PHP files that should not be publicly accessible.

Legacy Changes

Existing osCommerce Online Merchant installations up to and including v2.3.4 require the following code changes to be performed:

  1. Administration Tool App Setup
  2. Hooks for the Administration Tool and Catalog
  3. Administration Tool Order Administration Page
  4. Public CA Certificate Bundle

Only the changes in (1) are required to add the Braintree App links to the Administration Tool. Changes (2), (3), and (4) are optional and are needed if transaction management is to be added to the Administration Tool Orders management page (this requires a new order management page which may overwrite installed Add-Ons).

The versions described below are inclusive of the version stated (eg, v2.3.3.2 affects all versions up to and including v2.3.3.2).
1. Administration Tool App Setup
osCommerce Online Merchant up to v2.3.3.2 (5-Sept-2013)

In catalog/admin/includes/column_left.php, add the following to the collection of existing boxes being included:

include(DIR_WS_BOXES . 'braintree.php');
osCommerce Online Merchant up to v2.2 RC2a (30-Jan-2008)

Copy (and overwrite) the following files from:

docs/legacy/v22rc2a/admin/includes/boxes/braintree.php
docs/legacy/v22rc2a/admin/includes/modules/index/braintree_app.php
docs/legacy/v22rc2a/admin/includes/template_top.php
docs/legacy/v22rc2a/admin/includes/template_bottom.php

to:

catalog/admin/includes/boxes/braintree.php
catalog/admin/includes/modules/index/braintree_app.php
catalog/admin/includes/template_top.php
catalog/admin/includes/template_bottom.php
2. Hooks for the Administration Tool and Catalog
osCommerce Online Merchant up to v2.3.4 (5-June-2014)

Copy the following file from:

docs/legacy/v234/includes/classes/hooks.php

to:

catalog/includes/classes/hooks.php

In the following file:

catalog/includes/application_top.php

add to the bottom (before ?>):

require(DIR_FS_CATALOG . 'includes/classes/hooks.php');
$OSCOM_Hooks = new hooks('shop');

In the following file:

catalog/admin/includes/application_top.php

add to the bottom (before ?>):

require(DIR_FS_CATALOG . 'includes/classes/hooks.php');
$OSCOM_Hooks = new hooks('admin');
3. Administration Tool Order Administration Page
osCommerce Online Merchant up to v2.3.4 (5-June-2014)

Copy (and overwrite) the following file from:

docs/legacy/v234/admin/includes/classes/order.php

to:

catalog/admin/includes/classes/order.php

Copy (and overwrite) the following file from:

docs/legacy/v234/admin/orders.php

to:

catalog/admin/orders.php

In all catalog/admin/includes/languages/LANGUAGE/orders.php language files, add the following language definition:

define('ENTRY_ADD_COMMENT', 'Add Comment:');
4. Public CA Certificate Bundle
osCommerce Online Merchant up to v2.3.3 (15-August-2012)

Copy the following file from:

docs/legacy/v233/includes/cacert.pem

to:

catalog/includes/cacert.pem

First Run

When the files have been copied to their appropriate locations and the Legacy Changes have been performed, a new Braintree navigation menu box will show in the Administration Tool. The first time the App is run, it automatically configures itself and migrates older module configuration parameters to the App parameters, and checks if an online update is available.

Language Definitions

The core language definitions in English are provided in the App package. Additional languages can be created by basing the language files on the existing English files. Definitions that have not yet been translated will display in English. The language definitions are located in:

includes/apps/braintree/languages/