UPS now requires certification to use their API in production. The certification process includes the submission of the request and response XML documents for 5 shipments, the request and response documents for 5 test cases using specific tracking numbers provided by their documentation, the gif images representing the labels, the html scaling information, which are the html pages I assume, and one high value report for a shipment over $1,000.00.

I have included patches that provide a certification mode for the uc_ups module. This will write the files mentioned above to files/ups_certification/oid-[order_id]/ and files/ups_certification/void-sid-[shipment_id] where shipment_id is really the tracking number. This mode can be turned on and off from admin/store/settings/quotes/methods/ups . It will only work for those who have configuration access for the UPS module. The patches have no affect when off.

The user name and password are not stored in the XML files, however, I am less than pleased with the method by which they are stripped out. If the xml header changes for the requests, this will probably break these patches.

To produce the void information with UPS's test tracking numbers, an existing shipment must be edited and the tracking numbers replaced with the test numbers from the UPS documentation. The shipment must then be deleted.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JacobSteelsmith’s picture

RikiB’s picture

Thanks for your work on this. When I change the tracking number to void, it overrides the same Void folder and XML files. When I turned the files over to UPS they said each order needs its own Void XML files. How can I get unique void information per order?

TR’s picture

Status: Active » Needs work

I like the idea of having a "certification mode", but I don't like the way these patches implement it. My main concern is that these patches add code to the module, code which get loaded into memory and parsed on every single page where the UPS module is used. However, this code is only ever used once for each site - the rest of the time it's just taking up space. I would like to see this separated out into an include file that's only loaded when certification is run.

Could you also write up documentation for how to use this feature?

RikiB’s picture

You could just run the patch, and when your done copy the original files back, you only need it once.

JacobSteelsmith’s picture

Good idea. I will make these changes. I will also work on the user name and password issue.

dzieyzone’s picture

Version: 6.x-2.x-dev » 6.x-2.2
Assigned: Unassigned » dzieyzone

Hi Guys,

I manually patch 6.x-2.2 version of the uc_ups and it did work on my dev site. I attach zip file including only uc_ups.module and uc_ups.admin.inc because I can't make a patch using my winmerge.

Hope you guys like this.

Jay

dzieyzone’s picture

Assigned: dzieyzone » Unassigned
Status: Needs work » Needs review
FileSize
15.97 KB
TR’s picture

Status: Needs review » Needs work

Please do NOT upload entire modules/files. It's very bad practice.

dzieyzone’s picture

I know.. I'm still trying to figure out how to create a patch under windows vista OS. :)

Reichert-1’s picture

Thank you for putting this patch together. It turned a potentially painful task into a merely annoying one.

Danny Englander’s picture

Thanks for this patch, I have been racking my brain on how to go about getting certified by UPS until I stumbled across this post. At least now, I feel like I have a chance. :)

lane.angelique’s picture

Thanks for the patch! I am quite sure we would have never gotten this working otherwise. One other item to note: UPS's API does NOT accept any special characters. Make sure that your shipping name and store name do not contain any special characters or it will result in an error.

TR’s picture

