You are here

function commerce_stripe_cardonfile_create in Commerce Stripe 7

Same name and namespace in other branches
  1. 7.3 commerce_stripe.module \commerce_stripe_cardonfile_create()
  2. 7.2 commerce_stripe.module \commerce_stripe_cardonfile_create()

Card on file callback: create

1 call to commerce_stripe_cardonfile_create()
commerce_stripe_cardonfile_create_form_submit in ./commerce_stripe.module
1 string reference to 'commerce_stripe_cardonfile_create'
commerce_stripe_commerce_payment_method_info in ./commerce_stripe.module
Implements hook_commerce_payment_method_info().

File

./commerce_stripe.module, line 1016
This module provides Stripe (http://stripe.com/) payment gateway integration to Commerce. Commerce Stripe offers a PCI-compliant way to process payments straight from you Commerce shop.

Code

function commerce_stripe_cardonfile_create($form, &$form_state, $payment_method, $card_data) {
  $card = _commerce_stripe_create_card($form_state['values']['stripe_token'], $card_data->uid, $payment_method);
  if (!$card) {
    return;
  }
  _commerce_stripe_save_cardonfile($card, $card_data->uid, $payment_method, $form_state['values']['credit_card']['cardonfile_instance_default']);
}