change library config
This commit is contained in:
@@ -760,11 +760,10 @@ 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');
|
||||||
|
|
||||||
$items['stripe'] = array(
|
$items['booking-stripe'] = array(
|
||||||
'title' => t('Stripe'),
|
'title' => t('Stripe'),
|
||||||
'version' => '1.0',
|
'version' => '1.0',
|
||||||
'js' => array(
|
'js' => array(
|
||||||
@@ -775,7 +774,6 @@ function booking_library() {
|
|||||||
|
|
||||||
return $items;
|
return $items;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements hook_libraries_info().
|
* Implements hook_libraries_info().
|
||||||
|
@@ -44,23 +44,23 @@ function booking_stripeform_form($form, &$form_state) {
|
|||||||
form_set_error('form', t('You need to install the stripe library from !link before you can use this form.',
|
form_set_error('form', t('You need to install the stripe library from !link before you can use this form.',
|
||||||
array('!link' => l('here', 'https://stripe.com/docs/libraries'))));
|
array('!link' => l('here', 'https://stripe.com/docs/libraries'))));
|
||||||
}
|
}
|
||||||
|
//load the main stripe library
|
||||||
|
libraries_load('stripe');
|
||||||
|
|
||||||
|
//set some values for our internal stripe library to help process the form
|
||||||
$setting = array();
|
$setting = array();
|
||||||
$setting['booking_stripeform'] = array(
|
$setting['booking_stripeform'] = array(
|
||||||
'pubkey' => _booking_get_stripe_public_key(),
|
'pubkey' => _booking_get_stripe_public_key(),
|
||||||
'form_selector' => str_replace('_', '-', __FUNCTION__),
|
'form_selector' => str_replace('_', '-', __FUNCTION__),
|
||||||
);
|
);
|
||||||
|
|
||||||
$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', 'booking-stripe'),
|
||||||
),
|
),
|
||||||
*/
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$form['stripeToken'] = array(
|
$form['stripeToken'] = array(
|
||||||
|
Reference in New Issue
Block a user