You are here

function uc_payment_enter in Ubercart 5

Same name and namespace in other branches
  1. 8.4 payment/uc_payment/uc_payment.module \uc_payment_enter()
  2. 6.2 payment/uc_payment/uc_payment.module \uc_payment_enter()
  3. 7.3 payment/uc_payment/uc_payment.module \uc_payment_enter()

Enter a payment for an order.

6 calls to uc_payment_enter()
uc_2checkout_complete in payment/uc_2checkout/uc_2checkout.module
uc_payment_by_order_form_submit in payment/uc_payment/uc_payment.module
uc_payment_pack_receive_check_form_submit in payment/uc_payment_pack/uc_payment_pack.module
uc_payment_process in payment/uc_payment/uc_payment.module
Process a payment through an enabled payment gateway.
uc_paypal_ipn in payment/uc_paypal/uc_paypal.module

... See full list

File

payment/uc_payment/uc_payment.module, line 967

Code

function uc_payment_enter($order_id, $method, $amount, $uid, $data, $comment) {
  $method_name = _payment_method_data($method, 'review');
  if (empty($method_name)) {
    $method_name = _payment_method_data($method, 'name');
  }
  if (is_null($method_name)) {
    $method_name = t('Other');
  }
  if (is_array($data)) {
    $data = serialize($data);
  }
  if (variable_get('uc_payment_logging', TRUE)) {
    global $user;
    $log_message = t('@method payment for @amount entered by @user.', array(
      '@method' => $method_name,
      '@amount' => uc_currency_format($amount),
      '@user' => uc_get_initials($user->uid),
    ));
    uc_order_log_changes($order_id, array(
      $log_message,
    ));
  }
  db_query("INSERT INTO {uc_payment_receipts} (receipt_id, order_id, method, amount, uid, data, comment, received) VALUES (%d, %d, '%s', %f, %d, '%s', '%s', %d)", db_next_id('{uc_payment_receipts}_receipt_id'), $order_id, $method_name, $amount, $uid, $data, $comment, time());
  if (module_exists('workflow_ng')) {
    workflow_ng_invoke_event('payment_entered', uc_order_load($order_id));
  }
}