Hello, I have a payment form that has an option: "Mail a Check". If the user selects that, then I do not want to submit anything to authorize.net and just print the thank you message. Currently I am just ignoring the error that returns from authorize.net. Is there a way to skip the authorize.net processing completely and just go straight to my "On Submit code - after sending email" code block? (That's where I look at the payment type and (if necessary) authorize.net response code and print the thank you page). Here's the code... Thanks for any input on this.
<?php
$MyPlugins =& CFPlugins::getInstance($MyForm->formrow->id);
$MyPlugins->runPlugin('after_email', array('ONSUBMIT', 'ONLOADONSUBMIT'), 'cf_Authorize_dotnet');
$msg = "";
$printThanks = "yes";
if ( $MyPlugins->cf_Authorize_dotnet['response_code'] == 'Approved' ) {
$msg = "Credit Card Transaction Approved.<br><br>Thank you for signing up for a Corporate Membership! You should be receiving a confirmation email very soon. If you have any questions, please do not hesitate to contact us.";
}
else {
if ( JRequest::getVar('payment_method') == "Mail_a_Check" ) {
$msg = "Thank you for signing up for a Corporate Membership! Please see below for instructions for mailing your check.";
}
else {
$MyForm->addErrorMsg( 'An error occured with the Credit Card Processing:<br />'.$MyPlugins->cf_Authorize_dotnet['response_code'].': '.$MyPlugins->cf_Authorize_dotnet['response_reason_text'] );
$MyForm->haltFunction["autogenerated_after_email"] = true;
$printThanks = "no";
}
}
if ( $printThanks == "yes" ) { ?>
<h1>Thank you!<h1><div style='font-size: 18pt;'><?=$msg ?></div>
<br/>
<div style='font-size: 14pt;'>
<b>Membership details:</b>
<table>
<tr style='font-size: 14pt;'><td>Company Name:</td><td>{co_name}</td></tr>
<tr style='font-size: 14pt;'><td>Company Rep:</td><td>{rep}</td></tr>
<tr style='font-size: 14pt;'><td>Address:</td><td>{addr}</td></tr>
<tr style='font-size: 14pt;'><td>City:</td><td>{city}</td></tr>
<tr style='font-size: 14pt;'><td>State:</td><td>{state}</td></tr>
<tr style='font-size: 14pt;'><td>Zip:</td><td>{zip}</td></tr>
<tr style='font-size: 14pt;'><td>Country:</td><td>{country}</td></tr>
<tr style='font-size: 14pt;'><td>Phone:</td><td>{phone}</td></tr>
<tr style='font-size: 14pt;'><td>Email:</td><td>{email}</td></tr>
<tr style='font-size: 14pt;'><td>Fax:</td><td>{fax}</td></tr>
<tr style='font-size: 14pt;'><td>Membership Level:</td><td>{membershipType}</td></tr>
<tr style='font-size: 14pt;'><td>Payment Method:</td><td>{payment_method}</td></tr>
<tr style='font-size: 14pt;'><td>Total Amount:</td><td>{total}</td></tr>
<tr style='font-size: 14pt;'><td>Membership Description:</td><td>{description}</td></tr>
</table>
</div>
<br/>
<div style='font-size: 12pt;'>
If you chose to Mail A Check, please send a check made out to ASGSB to:
<p style="text-align: center;">
<span style="color: #000000; font-family: 'arial black', 'avant garde'; font-size: 12pt;">
American Society for Gravitational and Space Biology<br/>
P.O. Box 27057<br/>
Washington, D.C. 20038-7057
</span>
</p>
</div>
<?}?>