As I explained it here https://www.drupal.org/node/2036149#comment-9876161

Problem is beacuse WPS demands that you also set Auto-Return option in PayPal config.
https://www.paypal.com/cgi-bin/webscr?cmd=p/mer/express_return_summary-o...
If you dont have this set, then some are probably not going to return to your page, they will just leave at PayPal and Checkout will not be completed.

If you don't set it, or even if you DO set it to auto return, this still doesn't ensure that user will go back to your site. Some users will just pay and close the auto redirect to your site. What will happen is.

1. Order stays in Checkout:Confirm order
2. All the rules trigers you have set are not triggered as Checkout complete never happens

So you get missing data and problematic orders. What I did is just made solution/hack on base of IPN from PP
https://www.drupal.org/node/2036149#comment-9887487
But this is a patch and changes the way module works a bit, also duplicate rules can/will be fired because of this as I triger them in code without checking for an event.

Further discussion is needed on this....

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

themic8’s picture

I am also having this issue.

The patch you mention or https://www.drupal.org/node/2036149#comment-9887487 works for me also.

I also have IPN and the Payment Data Transfer disabled in Paypal.

I did set up auto redirects to my domain in Paypal but that doesn't seem to work.

scotself’s picture

We are having this problem a LOT on a new Drupal Commerce site and the client is being very understanding. Luckily, you can click the "Simulate Checkout Completion" link on an order's edit page and fully trigger checkout_complete hooks, but this is not ideal for a site that has 100s of orders a day. We definitely DO have auto-return set up, it works and still about 1/4 to 1/3 of orders end up stuck in Checkout: Confirm Order anyway. Please advise. I have the exact same setup as @themic8 described above and did NOT try the patch/hack to the WPS module and would like to avoid it. Help us Ryan, you're our only hope ;)

rszrama’s picture

Category: Bug report » Support request
Priority: Minor » Normal
Status: Active » Closed (works as designed)

It sounds to me like you aren't getting your IPNs. Even if the customer doesn't redirect back to the merchant's site, the IPN should still come through. That's what the PayPal WPS module uses to create payment transactions and trigger checkout completion rules. Whether or not the customer returns doesn't matter.

Check the logs to see what's happening to IPNs - whether they're coming in at all. If not, that'll be the next step for you to research. : )

MrPeanut’s picture

If it helps at all, I just ran into this a week ago. The issue was that I had put myclientsbusiness@gmail.com as the PayPal recipient as that's what they use to log in to PayPal. However, the primary email address on the PayPal account was actually ownersname@gmail.com.

Because I had put in an email address that wasn't the primary email address, I was not getting the IPN. I did still get the payment, just not the IPN. Something to maybe check!

scotself’s picture

I am getting IPNs and they are still periodically getting stuck in Checkout: Confirm Order. Here is a recent one. Please look over it and advise if you see anything weird or if I can provide other info that may be helpful?!

IPN validated for Order 5557 with ID 07X5893375943413R.
Array
(
    [mc_gross] => 15.00
    [invoice] => 5557-1443548384
    [protection_eligibility] => Ineligible
    [item_number1] => 
    [tax] => 0.00
    [payer_id] => EJXZZS52VMURC
    [payment_date] => 10:42:03 Sep 29, 2015 PDT
    [option_selection1_1] => 1
    [payment_status] => Completed
    [charset] => windows-1252
    [mc_shipping] => 0.00
    [mc_handling] => 0.00
    [first_name] => Esther
    [mc_fee] => 0.56
    [notify_version] => 3.8
    [custom] => 
    [payer_status] => unverified
    [business] => ** our paypal email address **
    [num_cart_items] => 1
    [mc_handling1] => 0.00
    [verify_sign] => ANb.3EW39hORdYeMrbJnQxqGw.gZA1c-1Wl86CgwWlF9gZKVaBxyxYHW
    [payer_email] => ** customer's email here **
    [mc_shipping1] => 0.00
    [tax1] => 0.00
    [option_name1_1] => Product count
    [txn_id] => 07X5893375943413R
    [payment_type] => instant
    [last_name] => Gillham
    [item_name1] => Order 5557 at Local Tennis Leagues
    [receiver_email] => ** same email as above for our paypal acct **
    [payment_fee] => 
    [quantity1] => 1
    [receiver_id] => E9Z4RT2UCR9LL
    [txn_type] => cart
    [mc_gross_1] => 15.00
    [mc_currency] => GBP
    [residence_country] => GB
    [receipt_id] => 3281-9956-0394-8717
    [transaction_subject] => 
    [payment_gross] => 
    [ipn_track_id] => 281d798cb075b
    [order_id] => 5557
)
scotself’s picture

