-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuc_prepay.module
More file actions
45 lines (40 loc) · 1.21 KB
/
uc_prepay.module
File metadata and controls
45 lines (40 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
// $Id$
/**
* @file
* Provides the prepay payment method.
*/
/**
* Implementation of hook_payment_method().
*/
function uc_prepay_payment_method() {
$methods[] = array(
'id' => 'prepay',
'name' => t('Prepay'),
'title' => t('Prepay'),
'desc' => t('After receipt of the payment, your order will be processed.'),
'callback' => 'uc_payment_method_prepay',
'weight' => 1,
'checkout' => FALSE,
'no_gateway' => TRUE,
);
return $methods;
}
/**
* Handle the prepay payment method.
*/
function uc_payment_method_prepay($op, &$arg1) {
switch ($op) {
case 'cart-details':
$details = variable_get('uc_prepay_policy', t('Please pay using the invoice you will receive via email. After receipt of the payment, your order will be processed.'));
return $details;
case 'settings':
$form['uc_prepay_policy'] = array(
'#type' => 'textarea',
'#title' => t('Policy message'),
'#default_value' => variable_get('uc_prepay_policy', t('Please pay using the invoice you will receive via email. After receipt of the payment, your order will be processed.')),
'#description' => t('Help message shown at checkout.'),
);
return $form;
}
}