Forums

Authorize.net Issue "Ship To First Name is required"

samoht 22 Oct, 2009
Hello guys,

I have a form that has been working for a year or so now - I updated it to included a Bill To Country of United States (even though this is supposed to be optional). And now my form gets denied because it says the
Ship To First Name is required
??

when I remove the bill to country from the Authorize.net plugin x_country Field then I get the error:
Bill To Country is required.
??

Any ideas what might have happened?

thanks,
GreyHead 22 Oct, 2009
Hi samoht,

Absolutely no idea. I'm certain that the plugin hasn't changed (though the interaction with ChronoForms may have).

Where do you see the error - is it a form validation? Or something you get back from Authorize.net?

Bob
samoht 22 Oct, 2009
the error shows up in the emailed form because I have this code to return error response from auth.net:

Transaction State: <span style="color:red; font-weight:bold;"><?php echo $cf_AUTHNET_response_code;?></span>
</p>
<p><?php echo $cf_AUTHNET_response_reason_text;?></p>


in the email template
GreyHead 22 Oct, 2009
Hi samoht,

I don't have an authorize.net account to check anything. It looks as though you may need some debug code to see exactly what is being sent to them.

Is it possible that there's a duplicated input name in the form?

Bob
samoht 22 Oct, 2009
it doesn't look like it?

here is my form html
<?php
$session =& JFactory::getSession();
$cf_id = $session->get('cf_id', '0');


