test library settings
This commit is contained in:
@@ -760,6 +760,7 @@ function booking_node_info() {
|
|||||||
/**
|
/**
|
||||||
* Implements hook_library().
|
* Implements hook_library().
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
function booking_library() {
|
function booking_library() {
|
||||||
$module_path = drupal_get_path('module', 'booking');
|
$module_path = drupal_get_path('module', 'booking');
|
||||||
|
|
||||||
@@ -774,6 +775,7 @@ function booking_library() {
|
|||||||
|
|
||||||
return $items;
|
return $items;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements hook_libraries_info().
|
* Implements hook_libraries_info().
|
||||||
|
@@ -54,11 +54,13 @@ function booking_stripeform_form($form, &$form_state) {
|
|||||||
$form['#attached'] = array(
|
$form['#attached'] = array(
|
||||||
'js' => array(
|
'js' => array(
|
||||||
array('data' => $setting, 'type' => 'setting'),
|
array('data' => $setting, 'type' => 'setting'),
|
||||||
//drupal_get_path('module', 'booking') . '/booking.stripe.js',
|
drupal_get_path('module', 'booking') . '/booking.stripe.js',
|
||||||
),
|
),
|
||||||
|
/*
|
||||||
'library' => array(
|
'library' => array(
|
||||||
array('booking', 'stripe'),
|
array('booking', 'stripe'),
|
||||||
),
|
),
|
||||||
|
*/
|
||||||
);
|
);
|
||||||
|
|
||||||
$form['stripeToken'] = array(
|
$form['stripeToken'] = array(
|
||||||
@@ -188,8 +190,9 @@ function booking_stripeform_validate_form_payment($form, &$form_state) {
|
|||||||
));
|
));
|
||||||
if ($charge && $charge->paid) {
|
if ($charge && $charge->paid) {
|
||||||
watchdog('booking', 'Charge created successfully');
|
watchdog('booking', 'Charge created successfully');
|
||||||
$form_state['stripeform_charge'] = $charge;
|
$form_state['stripeform_charge'] = $charge;
|
||||||
//drupal_goto('bookingfinal');
|
watchdog('booking_debug', "<pre>Stripe payment charge results:\n@info</pre>", array('@info' => print_r( $charge, true)));
|
||||||
|
drupal_goto('bookingfinal');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
drupal_set_message('Card does not seem to have been charged successfully. Please try again', 'error');
|
drupal_set_message('Card does not seem to have been charged successfully. Please try again', 'error');
|
||||||
|
@@ -44,7 +44,6 @@
|
|||||||
|
|
||||||
var stripeResponseHandler = function(status, response) {
|
var stripeResponseHandler = function(status, response) {
|
||||||
var $form = $("#" + Drupal.settings.booking_stripeform.form_selector);
|
var $form = $("#" + Drupal.settings.booking_stripeform.form_selector);
|
||||||
alert($form);
|
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
alert(response.error.message);
|
alert(response.error.message);
|
||||||
} else {
|
} else {
|
||||||
@@ -52,7 +51,6 @@
|
|||||||
var token = response.id;
|
var token = response.id;
|
||||||
// Insert the token into the form so it gets submitted to the server
|
// Insert the token into the form so it gets submitted to the server
|
||||||
$('input[name=stripeToken]', $form).val(token);
|
$('input[name=stripeToken]', $form).val(token);
|
||||||
alert(token);
|
|
||||||
// and submit
|
// and submit
|
||||||
$form.get(0).submit();
|
$form.get(0).submit();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user