We're experiencing two issues which are likely related.
When a user checks out using a credit card through Paypal Website Payments Pro http://o7.no/uSZPA5 , if the payment triggers one of our fraud filters (which puts the payment into "pending" status) when the order is placed the status in ubercart is set to "payment received". In the order comments I see the IPN response from paypal, and it says something like:
Authorize and capture immediately
Success: 249.13 USD
Address: Postal code matched; address did not
CVV2: Match
So this is a clear indication (in our setup) that the payment is pending in PayPal. Updating the order status seems to be a logical step.
Another issue, likely related, is when a payment's status is changed (marked as denied/canceled etc) in PayPal, the order status is not updated in ubercart.
From what I've read, it seems like the ubercarts support for IPN is limited and needs to be re-written to allow more flexibility and functionality etc.
Is there an existing workaround or fix for this issue? I haven't been able to pinpoint anyone else having this exact problem.
I'm looking into creating a patch myself, but would like to make sure my work is warranted and that it hasn't already been addressed elsewhere.
Any thoughts or suggestions on this issue is greatly appreciated.
Thank you.
Comment | File | Size | Author |
---|---|---|---|
#21 | Payments for order #195.png | 39.31 KB | bisonbleu |
#10 | 1363158.patch | 3.7 KB | TR |
#7 | uc_paypal_change_order_status_on_ipn_updates-1363158.patch | 3.8 KB | tseven |
#6 | uc_paypal_change_order_status_paypal_fraud_warning-1363158.patch | 1.58 KB | tseven |
Comments
Comment #1
longwaveAny help with improving the PayPal module would be appreciated. There's a patch in the queue to improve IPN support so other modules can react, but nothing like you describe. There's also an open issue about the fraud filters but I don't think that's quite the same thing.
Comment #2
TR CreditAttribution: TR commentedI haven't tried it myself, but from what you're describing the problem seems to be that PayPal reports "Success" and Ubercart takes that to mean the payment is completed. Related issues are #657544: Paypal fraud filters incorrectly displayed in Ubercart, #781720: Refactor the Paypal WPS IPN code, and #1307954: Store more response data in uc_payment_paypal_ipn.
If you're able to supply a patch that would be greatly appreciated. We're willing to step you through creation of a patch if need be.
Comment #3
TR CreditAttribution: TR commentedCrosspost. Removing tags that were accidentally restored.
Comment #4
tseven CreditAttribution: tseven commentedGotcha.
"There's a patch in the queue to improve IPN support so other modules can react, but nothing like you describe" Are you referring to the patch in #781720: Refactor the Paypal WPS IPN code? If so, I could use that patch as a basis for the work I do, which would help maintain consistency etc.
Ok, so in order to properly contribute the code/patch would I need to create the patch against the dev release?
Ideally I'd like to patch 2.7 since we're using that on a live site and is known to work with all other module/features we have setup.
Thanks
Comment #5
longwaveYes I was referring to #781720. It would be good to get that in separately as it's quite a big patch, but I think it needs more testing and reviewing first - if you can help out on that it would also be appreciated.
You should be able to patch against 2.7 as it's not that different from 6.x-2.x-dev, although -dev is best and easiest for us to deal with as maintainers.
Comment #6
tseven CreditAttribution: tseven commentedThe attached patch simply adds the PayPal fraud message as an admin comment and updates the order statys to "PayPal pending".
This fixes the issue of the order being marked as "Payment received" when in fact the payment is pending due to the fraud filters setup on the PayPal account.
Comment #7
tseven CreditAttribution: tseven commentedI have also modified the uc_paypal.pages.inc file to updated the order status based on the incoming IPN requests sent from PayPal.
I realize that this functionality might be specific to our needs, and would be nice to allow the end user to choose the order status to paypal payment status mapping.
Also, there is an IPN transaction duplicate check being done before the main switch($paypment_status) statement which terminates the script.
I'm not quite sure why we don't want to process multiple IPN request from paypal. Each transaction has a unique id, and I can think of many scenarios where there may be several IPN requests on the same transaction.
Example:
User submits payment wich triggers a fraud filter, placing the order in "PayPal pending" status.
Store admin accepts the payment which triggers an IPN to Ubercart, setting the order status to "Payment received".
Store admin later issues a refund to the customer through PayPal, which sends another IPN to Ubercart marking the order as canceled and refunded.
With the dupe check running on the IPN transaction id, it blocks all future changes to the payment.
If duplicated IPN request are an issue, I'd suggest filtering by more criteria than just the transaction id.
Ultimately, the IPN requests handled by the module should allow conditional action hooks. I believe this is what the patch in #781720 is moving towards.
I've attached the patch we're using to allow the changing of the Ubercart order status to match the incoming IPN PayPal payment status changes.
Keep in mind this may not be exactly what your store needs. The modifications this patch provides are very simple and straightforward.
Comment #8
longwaveTestbot only works on -dev releases, let's see how this holds up.
Comment #10
TR CreditAttribution: TR commentedI re-rolled the patch from #7 and put it in the correct format. I don't use PayPal, so I didn't test it, but let's see what the testbot thinks.
Comment #11
bisonbleu CreditAttribution: bisonbleu commentedI'm testing WPP (Website Payment Pro) on a PayPal sandbox. I have applied/tested #10 patch to ubercart-6.x-2.9+12-dev. Order status is now being properly updated. But a gremlin has crept in.
@ admin/store/orders/[order number], Balance appears as -$[order amount], e.g. -$400 (should be zero I guess when paid in full). A fix for this would be great.
Other than that, it looks pretty good.
Comment #12
bisonbleu CreditAttribution: bisonbleu commentedUpdate & call for help.
The reason why the balance in #11 appears as the exact negative of the order amount is because Ubercart is recording 2 separate instances of the same payment. Here is an example of what the "Admin comments" pane looks like for a $400 order.
The first line records a $400 payment; the balance is now 0. On the 4th line, PayPal IPN records yet another $400 payment; the balance is now -$400.
I'm using Website Payment Pro.
*** On my PayPal account, IPN settings are set to: "Do not receive IPN messages (Disabled)".
Help would be greatly appreciated as the site is live and payments are coming in.
Thanks.
Comment #13
bisonbleu CreditAttribution: bisonbleu commentedI'm now running WPP on a live Ubercart store (6.x-2.9+12-dev). For every completed order in this store (75 in the last week), Ubercart is recording the customer's payment twice. Recent log entries show the same pair of messages for every order:
Because of this, all orders display a negative balance equal to the total amount of the order.
Again, on my PayPal account, IPN settings are set to: "Do not receive IPN messages (Disabled)".
PayPal WPP integration support confirms that my account is properly configured.
As this issue undermines store accounting (store balance is no longer meaningful) and, more importantly, leads users to believe that they've just received a credit equal to the total amount of their order, I'm setting this issue back to 'major' and 'active'.
Comment #14
deardagny CreditAttribution: deardagny commentedI'm seeing the same issue mentioned in #12 after applying the patch in #10 - same config.
Comment #15
longwaveSo with the patch in #10, the payment is recorded twice, but without the patch in #10, the order status does not update at all? In which case, "needs work" is the right status here.
Comment #16
deardagny CreditAttribution: deardagny commentedSorry - accidentally hijacked your status changes @bisonbleu
I should also mention that I have IPN's set to Enabled in my account. If I remember correctly it was the only way I could get anything sent to the site during testing.
Comment #17
longwaveUbercart should override the IPN setting in your PayPal account, as it needs to be enabled to ensure payments are processed correctly.
Can someone confirm whether my summary in #15 is correct?
Comment #18
deardagny CreditAttribution: deardagny commentedSorry longwave - our posts just crossed in the mail. I think your status makes sense considering there is a patch being worked on.
I also just realized that my other issues belong in the uc recurring queue. My mistake.
Comment #19
bisonbleu CreditAttribution: bisonbleu commented@ longwave: You are correct.
Comment #20
bisonbleu CreditAttribution: bisonbleu commentedUpdate.
I get the exact same behavior with my PayPal sandbox.
Admin comments (admin/store/orders/195):
Comment #21
bisonbleu CreditAttribution: bisonbleu commentedAlso, see attached screen capture of Payments for order #195.
Comment #22
bisonbleu CreditAttribution: bisonbleu commentedTake 2...
Also, see screen capture of Payments for order #195. This order went through the PayPal sandbox.
Comment #23
TR CreditAttribution: TR commented