Post by C4Y » Sun Jul 08, 2018 7:10 pm

Hi,
I don't find solution for this problem :

I'm activing PayPal module ((Powered by Braintree) on Opncart 3.0.2.0 )

When the cusommer buy an article, and click on "passed command", the page "checkout" is bloked.
On debug, we can read this :

Image
Image
Image
Image

Thanks for some idea and help

C4Y
Newbie

Posts

Joined
Sun Jul 08, 2018 7:00 pm

Post by straightlight » Mon Jul 09, 2018 10:48 pm

What are the Braintree logs showing when enabling the debug mode? You can send the report over PM if you'd like. I just helped a forum user about Braintree as we speak with the same OC version and no issue as such was encountered so far.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by C4Y » Mon Jul 09, 2018 11:46 pm

Hello,

Thank you for your answers.

I have two errors :
PHP Unknown: Function create_function() is deprecated in /var/www/storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 205
PHP Unknown: Function create_function() is deprecated in /var/www/storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 172

My server uses Apache 2.4 http2 and php 7.2

Thank you for help

C4Y
Newbie

Posts

Joined
Sun Jul 08, 2018 7:00 pm

Post by straightlight » Tue Jul 10, 2018 12:10 am

Finally, real true clues!

Due to the PHP requirements of OC for v7.1 and above, I think it is important to also focus on these issues reported above in accordance to: https://stackoverflow.com/questions/481 ... deprecated.

In vendor/braintree/braintree_php/lib/Braintree/Util.php file, find:

Code: Select all

$callback = create_function('$matches', 'return strtoupper($matches[1]);');
replace with:

Code: Select all

$callback = function($matches) use ($callback) {
							return $callback . strtoupper($matches[1]);
						}
Then, find:

Code: Select all

$callbacks[$delimiter] = create_function('$matches', "return '$delimiter' . strtolower(\$matches[1]);");
replace with:

Code: Select all

$callbacks[$delimiter] = function($matches) use ($delimiter) {
					return $delimiter . strtolower($matches[1]);
				}
Then, not to forget these steps: viewtopic.php?f=176&p=728050#p725084

This should clarify the issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Tue Jul 10, 2018 12:25 am

Another clue found in vendor/braintree/braintree_php/tests/integration/Error/ValidationErrorCollectionTest.php file,

find:

Code: Select all

$codes = array_map(create_function('$validationError', 'return $validationError->code;'), $validationErrors);
replace with:

Code: Select all

$codes = array_map(function($matches) use ($validationError) { return $validationError->code; }, $validationErrors);
Re-use the same link from my previous post to refresh the changes.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by C4Y » Tue Jul 10, 2018 3:53 am

Thank you, finally I preferred downgrade in PHP7.0

So, my problem is in the code that is in the table oc_theme :
Image

How to regenerate this code?

Thanks

C4Y
Newbie

Posts

Joined
Sun Jul 08, 2018 7:00 pm

Post by straightlight » Tue Jul 10, 2018 3:58 am

This row has been generated by an extension not originating from the core.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by C4Y » Tue Jul 10, 2018 6:01 am

deleting lines in oc theme and it works :D

Tanks for help and good jobs all ;)

C4Y
Newbie

Posts

Joined
Sun Jul 08, 2018 7:00 pm

Post by letsdoit » Mon Oct 15, 2018 3:23 am

Hi Guys,
I have also had the same issue with the PayPal (Powered by Braintree) Module in Opencart 3.0.2.0 running PHP v7.2. As my hosts provide either PHP 5.6 or 7.2, In the end I had to reinstall OC completely on PHP 5.6 and then the PayPal (Powered by Braintee) module worked fine!
Is there a simple fix for this? My hosts have recently stopped supporting PHP 5.3, so I assume 5.6 won't be far behind and then I have the problem all over again! Any ideas would be appreciated?

Newbie

Posts

Joined
Wed Oct 03, 2018 8:36 pm

Post by edwardr » Fri Jan 18, 2019 5:14 pm

Hi,
I have the same problem.

I tried the code changes but I get following error:
Parse error: syntax error, unexpected '}' in /xxx_storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 175
what happens when you delete the }
Parse error: syntax error, unexpected 'return' (T_RETURN) in /xxx_storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 177
I also tried the util file (if it is new) from the 3.0.3.1, but same errors like at the beginning…

PS: I refreshed / cleaned the cache

New member

Posts

Joined
Wed Oct 18, 2017 7:06 pm

Post by straightlight » Fri Jan 18, 2019 6:24 pm

edwardr wrote:
Fri Jan 18, 2019 5:14 pm
Hi,
I have the same problem.

I tried the code changes but I get following error:
Parse error: syntax error, unexpected '}' in /xxx_storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 175
what happens when you delete the }
Parse error: syntax error, unexpected 'return' (T_RETURN) in /xxx_storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 177
I also tried the util file (if it is new) from the 3.0.3.1, but same errors like at the beginning…

PS: I refreshed / cleaned the cache
PHP version?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by edwardr » Sun Jan 20, 2019 9:31 am

