cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Accept Hosted form address validation

Hi there!
I'm starting using Accept Hosted form, but I have my own donor's data form implemented. When I'm trying to send this data in "Request token" post with "hostedPaymentBillingAddressOptions" switched off it processes without having donor's data to transaction data. And when I'm trying to send it with "hostedPaymentBillingAddressOptions" switched on it shows donor's data in form and saves it but without any validation.

Can anyone help with it? In two words:
1) How to pass donor's data to transaction without displaying it in Accept Hosted form?
2) If there is no way to do the 1st - can I set donor's data to be readonly in form? Or when should I switch validation on?

 

Here is the XML I send to "https://apitest.authorize.net/xml/v1/request.api" to get token, if it will help.

<getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
	<merchantAuthentication>
		<name>MY_NAME</name>
		<transactionKey>MY_KEY</transactionKey>
	</merchantAuthentication>
	<transactionRequest>
		<transactionType>authCaptureTransaction</transactionType>
		<amount>20.00</amount>
		<billTo>
			<firstName>Ellen</firstName>
			<lastName>Johnson</lastName>
			<address>14 Main Street</address>
			<city>Pecan Springs</city>
			<state>TX</state>
			<zip>78783</zip>
			<country>USA</country>
		</billTo>
	</transactionRequest>
	<hostedPaymentSettings>
		<setting>
			<settingName>hostedPaymentButtonOptions</settingName>
			<settingValue>{"text": "Pay"}</settingValue>
		</setting>
		<setting>
			<settingName>hostedPaymentBillingAddressOptions</settingName>
			<settingValue>{"show": false}</settingValue>
		</setting>
		<setting>
			<settingName>hostedPaymentIFrameCommunicatorUrl</settingName>
			<settingValue>{"url":"MY_URL"}</settingValue>
		</setting>
		<setting>
			<settingName>hostedPaymentReturnOptions</settingName>
			<settingValue>{"showReceipt" : false, "cancelUrl": "MY_URL", "cancelUrlText": "Close"}</settingValue>
		</setting>
	</hostedPaymentSettings>
</getHostedPaymentPageRequest>

Thanks for help.

Kipa
Member
2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @kipa,

 

Unfortunately, with the current implementation of Accept Hosted, you only have a couple of options to do address verification through AVS.

 

You can show the address fields and optionally prepopulate them. Anything submitted in these fields will get validated through AVS. Unfortunately, those fields will always be editable.

 

Or...

 

You can not show those fields, in which case the transaction will be submitted without an address and no AVS check will take place.

 

We generally think you should show the fields, and having them editable is usually the preferred use case. If a customer's entering the card details themselves, there's a chance that they're entering a card that doesn't match the billing address already on file, so letting them specify or edit the address is a good thing. Even if you got an address specifically for that transaction right before you send them to the form, there's always the possibility that they get to the form and find out the card they want to use is expired (just one example). Having the ability to make a change to the card that they're going to use right there while they are in the form is valuable.

 

That said, the current options don't quite apply to everyone's ideal use case, so we've already got at least one request for this on our Ideas Forum (where others can take a look, contribute feedback, and vote for new features). Feel free to head to that request and add your comments or vote.

 

As a workaround, if you intend to only let the customer proceed with the transaction if they're using the billing address they already gave you, you could look into our Accept Customer forms instead and see if there's a workflow there that might work for you.

View solution in original post

Aaron
All Star

Hello @Kipa

 

The sandbox does not perform any address validation as it does not actually connect to the card networks.  If you wish to generate an error message, you will need to use our testing guide.

 

Richard

 

 

View solution in original post

10 REPLIES 10

Hi @kipa,

 

Unfortunately, with the current implementation of Accept Hosted, you only have a couple of options to do address verification through AVS.

 

You can show the address fields and optionally prepopulate them. Anything submitted in these fields will get validated through AVS. Unfortunately, those fields will always be editable.

 

Or...

 

You can not show those fields, in which case the transaction will be submitted without an address and no AVS check will take place.

 

