You are here

function commerce_payment_transaction_new in Commerce Core 7

Returns an initialized payment transaction object.

Parameters

$method_id: The method_id of the payment method for the transaction.

Return value

A transaction object with all default fields initialized.

2 calls to commerce_payment_transaction_new()
commerce_payment_example_transaction in modules/payment/modules/commerce_payment_example.module
Creates an example payment transaction for the specified charge amount.
commerce_payment_pane_checkout_form_submit in modules/payment/includes/commerce_payment.checkout_pane.inc
Payment pane: submit callback.

File

modules/payment/commerce_payment.module, line 872
Defines the payment system and checkout integration.

Code

function commerce_payment_transaction_new($method_id = '', $order_id = 0) {
  return entity_get_controller('commerce_payment_transaction')
    ->create(array(
    'payment_method' => $method_id,
    'order_id' => $order_id,
  ));
}