- Issue created by @ixlr8
- 🇮🇱Israel jsacksick
There is specific handling whenever the state of the payment in PayPal is pending.
// Special handling of the "pending" state, if the order is "pending review" // we allow the order to go "through" to give a chance to the merchant // to accept the payment, in case manual review is needed. if ($state === 'pending' && $remote_state === 'pending') { $reason = $remote_payment['status_details']['reason']; if ($reason === 'PENDING_REVIEW') { $state = 'authorization'; } else { throw new PaymentGatewayException(sprintf('The PayPal payment is pending. Reason: %s.', $reason)); } }
This was added as part of #3143995: Pending payments stuck on the review step without any message → .
- 🇮🇱Israel jsacksick
The attached patch is allowing ECHECK with the state "pending" to go through.
In order for the payment state to be set to completed in Drupal, Webhooks have to be configured.I'm also wondering if there isn't a PayPal setting allowing you to set which state the payment should have in PayPal when this happens.
- 🇺🇸United States ixlr8
#3 works insofar as it allows the order to continue in a pending state. It does paint the order into a corner as there's no native way to manually change the payment state to "paid." It sets the payment status as "authorized" in the order. Attempting to "capture" the funds throws an error. This does make a case for either webhooks, as you described, or another way to just let the user set the status to "paid."