This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 4
Authorize.Net - - >On Failed Transaction
Started 9 years ago by enuffsaid | 1 post |
-
Greetings,
"payment_submit_authorizenet.php" is currently set to capture the transaction details and write them to the database when there is a successful transaction. BUT, if the card is declined, nothing is written to the database.
if($payment_success === true){
$payment_status = "ok";
$_SESSION['mf_payment_completed'][$form_id] = true;//revoke access to form payment page
unset($_SESSION['mf_form_payment_access'][$form_id]);//insert into ap_form_payments table
$payment_data['payment_fullname'] = trim($payment_data['first_name'].' '.$payment_data['last_name']);
$payment_data['form_id'] = $form_id;
$payment_data['record_id'] = $payment_record_id;
$payment_data['date_created'] = date("Y-m-d H:i:s");
$payment_data['status'] = 1;
$payment_data['payment_status'] = 'paid';$query = "INSERT INTO
".MF_TABLE_PREFIX."form_payments
(QUESTION
Is it possible to update the "else" portion of the statement to write the RESPONSE CODE and accompanying data just as you would for a "1 = APPROVED" transaction? Yes I can review the transaction in Authorize.net, but if you are already accessing the data, why not write it to the database?
mf_do_query($query,$params,$dbh);
}else{
$payment_status = "error";
}Thank you.
Posted 9 years ago #
Reply
You must log in to post.