You are here

function payment_commerce_transaction_fill in Payment for Drupal Commerce 7.2

Same name and namespace in other branches
  1. 7 payment_commerce.module \payment_commerce_transaction_fill()

Fill a Commerce payment traction with Payment payment information.

3 calls to payment_commerce_transaction_fill()
PaymentCommerceDeleteOrderWebTestCase::assertCreateAndDeleteOrderAndPayment in tests/PaymentCommerceDeleteOrderWebTestCase.test
Creates an order, transaction and Payment, and then deletes them.
payment_commerce_form_process_submit_form_submit in ./payment_commerce.module
Implements CALLBACK_commerce_payment_method_submit_form_submit().
payment_commerce_payment_status_change in ./payment_commerce.module
Implements hook_payment_status_change().

File

./payment_commerce.module, line 303
Hook implementations and shared functions.

Code

function payment_commerce_transaction_fill($transaction, Payment $payment) {
  $transaction->amount = $payment->context_data['balance_amount'];
  $transaction->currency_code = $payment->currency_code;
  $transaction->message = payment_status_info($payment
    ->getStatus()->status, TRUE)->title;
  $transaction->remote_id = $payment->pid;
  $transaction->remote_status = payment_status_info($payment
    ->getStatus()->status, TRUE)->title;
  $transaction->status = payment_commerce_status_convert($payment
    ->getStatus()->status);
}