Zen Cart Logo
Forums / Addon Shipping Modules / Post Office CASS Address Verification module

Post Office CASS Address Verification module

Views: 14,983

Results 21 to 37 of 37
21 May 2011, 3:50 PM
#21
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

Post Office CASS Address Verification module

Hello Kevin,

This module has been working very well for me for the past 2 years.
Now that I've become more experienced with php, I'd like to refine the module a little bit for our specific web site.

I'll explain:
Specifically, I'd like to address the account creation and the timing of the address scrub.
On our site, when a customer creates an account, the next screen is the shipping method and shipping address confirmation.
At this point, the address has not yet been verified with USPS. But our website instructs the customer to inspect the address for accuracy for shipping purposes.
The next step in the order process takes the customer to the payment information screen. Now the address has been verified and scrubbed. But this is a little too late. Here it shows the billing address.

What I'd like to do is scrub the address immediately after the account creation. This way, when the customer comes to the shipping screen, it displays the properly verified and scrubbed address. And at that point the customer has a chance to change it.

I've looked through the code a little bit, and found this section:

class cassValidation extends base {

  /**
   * constructor method
   * 
   * Attaches our class to the $_SESSION['cart'] class and watches for 2 notifier events.
   */
  function cassValidation() {

	global $zco_notifier;
    $zco_notifier->attach($this, array('NOTIFY_HEADER_START_CHECKOUT_SHIPPING'));

It looks like different notify headers could be used without too much trouble. Perhaps, instead of

NOTIFY_HEADER_START_CHECKOUT_SHIPPING

I could use

NOTIFY_HEADER_END_CREATE_ACCOUNT_SUCCESS

What do you think?
I haven't tried any of this yet. I thought I'd ask you first.
I've become fairly comfortable making code changes, so please don't be shy about it.

Thanks so much for your help.
Cheers.
Jason

25 May 2011, 10:44 PM
#22
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

Re: Post Office CASS Address Verification module

Hi,

I tried that one. No luck.
I guess I'll need some help with this.

I don't really know where to go from here.
I've tried to examine the code, but I can't figure out what else determines the timing of the scrub.

Thanks.
Jason

14 Sep 2011, 4:40 PM
#24
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

Re: Post Office CASS Address Verification module

Hi,

Sorry for taking so long to reply.

Try this page to get started:
https://www.usps.com/business/webtools.htm

Scroll down a little to where it says:

Register now to use USPS Web Tools ›

Hope this helps.
Cheers.

18 Sep 2011, 4:03 PM
#25
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Re: Post Office CASS Address Verification module

Great, thanks! :smile:

What's the difference between the "Web Tools API" and the "Address Information API" ?

Address Information API mentions "Make sure mailing addresses are correct. With each tool, up to five lookups can be processed per request. Additional permission is required to use these Ecommerce APIs"

https://www.usps.com/business/webtools.htm
https://www.usps.com/business/webtools-address-information.htm

Thanks :smile:

18 Sep 2011, 6:03 PM
#26
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

Re: Post Office CASS Address Verification module

Hi,
It's been so long at this point that I really don't remember.
I think the web tools is an overall category of APIs and the address tools is a subcategory of the web tools.

Cheers.
Jason A.

18 Oct 2011, 2:53 PM
#27
mikestaps avatar

mikestaps

Zen Follower

Join Date:
Aug 2010
Location:
Grand Blanc, MI
Posts:
305
Plugin Contributions:
1

Re: Post Office CASS Address Verification module

patternman:

Hi,

I tried that one. No luck.
I guess I'll need some help with this.

I don't really know where to go from here.
I've tried to examine the code, but I can't figure out what else determines the timing of the scrub.

Thanks.
Jason

Jason- Any luck on moving the validation?
I was thinking that moving the address validation to the account creation may be a good option.
Validate it once and be done with it!

19 Oct 2011, 2:58 PM
#28
mikestaps avatar

mikestaps

Zen Follower

Join Date:
Aug 2010
Location:
Grand Blanc, MI
Posts:
305
Plugin Contributions:
1

Re: Post Office CASS Address Verification module

Well I tried a TON of ways to move this so it would occur at "NOTIFY_HEADER_START_CREATE_ACCOUNT_SUCCESS" with NO luck :frusty:
I went as far as trying to include it at the top of the tpl_create_account_success_default.php file, that didn't work either!

Ultimately what I would like to do is have this triggered by 'NOTIFY_HEADER_START_CREATE_ACCOUNT_SUCCESS' as well as by 'NOTIFY_HEADER_ADDRESS_BOOK_ENTRY_UPDATE_DONE' and 'NOTIFY_HEADER_ADDRESS_BOOK_ADD_ENTRY_DONE' so that any updated/added addresses would also be validated.

Anybody have any ideas on why these triggers won't work???
thx

28 Oct 2011, 2:29 AM
#29
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: Post Office CASS Address Verification module

I've registered and received username/password from USPS. However, this module asks me for user ID only, and I keep getting :

Authorization failure. You are not authorized to connect to this server.
I guess I need to find somewhere to fill in my password. Any help?

28 Oct 2011, 5:28 PM
#30
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

Re: Post Office CASS Address Verification module

mikestaps:

Well I tried a TON of ways to move this so it would occur at "NOTIFY_HEADER_START_CREATE_ACCOUNT_SUCCESS" with NO luck :frusty:
I went as far as trying to include it at the top of the tpl_create_account_success_default.php file, that didn't work either!

Ultimately what I would like to do is have this triggered by 'NOTIFY_HEADER_START_CREATE_ACCOUNT_SUCCESS' as well as by 'NOTIFY_HEADER_ADDRESS_BOOK_ENTRY_UPDATE_DONE' and 'NOTIFY_HEADER_ADDRESS_BOOK_ADD_ENTRY_DONE' so that any updated/added addresses would also be validated.

Anybody have any ideas on why these triggers won't work???
thx

Hi, Sorry for the delay. I was on holiday for a couple of weeks.
Unfortunately, I had no luck either.
I got tired of playing with it. I would have to really get into the small details of the code to get it done. And I'm not really a php expert, so it would take me much longer than I'm willing to put into it.

Best Regards,
Jason

28 Oct 2011, 8:21 PM
#31
mikestaps avatar

mikestaps

Zen Follower

Join Date:
Aug 2010
Location:
Grand Blanc, MI
Posts:
305
Plugin Contributions:
1

Re: Post Office CASS Address Verification module

siliconbug:

I've registered and received username/password from USPS. However, this module asks me for user ID only, and I keep getting :

I guess I need to find somewhere to fill in my password. Any help?

You should just need your id in the Configuration--> Shipping
settings if I remember.

patternman:

Hi, Sorry for the delay. I was on holiday for a couple of weeks.
Unfortunately, I had no luck either.
I got tired of playing with it. I would have to really get into the small details of the code to get it done. And I'm not really a php expert, so it would take me much longer than I'm willing to put into it.

Best Regards,
Jason

I think I figured how to do it, I just haven't had time to implement yet, I'll let you know how it works out...

29 Oct 2011, 1:57 AM
#32
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: Post Office CASS Address Verification module

mikestaps:

You should just need your id in the Configuration--> Shipping
settings if I remember.
Did you remember how long to get authorization for these APIs? I've mailed to USPS to see if something's wrong. Wish me luck.:no:

1 Nov 2011, 3:08 PM
#33
mikestaps avatar

mikestaps

Zen Follower

Join Date:
Aug 2010
Location:
Grand Blanc, MI
Posts:
305
Plugin Contributions:
1

Re: Post Office CASS Address Verification module

siliconbug:

Did you remember how long to get authorization for these APIs? I've mailed to USPS to see if something's wrong. Wish me luck.:no:

I think it was like 48hrs. make sure you followed this advice!

patternman:

Be sure to only check the top box. All of the rest are invalid uses of the API. I don't know why they feel like they need to quiz the customers. Anyhow, if you pick more than the top box, you'll have to beg and plead and explain yourself. Then maybe they'll let you in.
Also, do not expect quick service, friendly communication, or a helpful staff. So as long as you're prepared, no worries. Just be patient.
I didn't read this until after I submitted that page with the top two checked, they denied me access. I just resubmitted the request checking only the top option... Approved..

1 Nov 2011, 6:55 PM
#34
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: Post Office CASS Address Verification module

Patient...that's what I need now.:lamo:

Thank you all for the answers.

9 Jan 2012, 7:04 PM
#35
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Re: Post Office CASS Address Verification module

is this module available in the downloads section? which section? couldn't find it

is this compatible with zencart 1.5?

thanks

10 Jan 2012, 9:04 PM
#36
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

Re: Post Office CASS Address Verification module

DogTags:

is this module available in the downloads section? which section? couldn't find it

is this compatible with zencart 1.5?

thanks

The file is available for download from this thread on post number 7.
http://www.zen-cart.com/forum/showpost.php?p=688640&postcount=7

I don't know if the link is still working or not.
The last update was in Feb 2009.
I would be very surprised if it worked on the new version 1.5.
But I haven't tried it yet. Please post your results if you give it a try on the new version 1.5.

Indeed it would be nice to get an updated version.
I've been using it for a long time now and it has proven to be very useful.
Cheers.

1 Feb 2012, 2:21 PM
#37
dogtags avatar

dogtags

Totally Zenned

Join Date:
Nov 2003
Posts:
876
Plugin Contributions:
1

Re: Post Office CASS Address Verification module

Does this work well with APO/FPO and DPO addresses?

Thanks