You are here

function commerce_cardonfile_set_default_card in Commerce Card on File 7.2

Set a card's instance default value.

Deprecated

Set $card->instance_default directly instead.

1 call to commerce_cardonfile_set_default_card()
commerce_cardonfile_commerce_checkout_form_submit in ./commerce_cardonfile.module
Checkout form submit callback to process card on file options

File

./commerce_cardonfile.module, line 976
Supports card on file functionality for credit card payment methods by associating card data reference IDs from payment gateways with user accounts.

Code

function commerce_cardonfile_set_default_card($card_id) {
  if ($card = commerce_cardonfile_load($card_id)) {
    $card->instance_default = 1;
    return $card
      ->save();
  }
}