You are here

function payment_ubercart_order_id_save in Payment for Ubercart 7.2

Same name and namespace in other branches
  1. 7 payment_ubercart.module \payment_ubercart_order_id_save()

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

Parameters

Payment $payment:

Return value

integer Either MergeQuery::STATUS_INSERT or MergeQuery::STATUS_UPDATE.

2 calls to payment_ubercart_order_id_save()
PaymentUbercartDeleteOrderWebTestCase::testDeleteOrder in tests/PaymentUbercartDeleteOrderWebTestCase.test
payment_ubercart_checkout_form_submit in ./payment_ubercart.module
Implements form submit callback.

File

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

Code

function payment_ubercart_order_id_save(Payment $payment) {
  return db_merge('payment_ubercart')
    ->key(array(
    'pid' => $payment->pid,
  ))
    ->fields(array(
    'pid' => $payment->pid,
    'uc_order_id' => $payment->payment_ubercart_uc_order_id,
  ))
    ->execute();
}