Not sure if it's best to continue with this topic or head to Development, but I have a problem. I've modified the 2CO module with all the NAB HPP stuff and the module appears in the correct place and can be activated. This is where the joy ends as it doesn't show up as a payment method within Ubercart.
The relevant code from what I can tell relates to hook_payment_method.
<?php
/**
* Implementation of hook_payment_method().
*/
function uc_nabhpp_payment_method() {
$methods[] = array(
'id' => 'nabhpp',
'name' => t('NAB Transact'),
'title' => t('NAB Hosted Payment Page'),
'review' => t('Credit card'),
'desc' => t('Redirect to NAB to pay by credit card.'),
'callback' => 'uc_payment_method_nabhpp',
'weight' => 1,
'checkout' => TRUE,
'backend' => TRUE,
'no_gateway' => TRUE,
);
return $methods;
}
/*******************************************************************************
* Callback Functions, Forms, and Tables
******************************************************************************/
/**
* Callback for NAB Transact Hosted Payment Page settings.
*/
function uc_payment_method_nabhpp($op, &$arg1) {
switch ($op) {
case 'cart-details':
return;
case 'cart-process':
return;
case 'settings':
$form['uc_nabhpp_vendor_name'] = array(
'#type' => 'textfield',
'#title' => t('Vendor Name'),
'#description' => t('Your NAB merchant ID.'),
'#default_value' => variable_get('uc_nabhpp_vendor_name', 'NAB0010'),
'#size' => 16,
);
$form['uc_nabhpp_payment_alert'] = array(
'#type' => 'textfield',
'#title' => t('Merchant Notification Email'),
'#description' => t('If you have not set up an email address in the administration, reporting and search tool to receive payment notifications, provide the email address that you want to receive an email when an order is processed by the NAB Transact Payment Page.'),
'#default_value' => variable_get('uc_nabhpp_payment_alert', ''),
'#size' => 64,
);
$form['uc_nabhpp_refund_policy'] = array(
'#type' => 'textfield',
'#title' => t('Refund Policy URL'),
'#description' => t('Link to your refund policy.'),
'#default_value' => variable_get('uc_nabhpp_refund_policy', ''),
'#size' => 64,
);
$form['uc_nabhpp_privacy_policy'] = array(
'#type' => 'textfield',
'#title' => t('Privacy Policy URL'),
'#description' => t('Link to your privacy policy.'),
'#default_value' => variable_get('uc_nabhpp_privacy_policy', ''),
'#size' => 64,
);
$form['uc_nabhpp_payment_server'] = array(
'#type' => 'select',
'#title' => t('Payment Server'),
'#description' => t('Select Test or Live payment page.'),
'#options' => array(
'test' => t('Test payment page'),
'live' => t('Live payment page'),
),
'#default_value' => variable_get('uc_nabhpp_payment_server', 'test'),
);
$form['uc_nabhpp_checkout_button'] = array(
'#type' => 'textfield',
'#title' => t('Order review submit button text'),
'#description' => t('Text for the submit button on the order review page.'),
'#default_value' => variable_get('uc_nabhpp_checkout_button', t('Submit Order')),
);
return $form;
}
}
?>Can you see any obvious problems there? Cheers.



Joined: 07/16/2008