function pay_load in Pay 6
API Function: Load a payment class.
10 calls to pay_load()
- pay_activity_load in ./
pay.module - API Function: Load a payment activity object.
- pay_form in ./
pay.module - A simple form any type of pay element. If you want to build a module with a standalone payment form, you would do so by passing this function to the drupal_get_form page handler in your hook_menu() funcion.
- pay_form_callback in ./
pay.module - A helper function for FAPI validate/submit callbacks. Locates any pay elements in a form and calls thier handler code.
- pay_form_load in ./
pay.module - API Function: Load a payment form object.
- pay_handler_field_handler::render in includes/
views/ pay_handler_field_handler.inc
File
- ./
pay.module, line 191 - Pay module allows for accepting payments using pluggable payment backends.
Code
function pay_load($type, $values = NULL) {
if (is_scalar($values)) {
if (is_numeric($values)) {
if ($type == 'pay_form') {
$key = 'pfid';
}
if ($type == 'pay_method') {
$key = 'pmid';
}
if ($type == 'pay_item') {
$key = 'piid';
}
if ($type == 'pay_transaction') {
$key = 'pxid';
}
if ($type == 'pay_activity') {
$key = 'paid';
}
if ($values = db_fetch_object(db_query("SELECT * from {%s}\n WHERE {$key} = %d", $type, $values))) {
$handler = isset($values->handler) ? $values->handler : $type;
}
else {
return FALSE;
}
}
else {
// It's just the name of a handler. Load it with defaults.
$handler = $values;
$values = NULL;
}
}
else {
$values = (object) $values;
if (isset($values->handler)) {
$handler = $values->handler;
}
elseif (isset($values->pmid)) {
$handler_values = pay_load($type, $values->pmid);
$handler = get_class($handler_values);
$values = array_merge((array) $handler_values, (array) $values);
}
else {
// Allow return of a generic object of the type requested.
$handler = $type;
}
}
if (pay_load_handler($type, $handler)) {
return new $handler($values);
}
}