function uc_authorizenet_charge in Ubercart 5
Same name and namespace in other branches
- 6.2 payment/uc_authorizenet/uc_authorizenet.module \uc_authorizenet_charge()
- 7.3 payment/uc_authorizenet/uc_authorizenet.module \uc_authorizenet_charge()
1 string reference to 'uc_authorizenet_charge'
- uc_authorizenet_payment_gateway in payment/uc_authorizenet/uc_authorizenet.module
- Implementation of hook_payment_gateway().
File
- payment/uc_authorizenet/uc_authorizenet.module, line 232
- Process payments using Authorize.net. Supports AIM and ARB.
Code
function uc_authorizenet_charge($order_id, $amount, $data) {
if (!_uc_authorizenet_curl_check()) {
return array(
'success' => FALSE,
);
}
$order = uc_order_load($order_id);
switch ($data['txn_type']) {
case UC_CREDIT_REFERENCE_TXN:
return _uc_authorizenet_cim_profile_charge($order, $amount, $data);
case UC_CREDIT_REFERENCE_SET:
if ($message = _uc_authorizenet_cim_profile_create($order)) {
return array(
'success' => FALSE,
'message' => $message,
);
}
else {
return array(
'success' => TRUE,
'message' => t('New customer profile created successfully at Authorize.Net.'),
);
}
default:
return _uc_authorizenet_charge($order, $amount, $data);
}
}