cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Checkout Validation

I have integrated simple check out form with my website, but i need to validate the fields that in checkout form. I tried submitting the values empty and the form got submitted. How i can do validation on these fields?

haseebkhilji
Contributor
18 REPLIES 18

You mean the LinkId to blank, like this?

<form name="PrePage" method = "post" action = "https://scotest.authorize.net/payment/CatalogPayment.aspx"> <input type = "hidden" name= "LinkId" value ="" /> <input type = "image" src="//testcontent.authorize.net/images/buy-now-gray.gif" /> </form> 

 Or do you mean SIM? If SIM, which fields?

 

RaynorC1emen7
Expert

Thanks for the reply.

Actually i have created a simple checkout form, after transaction page go to provided relay url where i get all the values and do DB and Application logic. But at Checkout form if i click on submit, it goes to relay_url with empty values. I want to validate these fields. One more thing, if its not doing validation for me, i have to validate all the fields may be on relay_url page, in this case how i go back to the checkout form, if user done an invalid move, (put empty to required field). And then how can i validate creadit card?

Actually i have created a simple checkout form, after transaction page go to provided relay url where i get all the values and do DB and Application logic.

So you are using SIM with relay response?

 

But at Checkout form if i click on submit, it goes to relay_url with empty values.

So on your checkout form, you click submit and it go straight to the relay URL page and not the authorize.net CC info input page?

 

I want to validate these fields. One more thing, if its not doing validation for me, i have to validate all the fields may be on relay_url page, in this case how i go back to the checkout form, if user done an invalid move, (put empty to required field).

Again, can you tell us which fields???

 

And then how can i validate credit card?

What kind of validation do you want to do? authorize.net will return error if the credit card info is not valid.

So you are using SIM with relay response?

Yes.

So on your checkout form, you click submit and it go straight to the relay URL page and not the authorize.net CC info input page?

Yes it goes straight to the relay URL page. Even when the credit card, expire date, Address and all the required fields are empty.
 

Again, can you tell us which fields???

I want to validate, Credit Card - Expire Date - Address - City (these all are required fields)
 

What kind of validation do you want to do? authorize.net will return error if the credit card info is not valid.

yes if the card info is invalid, or one of the required field is empty. 

So on your checkout form, you click submit and it go straight to the relay URL page and not the authorize.net CC info input page?

Yes it goes straight to the relay URL page. Even when the credit card, expire date, Address and all the required fields are empty.

Are you sure You are not using DPM, can you tell me the URL where you put in the CC# and expire date. Did it said https://???.authorize.net/gateway/transact.dll? Because on SIM without the CC# and expire date it show

  • Credit card number is required.
  • Expiration date is required.

If you are doing DPM, you can test it with javascript before the submit to authorize.net transact.dll.

Or if are using asp.net without master page, use the <asp:???Validator />

And yes for DPM, it will go directly to the relay response. You will need to test the response to either go back to the checkout page or to the receipt page. Use this https://developer.authorize.net/tools/paramdump/index.php as the relay_response page to see the all the response values.


Updated:

Just run a DPM test without CC# and expiration date

The x_response_code is 3, x_response_reason_code is 33, the x_response_reason_text is "Credit card number is required."


You are right.


 [x_response_code] => 3 [x_response_reason_code] => 33 [x_response_reason_text] => Credit card number is required.

this is what i received. 


the url is https://secure.authorize.net/gateway/transact.dll 


 


 

Then you are using DPM. Validate the inputs with javascript before submitting.

stymiee have some nice javascript credit card info validation here.

How i can make this form validate card automatically without any external validation? 

URL not working!