Status: Needs work » Closed (won't fix)

As I said in #3, I find this a useful feature but it needs to be re-done and documented if you want it to be put into Ubercart. It's been more than a year and no-one has done this, so I think it's safe to say that there's little community interest in getting this finished off. I'm marking this as "closed/won't fix" as a practical statement about the status of this issue, but if someone would like to do the needed work to get this into Ubercart please feel free to re-open this issue and attach a new patch.

stuartschultz’s picture

Any shot anyone has updated this patch for 2.4? Thanks.

mcctnt2000’s picture

bump for a drupal 7 fix

flexgrip’s picture

Hello,

I think I've created a working patch against drupal 7.x with ubercart 7.x-3.0-beta4. Can anyone help me test it? Keeping in mind it may not be built properly? This seemed too easy so I could be missing something. I got it to create files yet there were times I would get some 500 errors while communicating with the ups servers. So I am unsure if it is something I have done, or something with the UPS servers. Hopefully this will get us started though.

The inclusion of the uc_ups.ship.inc file split the patch across 3 files. Certification mode in admin is definitely working, the other module files can read from it, and I had to modify a few variables to get it to adhere to some of the newly named arrays. I'm just not sure how much more detail needs to be put into this. This also leads me to believe that the shipping modules should be contributed and allow more hooks so that certification mode can be its own module all together. Maybe I'm wrong.

Finally, this UPS certification mode is stupid. All the hoops you have to jump through are just incredibly dumb considering you did not have to do this a few years ago. It's not about certifying your shipping style, its about certifying your application. In our case, its ubercart. You would think UPS could just check out ONE ubercart method of packaging and certify it or not. For instance, you don't have to do this crap with worldship or some of the other paid versions of shopping carts. Sorry, enough rambling. Let me know if I can help or change anything to make this conform better to these VC standards. I will try to help out where I can. And please let me know if this works for you. I believe I am nearly done with this certification mode crap, and have several different versions of this patch. This just seems to be the best one.

flexgrip’s picture

TR,

I may not be up to speed with the ubercart development cycle, but I think I will try to build this into a module against d7x and ubercart 3.0. Can you give me any tips or point me into the correct direction that will make this compliant with your dev techniques and get this built into ubercart? For instance, should this be a separate module built against my own branch so it can be reviewed and later merged into the master branch? Is it best to build stuff like this agaist 7.x-3.x-dev or the latest stable? I'm fairly lost on the whole "best practices" part. I just know git/github well enough to keep track of my own smaller projects.

Until then, I will start reading through all the wikis.

pheinrich’s picture

Thanks to Jacob for the original patches. They made the whole process practically painless. Here are the versions I updated for use with Ubercart 6.x-2.6.

pheinrich’s picture

FileSize
9.43 KB

CORRECTION:
Sent the wrong uc_ups.ship.inc.patch file... Corrected version below.

stomith’s picture

Version: 6.x-2.2 » 6.x-2.6

You'd think this would make it into baseline. Anyone who needs to ship UPS with Ubercart will need certification.

Anyway, I patched pheinrich's patches with 6.x 2.6 files. Now I cannot retrieve a shipping quote at all with certification mode on OR off. Good thing I have backups.

jerry’s picture

Has anyone produced a version of the certification patches that's compatible with UC3/D7?

UPDATE: I scanned the issue too quickly, and missed flexgrip's contribution above. I'll have a look at that.

SECOND UPDATE: Or not, as the link to flexgrip's patch returns a 404.

flexgrip’s picture

Yeah that's really weird. I will find the patch when I get home.

How is this not in the core? It's not even in core for the commerce modules.

longwave’s picture

Version: 6.x-2.6 » 6.x-2.x-dev
Component: Code » Shipping
Status: Closed (won't fix) » Active

Reopening this as there seems to be enough demand for it now.

Patches against 6.x-2.x-dev or 7.x-3.x-dev are welcome. Please set the version number and the status to "needs review" if you upload a patch.

stewart.adam’s picture

Status: Active » Needs review
FileSize
15.35 KB

This patch is against 6.x-2.x-dev and incorporates the changes by pheinrich (thanks!) as well as a few others that were required in order to pass certification, as per UPS's recent changes to the developer XML integration document.

Note for others going through the UPS certification process: I found UPS' instructions for voiding shipments particularly confusing... csdesignco uploaded a great hint at the Ubercart forums about this. Using those tracking numbers will create the necessary XML files required for 'void shipment' component of certification. For those curious, the expected result of using each of those tracking numbers to void a shipment during testing is also available in the developer XML integration document.

TR’s picture

Status: Needs review » Needs work

#3 has not been addressed.

There have been a lot of changes in Drupal since this issue was first opened, notably SimpleTest is now in core for D7 and we have a testbot on drupal.org. My thinking on the proper way to do "certification mode" has evolved with these changes. Rather than make this a part of the module, I am currently of the opinion that the best way to implement this is as a unit test - that way the code will never be loaded under normal running conditions, certification can easily be run as a one-off process, and the certification tests can serve as a continuing check of the code functionality.

stewart.adam’s picture

I can refactor the patch to call require_once() on a separate certification include if that will be accepted, but I won't have time to look into simpletest today (and besides I'd like to bring this in for 6.x as well). If using simpletest is a required to get this commited to core then I'll leave this as-is for now and I'll have to come back to it later.

TR’s picture

Refactoring, with documentation in hook_help() and/or as a text file, is the minimum needed. Simpletests are preferred - core Drupal for D6 doesn't have tests, but Ubercart for D6 has a full set, so any tests made for D6 will work with only minimal changes needed for D7. I have already written extensive tests to go along with my (as yet unreleased) re-write of all the shipping modules, and have written label certification tests for my FedEx module. UPS certification should really be done the same way. But a refactoring will do if that's all you can manage right now.

stewart.adam’s picture

Okay, thanks. I'll take a look at the FedEx module to see how much work it will be to implement this as a unit test, but in the mean time I'll post the refactored code soon.

BTW, I have split off the changes to meet the new XML specification in a separate issue: #1548200: Support UPS label printing for international shipments.

stewart.adam’s picture

Status: Needs work » Needs review
FileSize
14.11 KB

Updated patch attached. This patch introduces some more significant changes from pheinrich's:

  • Refectories code into a separate file and wrote some function calls to avoid code duplication
  • Status messages no longer include PHP variables in t() and have been standardized to follow the same format as the Drupal system once (file names italicized.
  • Added a new README.certification.txt with user instructions
samak’s picture

TR’s picture

Version: 6.x-2.x-dev » 8.x-4.x-dev
Issue summary: View changes