We generally think you should show the fields, and having them editable is usually the preferred use case. If a customer's entering the card details themselves, there's a chance that they're entering a card that doesn't match the billing address already on file, so letting them specify or edit the address is a good thing. Even if you got an address specifically for that transaction right before you send them to the form, there's always the possibility that they get to the form and find out the card they want to use is expired (just one example). Having the ability to make a change to the card that they're going to use right there while they are in the form is valuable.

 

That said, the current options don't quite apply to everyone's ideal use case, so we've already got at least one request for this on our Ideas Forum (where others can take a look, contribute feedback, and vote for new features). Feel free to head to that request and add your comments or vote.

 

As a workaround, if you intend to only let the customer proceed with the transaction if they're using the billing address they already gave you, you could look into our Accept Customer forms instead and see if there's a workflow there that might work for you.

Aaron
All Star

Thank you very much. Will try to find a workaround.

One more question I didn't find answer in your note:

Why address validation doesn't work in hosted form? Is it cause of sandbox server, or any account settings?

Sorry, you'll have to explain what you mean by "doesn't work".

It saves transaction without any address validation.

Here is the XML of token request. As you can see, ZIP is invalid.

 

<getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
	<merchantAuthentication>
		<name>MY_NAME</name>
		<transactionKey>MY_TRANSACTION_KEY</transactionKey>
	</merchantAuthentication>
	<transactionRequest>
		<transactionType>authCaptureTransaction</transactionType>
		<amount>20.00</amount>
		<billTo>
			<firstName>Ellen</firstName>
			<lastName>Johnson</lastName>
			<address>14 Main Street</address>
			<city>Pecan Springs</city>
			<state>TX</state>
			<zip>7878</zip>
			<country>USA</country>
		</billTo>
	</transactionRequest>
	<hostedPaymentSettings>
		<setting>
			<settingName>hostedPaymentButtonOptions</settingName>
			<settingValue>{"text": "Pay"}</settingValue>
		</setting>
		<setting>
			<settingName>hostedPaymentBillingAddressOptions</settingName>
			<settingValue>{"show": true, "required": true}</settingValue>
		</setting>
		<setting>
			<settingName>hostedPaymentIFrameCommunicatorUrl</settingName>
			<settingValue>{"url":"MY_URL"}</settingValue>
		</setting>
		<setting>
			<settingName>hostedPaymentReturnOptions</settingName>
			<settingValue>{"showReceipt" : false, "cancelUrl": "MY_URL", "cancelUrlText": "Close"}</settingValue>
		</setting>
	</hostedPaymentSettings>
</getHostedPaymentPageRequest>

 

Here is the screen of filled form, I'm trying to submit.

 

And the JSON I got back:

{
	"accountType":"Visa",
	"accountNumber":"XXXX1111",
	"transId":"0",
	"responseCode":"1",
	"authorization":"000000",
	"billTo": {
		"firstName":"Ellen",
		"lastName":"Johnson",
		"address":"14 Main Street",
		"city":"Pecan Springs",
		"state":"TX",
		"zip":"7878",
		"country":"USA"
	},
	"shipTo":{},
	"totalAmount":"20.00"
}

Looks like correct transaction responce with incorrect address.

 

Hello @Kipa

 

The sandbox does not perform any address validation as it does not actually connect to the card networks.  If you wish to generate an error message, you will need to use our testing guide.

 

Richard

 

 

Okey, thank you very much for help :)

Hello, I wonder if can ask a followup question.

If we allow customer to change address info on Accept Hosted form and customer changes it to get the card to be accept, how does our program learn there was a change and what the change was?

Thank you, David

Hi @dbstamps20,

 

You'd pull the transaction details of the transaction after it was performed, and check to see if the address there matches what you already have.

 

But...

 

We've recently released some enhancements to the Accept Hosted form that allow address information submitted in the token request to persist even if it's not displayed on the form. This enables you to use AVS or do other things that might require the address to be stored on our system without risk that the customer will change the address on the hosted form. So, if you don't want the customer to be able to change the address, just choose the option to not show it on the form. It will still come through to the system.