Problem
I've set up PayPal and Offline payments as payment gateways. Whenever I select PayPal on the "Order Information" step and click on "Continue to Review", I get a blank page with the following error:
Error: Call to a member function getEntity() on null in Drupal\commerce_payment\Plugin\Commerce\CheckoutPane\PaymentInformation->submitPaneForm() (line 360 of /web/modules/contrib/commerce/modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php)
If I select another payment method, I am being redirected to the Order Review page without any errors/warnings.
I checked the error logs and I see that I get the following `notice` right before the above error:
Notice: Undefined index: #inline_form in Drupal\commerce_payment\Plugin\Commerce\CheckoutPane\PaymentInformation->submitPaneForm() (line 358 of /web/modules/contrib/commerce/modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php)
I also checked the code and it seems that the:
$inline_form = $pane_form['billing_information']['#inline_form'];
is null.
I have tried the following:
- Disabling my custom theme and using Bartik which still gave me the same issue.
- Deleted and added again the PayPal payment gateways.
- Tried both live and sandbox modes for PayPal
- Uninstalled and installed Commerce PayPal
- Uninstalled and installed Commerce Payment
Steps to reproduce
1. Add a product to the cart and proceed to checkout
2. Select PayPal on the "Order Information" page/checkout step
3. Click on "Continue to Review" and on the next page the error appears.
Versions
Drupal core 8.9.7
Drupal Commerce 8.x-2.21
Commerce PayPal 8.x-1.0-beta11
Commerce Shipping 8.x-2.0-rc2
Commerce Variation Cart Form 8.x-1.2
Thank you in advance for your help.
Comment | File | Size | Author |
---|---|---|---|
#17 | payment-information-3177957-9.patch | 1.1 KB | yuradoc |
Comments
Comment #2
ConradFlashback CreditAttribution: ConradFlashback commented+1 Same problem
Comment #3
ntg CreditAttribution: ntg commentedHi ConradFlashback.
Have you managed to resolve the issue?
Comment #4
dvincitravis CreditAttribution: dvincitravis commentedI'm having the same problem with commerce_stripe. Same error, class, method, and line number.
Comment #5
ntg CreditAttribution: ntg commented@dvincitravis I can confirm that I installed `commerce_stripe` and came across the same issue as well.
Commerce payment seems to only work with offline payment gateways. Paypal and Stripe fail.
Comment #6
trickfun CreditAttribution: trickfun as a volunteer commentedi'm having the same problem with commerce_stripe and commerce braintree
Comment #7
jsacksick CreditAttribution: jsacksick at Centarro commentedI have Braintree and Paypal configured on a dev instance, and never experienced this... Is there anything I'm missing?
Which PayPal gateway/plugin were you using? PayPal Checkou (a.k.a PayPal Commerce platform?) How is it configured?
Comment #8
dvincitravis CreditAttribution: dvincitravis commentedCould this be related?
https://www.drupal.org/project/commerce/issues/3079973
I'm getting this error while trying to add Stripe checkout to an existing site (which currently uses PayPal). PayPal checkout still works fine. I only get the error with Stripe.
If I set up Stripe checkout in a fresh Drupal install, I don't get the error. So it seems like something about my Commerce configuration – or some code in another module – might be causing the issue.
I tried updating drupal/commerce and all of its dependencies to the latest versions, but that didn't help.
Comment #9
jsacksick CreditAttribution: jsacksick at Centarro commented@dvincitravis: Could you copy/paste the exact error message? If this doesn't happen on a fresh install... I cannot really help... Unless you give me exact steps to be able to reproduce the issue, or you could try writing a failing test... Feel free to reopen the issue with any of that.
Comment #10
trickfun CreditAttribution: trickfun as a volunteer commentedI get this error with both stripe and braintree:
All modules and core are up-to-date to latest version.
commerce_braintree 8.x-1.x-dev
commerce_stripe:1.x-dev@dev
I notice that the billing information field hides when i select a payment method.
Comment #11
trickfun CreditAttribution: trickfun as a volunteer commentedSame error with paypal.
Only onsite payment method works.
With paypal, stripe, braintree Payment information fields disappear.
I think this bug is critical.
Thank
Comment #12
dvincitravis CreditAttribution: dvincitravis commentedI've given up on Stripe, and have switched to PayPal Commerce Platform. Now I'm getting a similar error with that gateway, as well.
Given the number of people who have reported very similar errors in the last two months, in a variety of different scenarios, there is clearly a bug here.
Below is the error that I'm now getting with PayPal Commerce Platform. This happens when I click on the "Confirm Purchase" button on the order information pane.
Comment #13
dvincitravis CreditAttribution: dvincitravis commentedI honestly understand very little about the internals of Drupal in general (much less the Commerce framework in particular) – so this could very well be a red herring.
But, in Googling about this problem, I came across this issue, which could shine some light:
https://www.drupal.org/project/commerce/issues/3003121
Comment #14
jsacksick CreditAttribution: jsacksick at Centarro commented@dvincitravis: Are you using the latest version of Commerce PayPal?
Comment #15
dvincitravis CreditAttribution: dvincitravis commented@jsacksick: I was running Commerce 8.x-2.20 when I got the error that I cited in #12. But I have previously tried upgrading to the latest version (8.x-2.21), and I still saw very similar errors.
I just re-upgraded to 8.x-2.21, and tried Stripe again. I got an error identical to the one in #12 (I did a diff between the two).
Then I switched back to the "PayPal - Express Checkout [LEGACY-DEPRECATED]" gateway, and that works.
Comment #16
dvincitravis CreditAttribution: dvincitravis commentedComment #17
yuradoc CreditAttribution: yuradoc as a volunteer commentedSolution that works for me is in the patch.
Sorry, wrong comment id in patch name.
Comment #18
jsacksick CreditAttribution: jsacksick at Centarro commentedI committed the patch from #17, thanks!
Comment #19
penyaskitoChanging status. Somehow drupal.org didn't get the link to https://git.drupalcode.org/project/commerce/-/commit/512ee55a07b565b9f42...