Receiving the following error at /signup

Error: Call to undefined method Drupal\braintree_api\BraintreeApiService::getGateway() in Drupal\braintree_cashier\BillableUser->generateAnonymousClientToken() (line 429 of modules/contrib/braintree_cashier/src/BillableUser.php).

getGateway() doesn't appear to exist.

Comments

brandonratz created an issue. See original summary.

brandonratz’s picture

Priority: Normal » Critical
shaundychko’s picture

Hmmm, at first glance that looks like a problem with using Braintree API 1.x, since the getGateway() method was introduced in Braintree API 2.x. Could you check that you're using the 2.x branch of the Braintree API module?

brandonratz’s picture

Looks like I'm using 1.7.0 for braintree_api

braintree/braintree_php               3.33.0             Braintree PHP Client Library
drupal/braintree_api                  1.7.0              Enables use of the Braintree API library
drupal/braintree_cashier              2.0.0-beta2        Recurring billing managed by Braintree

braintree_cachier was installed with composer but I don't see anything in the composer.json of the module requiring ~2.x --

Running a composer depends drupal/braintree_api does show the following:

drupal/braintree_cashier 2.0.0-beta2 requires drupal/braintree_api (*)

I'm going to install 2.x and report back. Perhaps drupal/braintree_api:~2.x should be required?

  • ShaunDychko committed 39d8b35 on 8.x-2.x
    Issue #2974150 by brandonratz, ShaunDychko: Signup page error - Call to...
shaundychko’s picture

Status: Active » Fixed

Ah, thanks, yes, drupal/braintree_api:~2.0 would be better. I mentioned it in the docs, and it's the reason for the 2.x branches in both projects, but it also belongs most importantly in the composer.json.

brandonratz’s picture

Thanks for the help @ShaunDychko. Adding drupal/braintree_api:^2.x to project solve my issue.

Fantastic module. An alternative of using Commerce, commerce_recurring, commerce_license, etc is very cumbersome and this filled the gap perfectly.

shaundychko’s picture

Status: Fixed » Closed (fixed)

Thanks for the great feedback!