- πΊπΈUnited States TomTech
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.
When using the PayPal's Express Checkout payment method, if the user cancels the payment from the PayPal website, his order's payment method is removed:
// Display a message indicating the customer initiatied cancellation.
drupal_set_message(t('You have canceled checkout at PayPal but may resume the checkout process here when you are ready.'));
// Remove the payment information from the order data array.
$flow = $order->data['commerce_paypal_ec']['flow'];
unset($order->data['commerce_paypal_ec']);
unset($order->data['payment_method']);
After canceling, the user is redirected to the Drupal commerce review Checkout pane, and can then confirm his order without any payment method.
The fact that it is possible to complete an order without a valid payment method is indeed a Drupal Commerce issue, but the PayPal EC module should not remove the payment method in the first place.
Attached patch moves theses unsets to the express flow...
// Whether the order was executed through the Express checkout button.
$flow = $order->data['commerce_paypal_ec']['flow'];
// If the customer initially redirected to PayPal from the cart form...
if ($flow == 'ec') {
// Remove the payment information from the order data array.
unset($order->data['commerce_paypal_ec']);
unset($order->data['payment_method']);
// Send them back to the shopping cart page instead of the previous page in
// the checkout process.
commerce_order_status_update($order, 'cart', FALSE, NULL, t('Customer canceled Express Checkout at PayPal.'));
drupal_goto('cart');
}
Closed: outdated
2.0
PayPal EC
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.