- Issue created by @chike
- Merge request !7Resolve #3539438 "Undefined property drupalcommercepaystackplugincommercepaymentgatewaypaystackstandardentityid" → (Open) created by chike
Using the latest release of Commerce Paystack I tried making a payment and after a successful payment and I got redirected back to the site, the order wasn't marked as paid, instead I got the the warning and error,
Warning: Undefined property: Drupal\commerce_paystack\Plugin\Commerce\PaymentGateway\PaystackStandard::$entityId in Drupal\commerce_paystack\Plugin\Commerce\PaymentGateway\PaystackStandard->onReturn() (line 115 of modules/contrib/commerce_paystack/src/Plugin/Commerce/PaymentGateway/PaystackStandard.php).
Error messageWe encountered an issue recording your payment. Please contact customer service to resolve the issue.
This appears to be related to how the payment gateway entity ID is referenced in the onReturn()
method. Updating the code to use $order->get('payment_gateway')->entity->id()
resolved the issue and orders were again marked as paid.
Update the payment creation code in onReturn()
to use the payment gateway entity ID from the order object. This change restores expected functionality and compatibility.
I am opening a merge request for the fix.
Active
2.0
Code