202ecommerce / paypal

This repository is for developpers only. To install and upgrade the module in a production shop please install the package via PrestaShop Marketplace by following this link:
https://addons.prestashop.com/fr/paiement-carte-wallet/1748-paypal-officiel.html
Academic Free License v3.0
20 stars 31 forks source link

Order is processed and status is "Awaiting for PayPal payment" #265

Closed cruftex closed 1 year ago

cruftex commented 1 year ago

Describe the bug and add screenshots

I created a fresh PayPal account and was setting up the module. When doing an order the order confirmation showed and the order confirmation mail was sent, however, the state is "Awaiting for PayPal payment".

Probable cause could be that PayPal is withholding the money, since this is a fresh account.

Expected behavior

Since the customer payment transaction is completed, the state is "Payment accepted".

Steps to reproduce

  1. created new PayPal account
  2. install Prestashop PayPal module
  3. connect
  4. do first test order

PrestaShop version(s) where the bug happened

8.0.4

PHP version(s) where the bug happened

No response

kgleizes commented 1 year ago

Hello @cruftex

This status should stay only the time the webhook confirm the payment is correctly achieved.

If you don't need them (e.g no PUI functionnality and not with Payment Action on "Authorize") you can disable webhooks.

The objective is to confirm payment, refund or allow changing the state of orders automatically by webhook calls on the shops.

So you can check if the call webhook are correctly done or disable them to avoid this issue. I Close this one because most of time it is linked to server side configuration not allowing some requests.

Feel free to open it again if you have something else to report.

Thank you for your feedback.

amarasenagcs commented 1 year ago

I'm experiencing the same issue. I have contacted the server technical support, and they have confirmed that there are no problems on the server side. how to solve this issue?

kgleizes commented 1 year ago

Hello @amarasenagcs

If you don't use the PUI method (Pay Upon Invoice) then you can try to disable the webhooks for the moment. The webhooks generate logs lines to understand what the shop and the server are doing.

If there is nothing in the logs then the webhook cannot contact the shop to terminate the payments and update the states of the order.

You have two solutions :

  1. Understand why the request do not correctly finish on the shop (what is blocking them)
  2. Disable the webhooks to not use this functionnality and the state of the order will be "Payment accepted" when the customer come back to the shop.
cruftex commented 1 year ago

@kgleizes

This status should stay only the time the webhook confirm the payment is correctly achieved.

The status stays the same after the webhook is received. At least that is what I can tell from the log entries.

For example today I got an order with this entries:

2023-09-25 09:45:31 Awaiting for PayPal payment
2023-09-25 09:45:56  Webhook event : {"event_type":"PAYMENT.CAPTURE.COMPLETED","webhook_id":"WH-xxx-xxx","data":{"id":"WH-xxx-xxx","create_time":"2023-09-25T07:45:34.940Z","resource_type":"capture","event_type":"PAYMENT.CAPTURE.COMPLETED","summary":"Payment completed for EUR 8.3 EUR","resource"

I replaced the ID with xxx.

Can you please reopen?