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.
Comment | File | Size | Author |
---|---|---|---|
#29 | uc_ups-certification_mode-api-696488-29.patch | 14.11 KB | stewart.adam |
#24 | uc_ups-certification_mode-696488-24.patch | 15.35 KB | stewart.adam |
#19 | uc_ups.ship_.inc_.patch | 9.43 KB | pheinrich |
#18 | uc_ups.admin_.inc_.patch | 826 bytes | pheinrich |
#18 | uc_ups.module.patch | 3.65 KB | pheinrich |
Comments
Comment #1
JacobSteelsmith CreditAttribution: JacobSteelsmith commentedComment #2
RikiB CreditAttribution: RikiB commentedThanks 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?
Comment #3
TR CreditAttribution: TR commentedI 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?
Comment #4
RikiB CreditAttribution: RikiB commentedYou could just run the patch, and when your done copy the original files back, you only need it once.
Comment #5
JacobSteelsmith CreditAttribution: JacobSteelsmith commentedGood idea. I will make these changes. I will also work on the user name and password issue.
Comment #6
dzieyzone CreditAttribution: dzieyzone commentedHi 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
Comment #7
dzieyzone CreditAttribution: dzieyzone commentedRe uploading zip file.
http://drupal.org/files/uc_ups_1.zip
Comment #8
TR CreditAttribution: TR commentedPlease do NOT upload entire modules/files. It's very bad practice.
Comment #9
dzieyzone CreditAttribution: dzieyzone commentedI know.. I'm still trying to figure out how to create a patch under windows vista OS. :)
Comment #10
Reichert-1 CreditAttribution: Reichert-1 commentedThank you for putting this patch together. It turned a potentially painful task into a merely annoying one.
Comment #11
Danny EnglanderThanks 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. :)
Comment #12
lane.angelique CreditAttribution: lane.angelique commentedThanks 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.
Comment #13
TR CreditAttribution: TR commentedAs 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.
Comment #14
stuartschultz CreditAttribution: stuartschultz commentedAny shot anyone has updated this patch for 2.4? Thanks.
Comment #15
mcctnt2000 CreditAttribution: mcctnt2000 commentedbump for a drupal 7 fix
Comment #16
flexgrip CreditAttribution: flexgrip commentedHello,
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.
Comment #17
flexgrip CreditAttribution: flexgrip commentedTR,
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.
Comment #18
pheinrich CreditAttribution: pheinrich commentedThanks 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.
Comment #19
pheinrich CreditAttribution: pheinrich commentedCORRECTION:
Sent the wrong uc_ups.ship.inc.patch file... Corrected version below.
Comment #20
stomith CreditAttribution: stomith commentedYou'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.
Comment #21
jerry CreditAttribution: jerry commentedHas 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.
Comment #22
flexgrip CreditAttribution: flexgrip commentedYeah 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.
Comment #23
longwaveReopening 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.
Comment #24
stewart.adam CreditAttribution: stewart.adam commentedThis 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.
Comment #25
TR CreditAttribution: TR commented#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.
Comment #26
stewart.adam CreditAttribution: stewart.adam commentedI 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.
Comment #27
TR CreditAttribution: TR commentedRefactoring, 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.
Comment #28
stewart.adam CreditAttribution: stewart.adam commentedOkay, 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.
Comment #29
stewart.adam CreditAttribution: stewart.adam commentedUpdated patch attached. This patch introduces some more significant changes from pheinrich's:
Comment #30
samak CreditAttribution: samak commented#16: uc_ups_cert-mode_7.x-696488-#16.patch queued for re-testing.
Comment #31
TR CreditAttribution: TR commented