You are here

function commerce_stripe_cardonfile_create in Commerce Stripe 7.2

Same name and namespace in other branches
  1. 7.3 commerce_stripe.module \commerce_stripe_cardonfile_create()
  2. 7 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 497
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($_POST['stripeToken'], $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']);
}