Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (67 sloc) 2.42 KB
<?php
/**
* @file stripe.module
* Drupal hooks used for integrating the Stripe service.
*/
/**
* Implements hook_help().
*/
function stripe_help($path, $arg) {
if ($path == 'admin/config/stripe/keys') {
$output = '<ol>';
$output .= '<li>' . t('Enter the API keys you get from your <a href="@url">Stripe account page</a>.', array('@url' => 'https://manage.stripe.com/account')) . '</li>';
$output .= '<li>' . t('Use the radio buttons to choose which API Key should be used with this site.') . '</li>';
$output .= '<li>' . t('After designating an API Key, you might want to try out <a href="@url">the test form</a>.', array('@url' => '/admin/config/stripe/test')) . '</li>';
$output .= '</ol>';
return $output;
}
if ($path == 'admin/config/stripe/test') {
return '<p>' . t('This form is to test responses from Stripe. The default values are accepted by Stripe for testing purposes. Before you can use this form, you should <a href="@url">designate an active API Key</a>.', array('@url' => '/admin/config/stripe/keys')) . '</p>';
}
}
/**
* Implements hook_permission().
*/
function stripe_permission() {
return array(
'administer stripe' => array(
'title' => t('Administer the Stripe module'),
'description' => t('Allows access to configure API Keys and to the test form.'),
),
);
}
/**
* Implements hook_theme().
function stripe_theme() {
}
/**
* Implements hook_menu().
*/
function stripe_menu() {
$items['admin/config/stripe'] = array(
'title' => 'Stripe',
'description' => 'List of what the stripe module offers.',
'position' => 'right',
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('administer stripe'),
'weight' => -10,
'file' => 'system.admin.inc',
);
$items['admin/config/stripe/keys'] = array(
'title' => 'API Keys',
'description' => 'Enter API Keys and set which one should be active.',
'page callback' => 'drupal_get_form',
'page arguments' => array('stripe_admin_keys'),
'access arguments' => array('administer stripe'),
'file' => 'stripe.admin.inc',
);
$items['admin/config/stripe/test'] = array(
'title' => 'Test form',
'description' => 'A form for testing Stripe responses.',
'page callback' => 'drupal_get_form',
'page arguments' => array('stripe_admin_test'),
'access arguments' => array('administer stripe'),
'file' => 'stripe.admin.inc',
);
return $items;
}