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 :
Thanks for some idea and help
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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
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]);');
Code: Select all
$callback = function($matches) use ($callback) {
return $callback . strtoupper($matches[1]);
}
Code: Select all
$callbacks[$delimiter] = create_function('$matches', "return '$delimiter' . strtolower(\$matches[1]);");
Code: Select all
$callbacks[$delimiter] = function($matches) use ($delimiter) {
return $delimiter . strtolower($matches[1]);
}
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
find:
Code: Select all
$codes = array_map(create_function('$validationError', 'return $validationError->code;'), $validationErrors);
Code: Select all
$codes = array_map(function($matches) use ($validationError) { return $validationError->code; }, $validationErrors);
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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?
I have the same problem.
I tried the code changes but I get following error:
what happens when you delete the }Parse error: syntax error, unexpected '}' in /xxx_storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 175
I also tried the util file (if it is new) from the 3.0.3.1, but same errors like at the beginning…Parse error: syntax error, unexpected 'return' (T_RETURN) in /xxx_storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 177
PS: I refreshed / cleaned the cache
PHP version?edwardr wrote: ↑Fri Jan 18, 2019 5:14 pmHi,
I have the same problem.
I tried the code changes but I get following error:what happens when you delete the }Parse error: syntax error, unexpected '}' in /xxx_storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 175I also tried the util file (if it is new) from the 3.0.3.1, but same errors like at the beginning…Parse error: syntax error, unexpected 'return' (T_RETURN) in /xxx_storage/vendor/braintree/braintree_php/lib/Braintree/Util.php on line 177
PS: I refreshed / cleaned the cache
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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)
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);
});
});
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Understood - should I make a new topic then ? I am at a loss on how to debug this further, any pointers would be much appreciatedstraightlight wrote: ↑Wed Jan 23, 2019 4:15 amThe 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.
yes, pleaseantonis.loizou wrote: ↑Wed Jan 23, 2019 8:05 pmUnderstood - should I make a new topic then ? I am at a loss on how to debug this further, any pointers would be much appreciatedstraightlight wrote: ↑Wed Jan 23, 2019 4:15 amThe 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.
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
Users browsing this forum: No registered users and 71 guests