Jump to content
GetSirius

Braintree Credentials

Recommended Posts

Hope someone can help me..

 

Installed the latest Braintree App v2.010 app to a copy of my modified 2.3.4 osCommerce. First tried to install only the basic files, not the Legacy Changes. When viewing the Credentials page, the app tells me:

"Parse error: syntax error, unexpected ')', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /home/wztwnjwn/public_html/shopBraintree/includes/apps/braintree/admin/content/credentials.php on line 19"

 

I commented out that section of the file (see code below), try to access Braintree again and received:

"Parse error: syntax error, unexpected ')', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /home/wztwnjwn/public_html/shopBraintree/includes/apps/braintree/admin/content/credentials.php on line 31"

 

Commented out that section. The app runs OK. I was able to enter all information correctly and complete a transaction.

 

I then installed the Legacy Changes and could not get the Merchant Currency Accounts information to stick, comes up with a blank line where my info should be, in USD (default).

 

Started over, re-copied all files from working osCommerce 2.3.4 to a new test installation, new database, new install of Braintree 2.010 including Legacy Changes. Same story, receive the above errors. If I remove the code causing the errors, I can then see the Credentials page but can not enter the Merchant Currency Accounts information. Does not matter if I have Braintree set to Live, Sandbox, or Disabled, same result.

 

Can anyone help me? I am ok with the basic app but would like the full package if possible.


  if (!class_exists('currencies')) {
    include(DIR_FS_CATALOG . 'includes/classes/currencies.php');
  }

  $ma_data = [];

/*
  if (!empty(OSCOM_APP_PAYPAL_BRAINTREE_CURRENCIES_MA)) {
    foreach (explode(';', OSCOM_APP_PAYPAL_BRAINTREE_CURRENCIES_MA) as $ma) {
      list($a, $currency) = explode(':', $ma);

      $ma_data[$currency] = $a;
    }
  }
*/

  $sandbox_ma_data = [];

/*
  if (!empty(OSCOM_APP_PAYPAL_BRAINTREE_SANDBOX_CURRENCIES_MA)) {
    foreach (explode(';', OSCOM_APP_PAYPAL_BRAINTREE_SANDBOX_CURRENCIES_MA) as $ma) {
      list($a, $currency) = explode(':', $ma);

      $sandbox_ma_data[$currency] = $a;
    }
  }
*/

  $currencies = new currencies();
?>

Share this post


Link to post
Share on other sites

Thanks for pointing the error out. I can confirm the problem is using empty() on a constant (this produces an error on PHP < 5.5 Servers).

 

An update will be pushed out within a few hours.


:heart:, osCommerce

Share this post


Link to post
Share on other sites

Just changed from php5.4 to php5.5 and I am able to enter the information. But the module does not load on checkout_payment.php. I do not see it in Modules > Payment. It is in the Install Module section but even if that is clicked it does not show as installed. I do have the app showing at the top of my admin page. I do have Braintree > Credentials: Merchant ID, Public Key, Private Key, and USD (default) fields filled in.

Share this post


Link to post
Share on other sites

Yes, file exists.

I do see version 2 when I go to install, just do not see it installed other than the app tab at the top.

Share this post


Link to post
Share on other sites

I don't know why the module would not be installed. It's not possible to install the module in the traditional manner as it will redirect you to the Braintree App Configuration page.

 

Try deleting the OSCOM_APP_PAYPAL_BRAINTREE_CC_SORT_ORDER parameter from your configuration table:

 

 

delete from configuration where configuration_key = 'OSCOM_APP_PAYPAL_BRAINTREE_CC_SORT_ORDER';

 

Then visit the Braintree App Configuration page and it should auto-install the module for you.


:heart:, osCommerce

Share this post


Link to post
Share on other sites

Yes, that worked.

App appears to be working under php5.6. I did not complete a checkout but other functions appear to be working.

 

    Thank you Harald!

Share this post


Link to post
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

×