You are here

function commerce_cardonfile_testing_payment_cardonfile_charge in Commerce Card on File 7.2

Card on File callback: charge credit card.

1 call to commerce_cardonfile_testing_payment_cardonfile_charge()
commerce_cardonfile_testing_payment_submit_form_submit in tests/commerce_cardonfile_testing/commerce_cardonfile_testing.module
Payment method callback: submit form submission.
1 string reference to 'commerce_cardonfile_testing_payment_cardonfile_charge'
commerce_cardonfile_testing_commerce_payment_method_info in tests/commerce_cardonfile_testing/commerce_cardonfile_testing.module
Implements hook_commerce_payment_method_info().

File

tests/commerce_cardonfile_testing/commerce_cardonfile_testing.module, line 147
Provides a test payment method implementing the Card on File API.

Code

function commerce_cardonfile_testing_payment_cardonfile_charge($payment_method, $card, $order, $charge = NULL) {
  if (!isset($charge)) {
    $wrapper = entity_metadata_wrapper('commerce_order', $order);
    $charge = commerce_line_items_total($wrapper->commerce_line_items);
  }
  return commerce_cardonfile_testing_payment_transaction($payment_method, $order, $charge);
}