woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
61 stars 47 forks source link

Pay by link - Capturing order from guest user causing fatal error when Vaulting is enabled (3326) #2382

Closed Dinamiko closed 4 days ago

Dinamiko commented 4 days ago

A fatal error "call to a member function authorizations() on null" is thrown when trying to capture authorized payment from guest user.

Steps to reproduce

Captura de pantalla 2024-07-01 a las 12 58 32

Possible cause

It is currently possible to create a PurchaseUnit instance with a null Payments value. The consumer code is calling payment authorizations on a null payments instance and therefore the error "call to a member function authorizations() on null" is thrown.

Proposed solution

Ensure purchase units payments instance is not null before using it.