| 14 |
} |
} |
| 15 |
|
|
| 16 |
/** |
/** |
| 17 |
* Implementation of hook_menu(). |
* Implement hook_menu(). |
| 18 |
*/ |
*/ |
| 19 |
function simple_paypal_menu() { |
function simple_paypal_menu() { |
| 20 |
$items = array(); |
$items = array(); |
| 21 |
|
|
| 22 |
$items['admin/settings/paypal'] = array( |
$items['admin/config/paypal'] = array( |
| 23 |
'title' => 'Paypal', |
'title' => 'PayPal', |
| 24 |
'page callback' => 'drupal_get_form', |
'description' => 'PayPal.', |
| 25 |
'page arguments' => array('simple_paypal_admin'), |
'page callback' => 'system_admin_menu_block_page', |
| 26 |
'description' => 'Administer Paypal', |
'access arguments' => array('access administration pages'), |
| 27 |
'access arguments' => array('access administration pages'), |
'file' => 'system.admin.inc', |
| 28 |
'type' => MENU_NORMAL_ITEM, |
'file path' => drupal_get_path('module', 'system'), |
| 29 |
); |
); |
| 30 |
|
|
| 31 |
return $items; |
$items['admin/config/paypal/settings'] = array( |
| 32 |
} |
'title' => 'PayPal settings', |
| 33 |
|
'page callback' => 'drupal_get_form', |
| 34 |
|
'page arguments' => array('simple_paypal_admin'), |
| 35 |
|
'access arguments' => array('administer site configuration'), |
| 36 |
|
'description' => 'Administer PayPal.', |
| 37 |
|
); |
| 38 |
|
|
| 39 |
|
return $items; |
| 40 |
|
} |
| 41 |
|
|
|
/** |
|
|
* Implementation of hook_admin(). |
|
|
*/ |
|
| 42 |
function simple_paypal_admin() { |
function simple_paypal_admin() { |
| 43 |
$form[SIMPLE_PAYPAL_URL] = array( |
$form[SIMPLE_PAYPAL_URL] = array( |
| 44 |
'#type' => 'select', |
'#type' => 'select', |
| 45 |
'#title' => t('Payment URL for Paypal'), |
'#title' => t('Payment URL for PayPal'), |
| 46 |
'#default_value' => variable_get(SIMPLE_PAYPAL_URL, SIMPLE_PAYPAL_URL_LIVE), |
'#default_value' => variable_get(SIMPLE_PAYPAL_URL, SIMPLE_PAYPAL_URL_LIVE), |
| 47 |
'#options' => simple_paypal_get_urls(), |
'#options' => simple_paypal_get_urls(), |
| 48 |
'#description' => t('Select whether you want to use a live URL, or a test one.'), |
'#description' => t('Select whether you want to use a live URL, or a test one.'), |
| 113 |
function simple_paypal_ipn_verify($vars = array()) { |
function simple_paypal_ipn_verify($vars = array()) { |
| 114 |
// If we are in test mode, log the variables. |
// If we are in test mode, log the variables. |
| 115 |
if (SIMPLE_PAYPAL_URL_TEST == variable_get(SIMPLE_PAYPAL_URL, SIMPLE_PAYPAL_URL_TEST)) { |
if (SIMPLE_PAYPAL_URL_TEST == variable_get(SIMPLE_PAYPAL_URL, SIMPLE_PAYPAL_URL_TEST)) { |
| 116 |
watchdog('simple_paypal', 'Post variables from Paypal IPN <pre>@vars</pre>', array( |
watchdog('simple_paypal', 'Post variables from PayPal IPN <pre>@vars</pre>', array( |
| 117 |
'@vars' => print_r($vars, TRUE)), WATCHDOG_DEBUG); |
'@vars' => print_r($vars, TRUE)), WATCHDOG_DEBUG); |
| 118 |
} |
} |
| 119 |
|
|