Giter Site home page Giter Site logo

cometcultbraintreebundle's People

Contributors

grevenx avatar karolsojko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cometcultbraintreebundle's Issues

MerchantAccount service throws an error

Using Symfony2 framework, when creating a customer with a credit card there are no issues, like the following...

$factory = $this->get('comet_cult_braintree.factory');
$customerService = $factory->get('customer');
$createPayment = $customerService->create(array(.....)

However, when attempting to do the same with a MerchantAccount, it will throw the following error:
"ClassNotFoundException: Attempted to load class "Braintree_MerchantAccount" from namespace..."

Code for merchants is the same:

$factory = $this->get('comet_cult_braintree.factory');
$merchantService = $factory->get('MerchantAccount');
$subMerchant = $merchantService->create(array(....)

Any idea on what could be wrong?

Symfony vendor there is an issue with generating client token

I have resolved that by adding factory method in class in vendor/braintree/braintree_php/lib/Braintree/ClientToken.php
public static function factory($attributes)
{
$instance = new self();
return $instance;
}

In controller
$tokenService = $factory->get('clienttoken');
$token = $tokenService::generate();

above code works and generate the token but without modifying the parent class its not possible please help on that.

I want that class to get updated on git so I can download the clienttoken working correctly in updated copy.

Please reply on that.

Thanks

Tag a version

Please tag a version (a stable version would be best if the package has been used in production for a while without issues), so that it's easier to point to the specific version in the composer.json file.

ClientToken

Hi,

Great work !

Just a question. How would you generate the ClientToken. I didn't see with the actual factory how to do.

I added in the factory :

use Braintree_ClientToken;

class BraintreeFactory
{

    // ...

    public function getClientToken(){
        return Braintree_ClientToken::generate();
    }

}

this is working (If it is the right way to do):

    $braintree = $this->get('braintree.factory');
    $transaction = $braintree->get('transaction');
    $transaction::sale(array('paymentMethodNonce' => $nonce));

but this is returning "Invalid service ClientToken" :

    $braintree = $this->get('braintree.factory');
    $braintree_token = $braintree->get('ClientToken');
    $braintree_token::generate();

How do you go about generating a ClientToken?

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

Braintree Transaction Search Service

According to the documentation provided with bundle, I tried to create transaction search service in the following way:

services.yml

    class:            Braintree_TransactionSearch
    factory_service:  comet_cult_braintree.factory
    factory_method:   get
    arguments: ["transactionSearch"]

I got the error message "Invalid service transactionSearch". I was able to fix this by adding "factory" method to Braintree_TransactionSearch class:
public static function factory($attributes)
{
$instance = new self();
return $instance;
}

Obviously, in this case I have to update this class each time I do "composer update". What I'm doing wrong? Otherwise, can you advice how to override Braintree_TransactionSearch class in order to add "factory" method?

ClientToken factory

How can I use this Bundle to get a ClientToken (that class doesn't have the method "factory")?

Environment Not Autoloaded

Environment only loads when braintree service is first invoked (or any other braintree-related service you create yourself via custom factory method).

This means that invoking \Braintree_ClientToken::generate() before invoking comet_cult_braintree.factory will throw an exception with message "environment needs to be set."

Service declaration trouble

I have tried implementing a service as described in the doc (with updated syntax for symfony 2.8):

braintree_transaction:
    class: \Braintree\Transaction
    factory: ["@comet_cult_braintree.factory", get]
    arguments: ["customer"]
$transactionService = $this->get('braintree_transaction');
$result = $transactionService::sale( ... );

But unfortunately it gives me this error:

Warning: Missing argument 2 for Braintree\Customer::sale()

Which seems to mean that the service does not take account of the class parameter.

I use version 3.16 of the braintree_php bundle, in which the classes are not prepended with "Braintree_" anymore. There are class aliases though, which means that I can use both:

class: \Braintree\Transaction or class: \Braintree\Braintree_Transaction

Both ways give the same error. Am I doing something wrong?

P.S.:

The following works:

$factory = $this->get('comet_cult_braintree.factory');
$transactionService = $factory->get('transaction');
$result = $transactionService::sale( ... );

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.