When adding a new Payment gateway and selecting 'PayPal recurring (Express Checkout)' none of the relevant configuration fields are displayed. The error is:
ArgumentCountError: Too few arguments to function Drupal\paypal_subscriptions\Plugin\Commerce\PaymentGateway\ExpressCheckoutSubscriptions::__construct(), 13 passed in /Users/chris/Sites/wilderoses/web/modules/contrib/commerce_paypal/src/Plugin/Commerce/PaymentGateway/ExpressCheckout.php on line 157 and exactly 14 expected in Drupal\paypal_subscriptions\Plugin\Commerce\PaymentGateway\ExpressCheckoutSubscriptions->__construct() (line 81 of modules/contrib/paypal_subscriptions/src/Plugin/Commerce/PaymentGateway/ExpressCheckoutSubscriptions.php).
The final (missing) argument is AccountProxyInterface $current_user
. This is with Commerce PayPal 8.x-1.0-beta6. Can anyone help?
Comment | File | Size | Author |
---|---|---|---|
#11 | 3119950-11.patch | 1.65 KB | JeremyFrench |
#8 | 3119950-8.patch | 755 bytes | vuil |
#6 | 3119950-6.patch | 722 bytes | vuil |
#4 | 3119950-4.patch | 1.14 KB | vuil |
#2 | 3119950-2.patch | 362 bytes | vuil |
Comments
Comment #2
vuilThe
$current_user
persists already.The problem is coming from a missing module dependency in
.info.yml
file:I create a patch for.
Comment #4
vuilComment #5
vuilComment #6
vuilComment #7
vuilComment #8
vuilComment #9
vuilComment #10
erier CreditAttribution: erier commentedI'm not sure how to create patches, but i think i've found something that works.
In
/commerce_paypal/src/Plugin/Commerce/PaymentGateway/ExpressCheckout.php
,append
$container->get('current_user')
to return statement ofpublic static function create()
... like ...
Comment #11
JeremyFrench CreditAttribution: JeremyFrench at Full Fat Things commentedOK So I can see what has happened here.
The constructor for the Express Checkout Subscriptions has one more argument than the parent class, yet it still tries to use the parent classes construct method.
This patch allowed me to create the payment method.
Comment #12
vuilComment #14
vuil