You are here

function payment_ubercart_order_id_load in Payment for Ubercart 7

Same name and namespace in other branches
  1. 7.2 payment_ubercart.module \payment_ubercart_order_id_load()

Load the ID of the Ubercart order a Payment belongs to.

Parameters

Payment $payment:

Return value

integer

1 call to payment_ubercart_order_id_load()
payment_ubercart_payment_status_change in ./payment_ubercart.module
Implements hook_payment_status_change().

File

./payment_ubercart.module, line 236
Hook implementations and shared functions.

Code

function payment_ubercart_order_id_load(Payment $payment) {
  if (!isset($payment->payment_ubercart_uc_order_id)) {
    $payment->payment_ubercart_uc_order_id = db_query("SELECT uc_order_id FROM {payment_ubercart} WHERE pid = :pid", array(
      ':pid' => $payment->pid,
    ))
      ->fetchField();
  }
  return (bool) $payment->payment_ubercart_uc_order_id;
}