function uc_stripe_checkout_form_customsubmit in Ubercart Stripe 6.2
Same name and namespace in other branches
- 7.3 uc_stripe.module \uc_stripe_checkout_form_customsubmit()
- 7.2 uc_stripe.module \uc_stripe_checkout_form_customsubmit()
Custom submit function to store the stripe token
Since we don't have a user account at this step, we're going to store the token in the session. We'll grab the token in the charge callback and use it to charge
_state
Parameters
$form:
1 string reference to 'uc_stripe_checkout_form_customsubmit'
- uc_stripe_form_uc_cart_checkout_form_alter in ./
uc_stripe.module - Implements hook_form_FORMID_alter() to change the checkout form All work as a result is done in JS, the ordinary post does not happen.
File
- ./
uc_stripe.module, line 275 - 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_checkout_form_customsubmit($form, &$form_state) {
// I do not understand why this is not in $form_state['values']
// Reaching into $_POST is not "normal". but can't find it otherwise.
$_SESSION['stripe']['token'] = $_POST['stripe_token'];
}