also 7.2

(it worked at my old webhoster, but they had an older version)
thx for help

New member

Posts

Joined
Wed Oct 18, 2017 7:06 pm

Post by antonis.loizou » Mon Jan 21, 2019 8:20 pm

I am having the same issue, although my php version is 7.0.32 .

Code: Select all

Uncaught ReferenceError: braintree is not defined
    at Object.success (<anonymous>:37:5)
    at u (jquery-3.3.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-3.3.1.min.js:2)
    at k (jquery-3.3.1.min.js:2)
    at HTMLScriptElement.n (jquery-3.3.1.min.js:2)
    at HTMLScriptElement.dispatch (jquery-3.3.1.min.js:2)
    at HTMLScriptElement.y.handle (jquery-3.3.1.min.js:2)
This points to :

Code: Select all

  $.getScript('https://js.braintreegateway.com/web/3.6.3/js/client.min.js', function() {
    $.getScript('https://js.braintreegateway.com/web/3.6.3/js/hosted-fields.min.js');
    $.getScript('https://js.braintreegateway.com/web/3.6.3/js/data-collector.min.js');
        
    braintree.client.create({
      authorization: 'XXXX'
    }, function (client_error, braintree_client) {
      console.log("Create Client");

      if (client_error) {
        console.error(client_error);
        return;
      }

      client_instance = braintree_client;

      
      braintree.hostedFields.create({
        client: braintree_client,
        styles: "{\n\t\t  'input': { 'font-size': '12px', 'font-family': 'Source Sans Pro, sans-serif', 'color': '#7A8494' },\n\t\t  'input.invalid': { 'color': 'red' },\n\t\t  'input.valid': { 'color': 'green' }\n\t  \t}",
        fields: {
          number: {
            selector: '#input-card-number',
            placeholder: '1111 1111 1111 1111'
          },
          expirationMonth: {
            selector: '#input-card-expiration-month',
            placeholder: 'Month',
            select: true
          },
          expirationYear: {
            selector: '#input-card-expiration-year',
            placeholder: 'Year',
            select: true
          },
          cvv: {
            selector: '#input-card-cvv',
            placeholder: 'CVV2',
            type: "password"
          }
        }
      }, hostedCallback);

      braintree.dataCollector.create({
        client: braintree_client,
        kount: true,
        paypal: true
      }, dataCollectorCallback);

          });
  });
I have refreshed cache and modifications , uninstalled the Paypal Express Checkout extension, uninstalled and reinstalled the PayPal powered by Braintree extension.


Posts

Joined
Mon Jan 21, 2019 8:06 pm

Post by straightlight » Wed Jan 23, 2019 4:15 am

The error indicated above cannot be the same issue addressed from previous post since the provided error code and source of origin do not correspond to the same error message also since you are using PHP v7.0.32 while the previous user has state: PHP v7.2.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by edwardr » Wed Jan 23, 2019 7:52 pm

I have 7.2 and the Errors in line 205 and 172 :(
But when I Change it like you said the Computer says there is an unexpected { :(

I'm going to listen now Guns n' roses - Don't cry :)

New member

Posts

Joined
Wed Oct 18, 2017 7:06 pm

Post by antonis.loizou » Wed Jan 23, 2019 8:05 pm

straightlight wrote:
Wed Jan 23, 2019 4:15 am
The error indicated above cannot be the same issue addressed from previous post since the provided error code and source of origin do not correspond to the same error message also since you are using PHP v7.0.32 while the previous user has state: PHP v7.2.
Understood - should I make a new topic then ? I am at a loss on how to debug this further, any pointers would be much appreciated


Posts

Joined
Mon Jan 21, 2019 8:06 pm

Post by edwardr » Thu Jan 24, 2019 6:16 pm

antonis.loizou wrote:
Wed Jan 23, 2019 8:05 pm
straightlight wrote:
Wed Jan 23, 2019 4:15 am
The error indicated above cannot be the same issue addressed from previous post since the provided error code and source of origin do not correspond to the same error message also since you are using PHP v7.0.32 while the previous user has state: PHP v7.2.
Understood - should I make a new topic then ? I am at a loss on how to debug this further, any pointers would be much appreciated
yes, please

New member

Posts

Joined
Wed Oct 18, 2017 7:06 pm

Post by edwardr » Tue Jan 29, 2019 5:16 pm

any News / ideas / Information ???

New member

Posts

Joined
Wed Oct 18, 2017 7:06 pm

Post by edwardr » Thu Feb 07, 2019 11:05 pm

my provider gave me the possibility to change the php Version to 7.1. (now it works)

The error is caused by the Php Version 7.2, but I didn't found a solution. The change which was descriped before didn't worked :(

New member

Posts

Joined
Wed Oct 18, 2017 7:06 pm

Post by straightlight » Mon Mar 04, 2019 4:53 am

Please follow these instructions starting from this post: viewtopic.php?f=201&t=210100&p=748350#p747252

Resolution confirmation: viewtopic.php?f=201&t=210100&p=748350#p748348

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Ahrefs [Bot] and 30 guests