diff --git a/booking.module b/booking.module index d7344b9..9200e2f 100644 --- a/booking.module +++ b/booking.module @@ -760,11 +760,10 @@ function booking_node_info() { /** * Implements hook_library(). */ - /* function booking_library() { $module_path = drupal_get_path('module', 'booking'); - $items['stripe'] = array( + $items['booking-stripe'] = array( 'title' => t('Stripe'), 'version' => '1.0', 'js' => array( @@ -775,7 +774,6 @@ function booking_library() { return $items; } -*/ /** * Implements hook_libraries_info(). diff --git a/booking.stripe.inc b/booking.stripe.inc index 541b445..a93cc6c 100644 --- a/booking.stripe.inc +++ b/booking.stripe.inc @@ -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.', 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['booking_stripeform'] = array( 'pubkey' => _booking_get_stripe_public_key(), 'form_selector' => str_replace('_', '-', __FUNCTION__), ); - $form['#attached'] = array( 'js' => array( array('data' => $setting, 'type' => 'setting'), - drupal_get_path('module', 'booking') . '/booking.stripe.js', + //drupal_get_path('module', 'booking') . '/booking.stripe.js', ), - /* 'library' => array( - array('booking', 'stripe'), + array('booking', 'booking-stripe'), ), - */ ); $form['stripeToken'] = array(