fixes
This commit is contained in:
@@ -248,7 +248,8 @@ function booking_menu() {
|
|||||||
// @todo remove this after testing
|
// @todo remove this after testing
|
||||||
$items['stripetest'] = array(
|
$items['stripetest'] = array(
|
||||||
'title' => $bookingTitle . ' Stripe Test',
|
'title' => $bookingTitle . ' Stripe Test',
|
||||||
'page callback' => 'booking_stripeform_form',
|
'page callback' => 'drupal_get_form',
|
||||||
|
'page arguments' => array('booking_stripeform_form'),
|
||||||
'access arguments' => array('access booking form'),
|
'access arguments' => array('access booking form'),
|
||||||
'type' => MENU_NORMAL_ITEM,
|
'type' => MENU_NORMAL_ITEM,
|
||||||
);
|
);
|
||||||
|
@@ -34,9 +34,8 @@ function _booking_get_stripe_private_key() {
|
|||||||
* Sample Stripe Form.
|
* Sample Stripe Form.
|
||||||
*/
|
*/
|
||||||
function booking_stripeform_form($form, &$form_state) {
|
function booking_stripeform_form($form, &$form_state) {
|
||||||
|
|
||||||
// Let's make sure you have the stripe library installed.
|
// Let's make sure you have the stripe library installed.
|
||||||
if($path = libraries_get_path('stripe-php-latest')) {
|
if($path = libraries_get_path('stripe')) {
|
||||||
if(!is_file($path . '/lib/Stripe.php')) {
|
if(!is_file($path . '/lib/Stripe.php')) {
|
||||||
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'))));
|
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'))));
|
||||||
}
|
}
|
||||||
@@ -167,7 +166,7 @@ function booking_stripeform_validate_form_payment($form, &$form_state) {
|
|||||||
if($errors = form_get_errors()) {
|
if($errors = form_get_errors()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$path = libraries_get_path('stripe-php-latest');
|
$path = libraries_get_path('stripe');
|
||||||
require_once($path . '/lib/Stripe.php');
|
require_once($path . '/lib/Stripe.php');
|
||||||
|
|
||||||
Stripe::setApiKey(STRIPEFORM_PRIVATE_KEY);
|
Stripe::setApiKey(STRIPEFORM_PRIVATE_KEY);
|
||||||
|
Reference in New Issue
Block a user