M2P says "Pending" but PayPal reports "This invoice has already been paid"

We have a handful of subscribers who are trying to become paying members but, for one reason or another, can't complete payment.

Unfortunately, it's very difficult to be specific, because it's hard enough getting people to report problems in the first place, and harder still to get useful data to begin diagnostics.

However, this is what appears to be happening:
• User signs up
• User subscribes to a membership level (we have multiple memberships enabled)
• User is invited to pay
• User is redirected to PayPal, where something goes wrong
• User makes second attempt to pay, but PayPal now says the invoice has been paid, and can't be paid again
• Meanwhile, user reports that M2P says their subscription is pending payment
• User is now stuck in some state of limbo.

In wp-admin:
• I can't find any trace of that user under "All members" (unsurprising)
• By querying the SQL table wp_users directly for the likely email address (the search function in billing doesn't always work), I can find an invoice in Drafts.
• It happens that I pull and record all PayPal transaction data elsewhere and, where a paid invoice shows a transaction with invnum=whatever, this failure case example shows no trace of any PayPal transactions with that invoice number.
• This is unsurprising because the payment hasn't been made, and creation of payment profiles don't record invoice numbers, so I can't even tell whether the profile got created by the payment failed.
• Though M2P has changed the way it records IPN transactions (and my CLI tool needs updating to cope), I can't find any apparent attempt by PayPal to send an IPN for that invoice number or for that payment profile creation either. Again, probably not surprising, but unhelpful since nothing matches the user's email address (but that's also unsurprising, he's probably using a different email address for his PayPal account).

It does not help that the Billing view's search function does not always work (eg searching for a record I can see right in front of me has no effect), or that the Billing view shows at most 20 records without any paging controls.

Everything points to a problem at PayPal, but I don't know what to tell our users or PayPal, because I can't find out what's going on.

Does any of this ring a bell? Have you heard of anything similar? And can you recommend any further courses of action, either wrt the user, M2P or PayPal?

  • Sajid

    Hi @David King

    Hope you are doing good today :slight_smile:

    We have not heard anything like that before. The payment failed on PayPal at first attempt and at second attempt it says the payment has been made means PayPal missed some important information that is necessary for M2 to create invoice and subscription on your site. Does the member gets back to your site after payment ?

    If you have a staging/clone site where I can test the flow with PayPal sandbox using my own sandbox account to locate the problem. Or did you tried it with sandbox accounts ? Its not working with sandbox too or only with live transaction mode ?

    For single one time payments, IPN is not required to be configured on PayPal but for subscriptions you must have IPN setup on PayPal to make it work properly.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

    • David King

      Hi @Sajid,

      The payment failed on PayPal at first attempt

      It's a presumption that payment failed or something else went wrong, because the result is no payment. There is a chance that this may actually be a PayPal bug rather than anything to do with M2P.

      M2 to create invoice and subscription on your site.

      The invoice is created before the user is handed off to PayPal (or M2P couldn't provide the necessary metadata to PayPal so that PayPal can return payment result).

      I've found an invoice (for one case), but I can't think of any place where PayPal would record inbound (but incomplete) payment attempts. There is an IPN history view buried somewhere in our PayPal account, and there is the IPN history in our M2P instance, but absent a transaction ID, I can't locate the attempt because the only thing I know, invoice ID, doesn't get returned in an IPN message until after a successful payment.

      It is possible that a payment profile creation IPN message has been sent, but I can't identify it yet because I don't yet know the email address of the PayPal account in question.

      The lack of information is frustrating for all concerned. We're just going to have to wait for the person to get back to me with the information I requested.

      Does the member gets back to your site after payment ?

      I don't know, they didn't say.

      If you have a staging/clone site where I can test the flow with PayPal sandbox using my own sandbox account to locate the problem. Or did you tried it with sandbox accounts ? Its not working with sandbox too or only with live transaction mode ?

      Yes, we have a staging site, but it's probably not worth your time experimenting with sandbox accounts because our production site is working — most of the time — we've got a number of successful subscriptions, it's just on occasion that this problem shows up.

      The only two things I can say for sure are that it's mostly working and whatever this problem is, it isn't a one-off aberration, but it's not common.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.