function commerce_payment_order_has_payments in Commerce Core 7
Checks if the order has any associated payment transactions.
Parameters
$order: A commerce_order object.
Return value
bool TRUE if payment transactions exist.
1 call to commerce_payment_order_has_payments()
- commerce_payment_form_commerce_order_ui_order_delete_form_alter in modules/
payment/ commerce_payment.module - Implements hook_form_FORM_ID_alter().
File
- modules/
payment/ commerce_payment.module, line 1194 - Defines the payment system and checkout integration.
Code
function commerce_payment_order_has_payments($order) {
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'commerce_payment_transaction')
->propertyCondition('order_id', $order->order_id, '=')
->propertyCondition('status', COMMERCE_PAYMENT_STATUS_FAILURE, '!=')
->count();
return $query
->execute() == 1;
}