function uc_authorizenet_arb_user_cancel_form_submit in Ubercart 5
Same name and namespace in other branches
- 6.2 payment/uc_authorizenet/uc_authorizenet.pages.inc \uc_authorizenet_arb_user_cancel_form_submit()
File
- payment/
uc_authorizenet/ uc_authorizenet.module, line 1178 - Process payments using Authorize.net. Supports AIM and ARB.
Code
function uc_authorizenet_arb_user_cancel_form_submit($form_id, $form_values) {
$fee = uc_recurring_fee_load('user', $form_values['rfid']);
$result = uc_authorizenet_arb_cancel($fee['data'], $fee['order_id'], $fee);
// If the cancellation was successful...
if ($result) {
drupal_set_message(t('The recurring fee has been canceled.'));
// Set the fee's recurring charges to 0.
uc_recurring_fee_cancel($fee['rfid']);
}
else {
drupal_set_message(t('An error has occurred. Please try again and contact us if the problem persists.'), 'error');
}
return 'user/' . $uid;
}