// Check if the form is editable or not  
$readonly = ""; 
$edit = true; 
if ( $_POST['submit'] && $_POST['submit'] == "Confirm" ) { 
    $edit = false; 
    $readonly = "readonly='readonly'"; 
}
global $mainframe;
$database =& JFactory::getDBO();
if(!$cf_id){
$database->setQuery( '
SELECT *
FROM jos_chronoforms_giftcard_submit
WHERE cf_id = (
SELECT max( cf_id )
FROM jos_chronoforms_giftcard_submit ) 
');
}else{
$database->setQuery( '
SELECT *
FROM jos_chronoforms_giftcard_submit
WHERE cf_id = '.$cf_id.' 
');
}
$database->query();
$rows = $database->loadAssocList();


?>

<style type="text/css">
input[readonly] {border:none; background:transparent;}
.cb {display:block; float:left; width:6em;}
.info {text-align:left;}
</style>
<div class="mainform">
<p align="right"><a href="javascript:window.close();">Close Window</a></p>

<h3>GIFT CARD ORDER CONFIRMATION</h3>

<p>Your order is not complete. Please review the following information and click to confirm your order at the bottom of this page.</p>

<?php
foreach ($rows as $row){
	echo '
	<div class="info">
		<h3>From:</h3>
		<p>
			'.$row[fromname].' '.$row[fromname2].'<br />
			'.$row[fromaddress].'<br />
			'.$row[fromcity].', '.$row[fromstate].' '.$row[fromzip].'<br />
			Home #: '.$row[fromhome].' • Buisness #: '.$row[frombusiness].'<br />
			Fax #: '.$row[fromfax].' •  E-mail:'. $row[fromemail].'<br />';
} ?>
			<input name="fromname" type="hidden" value="<?php echo $row['fromname'];?>" />
			<input name="fromname2" type="hidden" value="<?php echo $row['fromname2'];?>" />
			<input name="fromaddress" type="hidden" value="<?php echo $row['fromaddress'];?>" />
			<input name="fromcity" type="hidden" value="<?php echo $row['fromcity'];?>" />
			<input name="fromstate" type="hidden" value="<?php echo $row['fromstate'];?>" />
			<input name="fromzip" type="hidden" value="<?php echo $row['fromzip'];?>" />
			<input name="billaddress" type="hidden" value="<?php if($row['billaddress']){ echo $row['billaddress'];}else{ echo $row['fromaddress'];}?>" /> 
			<input name="billcountry" type="hidden" value="US" /> 
			<input name="billcity" type="hidden" value="<?php if($row['billcity']){ echo $row['billcity'];}else{ echo $row['fromcity'];}?>" /> 
			<input name="billstate" type="hidden" value="<?php if($row['billstate']){ echo $row['billstate'];}else{ echo $row['fromstate'];}?>" /> 
			<input name="billzip" type="hidden" value="<?php if($row['billzip']){ echo $row['billzip'];}else{ echo $row['fromzip'];}?>" /> 
			<input name="fromhome" type="hidden" value="<?php echo $row['fromhome'];?>" />
			<input name="frombusiness" type="hidden" value="<?php echo $row['frombusiness'];?>" />
			<input name="fromfax" type="hidden" value="<?php echo $row['fromfax'];?>" />
			<input name="fromemail" type="hidden" value="<?php echo $row['fromemail'];?>" />
		</p>
		<h3>For:</h3>
		<p>
			<?php echo $row['forname'];?> <?php echo $row['forname2'];?><br />
			<?php echo $row['foraddress'];?><br />
			<?php echo $row['forcity'];?>, <?php echo $row['forstate'];?> <?php echo $row['forzip'];?><br />
			Home #: <?php echo $row['forhome'];?> • Buisness #: <?php echo $row['forbuisness'];?><br />
			Fax #: <?php echo $row['forfax'];?> •  E-mail: <?php echo $row['foremail'];?><br />
			<input name="forname" type="hidden" value="<?php echo $row['forname'];?>" />
			<input name="forname2" type="hidden" value="<?php echo $row['forname2'];?>" />
			<input name="foraddress" type="hidden" value="<?php echo $row['foraddress'];?>" />
			<input name="forcity" type="hidden" value="<?php echo $row['forcity'];?>" />
			<input name="forstate" type="hidden" value="<?php echo $row['forstate'];?>" />
			<input name="forzip" type="hidden" value="<?php echo $row['forzip'];?>" />
			<input name="forhome" type="hidden" value="<?php echo $row['forhome'];?>" />
			<input name="forbusiness" type="hidden" value="<?php echo $row['forbusiness'];?>" />
			<input name="forfax" type="hidden" value="<?php echo $row['forfax'];?>" />
			<input name="foremail" type="hidden" value="<?php echo $row['foremail'];?>" />
		</p>

		<p>Send To: <?php echo $row['mailto0'];?>
		<input type="hidden" name="mailto" value="<?php echo $row['mailto0'];?>" />
		</p>
		<input type="hidden" name="amount" value="<?php echo $row['amount2']; ?>" />

		<input type="hidden" name="otheramount" value="<?php echo $row['otheramount'];?>" >
		<input type="hidden" name="totalamount" value="<?php 
			if($row['otheramount']){
				echo $row['otheramount'] + $row['Shipping'];
			}else{ 
				echo $row['amount2'] + $row['Shipping'];
			};?>" >
		<input type="hidden" name="Shipping" value="<?php echo $row['Shipping'];?>" >
		<input type="hidden" name="CardType" value="<?php echo $row['CardType'];?>" >
		<input type="hidden" name="cardnumber" value="<?php echo $row['cardnumber'];?>" >
		<input type="hidden" name="expirationmonth" value="<?php echo $row['expirationmonth'];?>" >
		<input type="hidden" name="expirationyear" value="<?php echo $row['expirationyear'];?>" >
		<input type="hidden" name="cardname" value="<?php echo $row['cardname'];?>" >
		<br />
		<h3>Amount:</h3>
		<table border=0 cellpadding=0 cellspacing=0 width=47% style='border-collapse: collapse;'>
		<?php 
		if($row['otheramount']){
			echo '<tr><td> Gift card .............</td><td>$'.$row['otheramount'] . '.00</td></tr>'."\n";
		}else {
			echo '<tr><td> Gift card .............</td><td>$'.$row['amount2'] . '.00</td></tr>'."\n";
		}
			echo '<tr><td> Shipping .............</td><td>$'.$row['Shipping'].'.00</td></tr>'."\n";
		?>
		<tr><td colspan="2" style='border-bottom:1px solid black'> </td></tr>
		<tr><td><b>Total</b> .............</td><td>$<?php 
			if( $row['otheramount']){ 
				echo $row['otheramount'] + $row['Shipping'].'.00';
			}else{ 
				echo $row['amount2'] + $row['Shipping'].'.00';
			} ?></td></tr>
		</table>
		<h3>Credit Card Information</h3>
		<p>
			Card Type: <?php echo $row['CardType'];?><br />
			Card Number: <?php echo $row['cardnumber'];?><br />
			Expiration Date: <?php echo $row['expirationmonth'];?> / <?php echo $row['expirationyear'];?><br />
			Card Name: <?php echo $row['cardname'];?><br />
		</p>
	</div>
<table width="430" align="center">
	<tr>
		<td colspan="2"><center>
		<div> 
<p align=center> Please do not click the pay button more then once, multiple charges may occur. </p>
			<input type="submit" name="submit" value="Pay"  />  
			<input type="button" name="edit" value="Edit" onclick="window.location='index.php?option=com_chronocontact&chronoformname=giftcard_submit&cf_id=<?php echo $row[cf_id]; ?>'"/> 
		</div>  
		</center></td>
	</tr>
</table>
</div>


and then on the plugin I have this:
x_card_num = cardnumber
x_exp_date_m = expirationmonth
x_exp_date_y = expirationyear
x_description =
x_amount = totalamount
x_first_name = fromname
x_last_name = fromname2
x_address = billaddress
x_city = billcity
x_state = billstate
x_zip = billzip
x_invoice_num =
x_cust_id =
x_company =
x_country = billcountry
x_phone = fromhome
x_fax = fromfax
x_email = fromemail
samoht 22 Oct, 2009
here is the output from the debug:[attachment=0]debug.png[/attachment]
GreyHead 22 Oct, 2009
Hi samoht,

No, all that looks fine. Do you know what is actually being sent to Authorize.net - are there any obvious differences?

Bob
samoht 22 Oct, 2009
hmmm, I'm not sure how to check what is being sent to authorize.net??
GreyHead 22 Oct, 2009
Hi Samoht,

I missed your last post - I don't see a ship to name in the Authorize.net plugin info you posted?

Have you take it out again?

Bob
samoht 22 Oct, 2009
Hi Bob,

No I didn't take it out - I don't see where it should go?
GreyHead 23 Oct, 2009
Hi samoht,

Sorry I have really no idea what the fields mean. I'd expect the x_first_name field to be the Ship To First name but I don't know :-(

Have authorize.net changed their specification since Max wrote the plugin???

Bob
samoht 23 Oct, 2009
not that I know of.

I suppose the best thing to do is build a simple form with only basic info - set the auth.net account to test mode and see if it still complains.

what I can't understand is that both Bill to country and Ship to First name are Optional according to auth.net So that should mean that if I do not provide them at all the payment should still go through.

urr
This topic is locked and no more replies can be posted.