-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you go about generating a ClientToken? #12
Comments
+1 For now I use: $this->get('comet_cult_braintree.factory');
\Braintree_ClientToken::generate() The factory call is essential to load the configs. |
+1 |
Fix #12 - autoconfiguring Braintree without class instantiation
Can any of you confirm if the solution in #12 is ok for you (@mamartins, @flomerz, @scyrma) ? |
yes, I can call the method, and I have to do so in many functions that do not have factory, and sometimes even with some that do have factory but require parameters |
@mamartins I mean with change I added in 4621db0, are you able use the code without having to get the factory before calling the static methods. You should now be able to just call the following code as long as the CometCultBraintreeBundle is loaded: \Braintree_ClientToken::generate() |
ah, sorry. yes! :) but I was before because I am injecting the factory in some services so the settings are loaded to the hole app. |
@grEvenX - This solution doesn't work, at least for me. From what I tested the calls in https://github.com/cometcult/CometCultBraintreeBundle/blob/4621db02708e2ad1c65733d3dd3cb6e538d7e510/DependencyInjection/CometCultBraintreeExtension.php are executed only when the Symfony cache is generated. These calls are setting a PHP static variable, so they should be executed on every page load. What worked for me was to override the
|
Hi,
This is not a bug per-se, but looking how the code only returns classes with factory methods, I'm curious to know what is the designed way of using this bundle to call Braintree_ClientToken::generate()?
Thanks
The text was updated successfully, but these errors were encountered: