When there are shippable (tangible) items, Paypal should not change the workflow to Completed after a successful payment, but it does. I looked at the code and apparently the function product_is_shippable is called with txn_id and not with nid that it is expecting.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | paypal_has_shippable_item.patch | 1.43 KB | mfb |
| #12 | shipping_check_paypal.module.patch.txt | 1.31 KB | ñull |
| #8 | 36083.patch | 762 bytes | neclimdul |
| #3 | paypal-module-localisation-country-shipping.patch | 3.14 KB | ñull |
| #1 | paypal-module-localisation-country-shippable.patch | 6.58 KB | ñull |
Comments
Comment #1
ñull commentedSomebody can correct me, but it seems that the code in Paypal that sets the workflow to completed when there are no shippable items, is obsolete. I just discovered that the store's cron function does the same job near line 59. Also I did not discover any similar code in the other payment processor modules. Consequently I removed the code that would do that in Paypal. Included a patch that fixes Paypal's country setting, a localization error and it removes the shippable code. Could somebody check this?
Comment #2
ñull commentedComment #3
ñull commentedSame patch applying to the new 4.6 backport from HEAD
Comment #4
matt westgate commentedI committed the string translation fix.
Can you check that the country codes address.module uses are compliant with the country codes PayPal expects?
Regarding paypal module setting the workflow: this is for file downloads. The idea is if someone purchases downloads they want to access their items right away so PP will set the workflow status to complete so they can be accessed.
I'm open to other solutions here...
Comment #5
jeff veit commentedMatt said: "Can you check that the country codes address.module uses are compliant with the country codes PayPal expects?"
They are not.
Paypal expects ISO 3166 country codes: these are always in uppercase for a start whereas the country codes we are using are in lower case.
There are differences in specific country codes too. For instance the United Kingdom has the county code GB. E-commerce uses UK. I haven't been through the full list to find other differences.
The ISO country codes can be found here: https://www.paypal.com/en_GB/pdf/PP_WebsitePaymentsStandard_IntegrationG...
Comment #6
ñull commentedWhen we consider a change in address.module to ISO 3166 country codes, then we need to consider:
Comment #7
thekenshow commentedI encountered this in 4.7 (shippable product workflow set to "complete" for paypal purchases). Digging in to paypal.module, I found the following problem on line 237:
Changing this line resolved the problem.
Comment #8
neclimdulOk, based on the previous comments I have attached a patch. The ISO issue should be taken up seperately in my opinion. I'm marking this cvs since its a problem present in the cvs HEAD and we can backport it.
Comment #9
neclimdulCommitted my patch as it is a needed fix. Going to mark this fixed.
Comment #10
(not verified) commentedComment #11
ñull commentedAfter my recent upgrade to 4.7, I am still seeing the same issue which brought great irritation to my client! Even though there are shippable items, still the workflow is changed to completed. The code that is supposed to check if there are shippable items is really faulty.
Then on second note I am wondering why the payment module should be responsible to change the workflow? A payment module should only change payment status and workflow issues should be left to other modules like store.module. If you compare with other payment modules you will see that not all implemented this check. For instance I don't see it in Worldpay and Authorize.net. Both only touch payment status.
My suggestion is like I originally proposed, to just take out the code that checks for shippable items and remove the code that changes the workflow. This function belongs to the store's cron job and in fact you can find it back there:
So please, could this be cleaned up somehow? Let this be a function of the store.module and delete it from all payment modules that mistakenly implemented it. Why do it in the different payment modules when it is already done "centrally" in the store module?
I noticed however that the store module only will do this if the admin activated the notification email. May be it would be good to make this check independent from the notification email.
Comment #12
ñull commentedAttached a patch for 4.7 that fixes the issue like described in the former comment
Comment #13
Christoph C. Cemper commentedhmmm.. pretty interesting
So If I want an order to be NOT set to completed because a service still has to be performed
(like a script installation) then I need to set the product "Install script" to "shippable" ?
Comment #14
neclimdulOk, I'm leaving this as needs work. If the shipping check is failing then my guess would be we're having other problems related to this code that need to be resolved and just removing the check doesn't seem like the end all solution without further review.
Just for the sake of clarity, you aren't actually using 4.7.x-1.x-dev as shown by the bug? Also, workflow is something that has been of interest to us but something that hasn't been able to be properly developed further. There are some other things that need to mature to support a better setup for this and isn't really something I want to deal with in this issue.
Comment #15
mfbproduct_is_shippable() was being called incorrectly.
This is the smallest possible patch to fix it.
Note, paypal module needs other cleanup, which I will leave to some other issue...
Comment #16
skwashd commentedI haven't tested the patch, but a visual review suggests that it is good to go. This problem is still present in 5.x-3-dev 10-May-2007 (and was in 4.7-2.0). Would be good to see this fixed in 5.x-3.1
Comment #17
mfbAny chance this could make it into e-commerce 3.2?
Comment #18
gordon commentedThanks this has been committed to v5.x-3.x-dev and v4.7.x-3.x-dev
Will be available as a part of v3.2
Comment #19
(not verified) commented