Status: Closed (works as designed) » Active
rszrama’s picture

Status: Active » Closed (works as designed)

Looks like a different issue than the OP to me. You have any rules changing the order status when an IPN is received?

scotself’s picture

Although the default rule for Commerce sets an order to Pending on Checkout Complete, we have modified that rule to move it all the way to Complete as we have no other processing needed. This works on 9 out of 10 orders just fine and all we're using is WPS. The one above was stuck in Checkout: Confirm Order, which to me means Checkout Complete was never triggered. I can open a separate issue if needed, but as you can see we are definitely getting the IPNs.

rszrama’s picture

Wait, Chekcout: Confirm Order? That's a status related to a PayPal Express Checkout checkout page we define in Drupal Commerce. If you aren't using EC, consider disabling that submodule.

scotself’s picture

Yep. Disabled EC and will keep an eye on it from here. Is there a good reason that a module that's simply enabled but the payment method is not should interfere with one that is actually in use? I can't imagine that this should be the case...

rszrama’s picture

Nope, no clue why it would've ended up stuck on that checkout page. It should've been passed over, but maybe something interrupted the 301 redirect that would've moved it on to complete.

Carlitus’s picture

I have a very similar issue but i haven't active the PayPal Express Checkout module.

Sometimes orders with paypal payment stucks in pending state. When i look in watchdog i can see the IPN messages (processed and validated) of the all orders (pending and completed)

In my PayPal payment settings page i have disabled everything.

I've tested and the customer doesn't need to return to my page to complete the orders.

But sometimes, maybe 1 of 10 stucks in pending.

¿Any clue?

themic8’s picture

Depends on the action taken by the user. "if user anyway closes page and doesn't go back to your site with redirect, rules to change status of order and create users if you have it etc wont fire." Marko B

Marko B made a post on: https://www.drupal.org/node/2036149#comment-9887487

I have also made an adjustment according to his "hack" and made a patch that has been attached.

The patch updates the order status, invokes a rule for commerce_checkout_complete. I have also pulled over the "pending reason" form IPN if there is an issue into the transaction messages.

Agiss’s picture

In my case I am using Commerce Node Checkout to Allows users to pay to publish nodes. The nodes should be published when the website receives payment confirmation however, despite that the website receives and validates the IPNs as well as the the order status is updated to completed, the nodes are published only when users are directed back to website.

I have applied the patch on #13 but didn't work for me.

To Recap:

Case one (users pay and come back to website)
1. User creates a pay to publish node
2. Node added to shopping cart
3. User goes to Paypal and makes payment
4. User redicted back to website
5. Website receives IPN notice, updates order status to completed
6. Node is published

Case two (users pay and do not come back to website)
1. User creates a pay to publish node
2. Node added to shopping cart
3. User goes to Paypal and makes payment
4. User closes browser or leaves paypal and doesn't come back to website
5. Website receives IPN notice, updates order status to completed
6. Node is not published

log screenshot

themic8’s picture

@agiss,

This sounds like it is a rule related to the node publishing not for the IPN update from Paypal. IPN update looks like it is working on your site.

What triggers the node to be published?

Agiss’s picture

Hi Themic8,

Thanks for you reply. This is the rule

{ "commerce_node_checkout_publish_node" : {
"LABEL" : "Publish the nodes that were purchased",
"PLUGIN" : "reaction rule",
"WEIGHT" : "10",
"OWNER" : "rules",
"TAGS" : [ "Commerce Node Checkout" ],
"REQUIRES" : [ "commerce_node_checkout", "rules", "commerce_checkout" ],
"ON" : { "commerce_checkout_complete" : [] },
"DO" : [
{ "commerce_node_checkout_rules_nodes_from_order" : {
"USING" : { "order" : [ "commerce-order" ] },
"PROVIDE" : {
"line_items" : { "line_items" : "Associated Line items" },
"nodes" : { "nodes" : "Associated Nodes" }
}
}
},
{ "LOOP" : {
"USING" : { "list" : [ "nodes" ] },
"ITEM" : { "node" : "Nodes" },
"DO" : [
{ "data_set" : { "data" : [ "node:author" ], "value" : [ "commerce-order:owner" ] } },
{ "node_publish" : { "node" : [ "node" ] } }
]
}
}
]
}
}