How to test webhook/notifications for "On Hold" transaction - paypal

I have application that have paypal payments in production. But one of the transaction currently in status "On Hold", our webhook history show that paypal send us "APPROVED" transaction but there's no incoming webhook that showing reasons it changed to "On Hold".
any help/guide on which specific webhook should I enable? Currently confirmed there's no disputes raised, so i'm stuck on how my end can know this "On Hold" status updates

Subscribe to all webhook event names (*) , and log all events received.

Related

Paypal Webhook is created sufficient to imply activated

Paypal with active webhooks. We use a subscription plan.
When a customer
subscribes to the subscription plan PayPal's webhook sends us a BILLING.SUBSCRIPTION.CREATED. 

We do not get a BILLING.SUBSCRIPTION.ACTIVATED. Can I expect it being activated when it is
created or do I need to double check that?
(Side note, when trying to send an api request to activate it, an error message informs me that the subscription plan is not “suspended”. So that looks like it is already activated. Logging into PayPal also confirms it is activated.)

The documentation on it is a little vague.
Created means the user clicked the button to subscribe. It does not mean they entered any payment details, or finished subscribing.
If you are not receiving a BILLING.SUBSCRIPTION.ACTIVATED event but the subscription is active, perhaps you did not subscribe to that event?
In any case, the most useful event to listen for is PAYMENT.SALE.COMPLETED. This will occur for the first payment as well as every future payment on the schedule. You can build all your business logic with only PAYMENT.SALE.COMPLETED , using every receipt of this event to mark how long the subscription is valid for in your system (e.g. 1 month from receipt)

Paypal Webhooks

I have setup webhook and IPNs (Instanst Payment Notifications) with in paypal. It is my understanding that if I select ' * All Events ' within the webhook setup, that I would receive a webhook for any transaction that occurred in paypal - including ebay sales that were paid through paypal.
Since setting up the webhook, I have had a few sales go through paypal, but 0 webhook notifications were receivied.
Am I missing something about paypal webhooks?
The most effective way before you start receiving payments is usually by testing your webhook events and if they're going through, follow the below step
Set up your development environment.
Configure a webhook listener.
Validate your listener configuration with mock webhook events.
Subscribe to events.
Verify event notifications.
Go to this link for step 3
https://developer.paypal.com/docs/api-basics/notifications/webhooks/rest/#validate-your-listener-configuration-with-mock-webhook-events

PayPal webhook events never being sent?

We have a production game that uses PayPal as one of the methods of payment. In some cases, we're never receiving webhook notifications.
Here's the sequence that's occurring. Sometimes we get the webhook from this sequence, and other times we don't. On the server, we're using the Java API. All of this is the behavior with the production (NOT SANDBOX) PayPal servers.
After the user selects a product, it calls our server, which creates the Payment object via Payment.create(). At that point the state is 'created' and we redirect the user to the approval_url returned in the links.
The user approves the payment and is sent back to our server. We fetch the payment via Payment.get(), which is successful and has a state of 'created'.
We execute the payment using a PaymentExecution. This returns the payment with an updated state of "approved".
We then wait for a WebHook to inform us that the payment was completed. On occasion, this webhook is never sent, leaving the purchase incomplete. Checking the PayPal console, no webhook event exists for the payment, even though the payment is showing up as completed.
The questions here are:
Is this the correct sequence? Or is something missing?
Shouldn't the payment be "approved" when the user is returned from PayPal rather than still "created"?
Shouldn't the payment be either "completed" or "in_progress" after a successful execute?
What is the correct way to handle the case where the webhook never arrives? Keep polling the payment until the state updates?
I do not see any problem with your sequence. You can also refer to the steps here as an example - https://developer.paypal.com/docs/integration/web/accept-paypal-payment/
Regarding Webhooks, you mentioned sometimes you get Webhooks and only some times you do not. Can you please provide a correlation or debug id for the calls where you don't see any Webhook? We will trouble shoot and get back?

PayPal transaction status change hook/notification

Is it possible to register some PayPal web hook that will get executed whenever some transaction with concrete seller changes it's status, becomes charged back etc.? I couldn't find anything about this in docs. It would be much efficient than periodically checking status of every transaction.
Thanks!
Check out Instant Payment Notification (IPN).
Instant Payment Notification (IPN) is a message service that notifies
you of events related to PayPal transactions. You can use this service
to automate back-office and administrative functions, including
fulfilling orders, tracking customers, and providing status and other
information related to transactions.
Note: you can register ONE place to be notified ... and it will need to parse out which notifications should be handled by what code.

Paypal transactions on fresh seller account, Completed and Pending transactions

I using sandbox in my application and made some tests transactions, after each transaction i made ipn sent to my ipn controller shows that transaction status was Pending, but i expecting Completed status instead.
Then i login to my seller account to see the transactions and i saw that all transactions status was Pending and Order status/Actions was contain buttons Accept/Reject. Then i decided to click Accept in the first transaction to see what would happend next so after i click to Accept the first one and all the rest transactions status became Completed, it is heppend automatically and also i get for each of them ipn sent to my controller again (i get ipn for these transactions before but with "Pending" status), but now all ipns was with status Completed. it all was a big surprise for me but i was happy that i find out that.
After that, i tried to create new transaction to see what would happend and after i did that ipn sent back to my ipn controller showed that transaction status was Completed, so it is what i was expecting initially.
So my question is, on live environment i want the first and all the next transactions to have Completed status, what should i do to make it hapend? Should i configure the account somehow for that? Or should i myself send the first transaction and than click Accept so all the next coming transactions will be accepted/completed by default (the same as i accidentally done in my sendbox environment)?
You probably have 'Payment review' switched on for the (first) sandbox seller account.
Go to https://developer.paypal.com/ > Test accounts and set 'Payment review' to 'Disabled'.