function uc_stripe_uc_checkout_complete in Ubercart Stripe 6.2
Same name and namespace in other branches
- 8.3 uc_stripe.module \uc_stripe_uc_checkout_complete()
- 8.2 uc_stripe.module \uc_stripe_uc_checkout_complete()
- 7.3 uc_stripe.module \uc_stripe_uc_checkout_complete()
- 7.2 uc_stripe.module \uc_stripe_uc_checkout_complete()
Implements hook_uc_checkout_complete()
Saves stripe customer_id into the user object
Parameters
$order:
$account:
File
- ./
uc_stripe.module, line 133 - A stripe.js PCI-compliant payment gateway Forked from Bitcookie's work (thanks!) which was posted at http://bitcookie.com/blog/pci-compliant-ubercart-and-stripe-js from discussion in the uc_stripe issue queue, https://www.drupal.org/node/1467886
Code
function uc_stripe_uc_checkout_complete($order, $account) {
// Pull the stripe customer ID from the session.
// It got there in uc_stripe_checkout_form_customsubmit()
$stripe_customer_id = $_SESSION['stripe']['customer_id'];
$loaded_user = user_load(array(
'uid' => $account->uid,
));
user_save($loaded_user, array(
"uc_stripe_customer_id" => $stripe_customer_id,
));
}