West Wind Web Store
Better way to handle empty HTTPResult in wwAuthorizeNet :: ValidateCard?
Gravatar is a globally recognized avatar based on your email address. Better way to handle empty HTTPResult in wwAuthorizeNet :: ValidateCard?
  Eddie Caldwell
  All
  Oct 29, 2021 @ 10:18am

When charging a credit card thru authorize.net it rarely returns an empty( this.cHttpResult ) and it is assumed to failed and the user retries and it goes thru. On very rare occasions the charge actually went thru the first time resulting in the customer being charged twice. Is there anything I can do to better handle this?

Thanks in advance

this.cHttpResult = loHTTP.HTTPGet(this.cHttpLink)
if loHttp.nError <> 0
   this.cValidatedResult = [FAILED]
   this.SetError(loHttp.cErrorMsg)
   retu .f.
   endif
if empty( this.cHttpResult )
   this.cValidatedResult = [FAILED]   
   this.SetError([Invalid Result returned])											   
   retu .f.
   endif
Gravatar is a globally recognized avatar based on your email address. re: Better way to handle empty HTTPResult in wwAuthorizeNet :: ValidateCard?
  Rick Strahl
  Eddie Caldwell
  Oct 29, 2021 @ 04:25pm

No there's nothing you can really do about this short of not immediately retrying and first validating the order (either manually or by using some of the newer Auth NET APIs that let you verify orders).

If the message is empty but there was no error, it means there's some problem with the AUth.NET end since they didn't return data. Any connection failures, or timeouts would result in an error code.

Personally the way I handle this, if a transaction fails it goes into manual review mode. It shows up but has to be reviewed and at that point I can verify whether it was already processed or not at the provider.

Also, if you're making these HTTP requests today, you're using really old APIs from Auth.NET. Their newer APIs all use SDKs that you call through their libraries that do a more complete job with error checking. I suspect these old HTTP APIs are neglected on the Auth.NET end which might account for the empty responses you might be seeing.

+++ Rick ---

© 1996-2024