samerton / Nameless-Resources

Resources module for NamelessMC v2
MIT License
10 stars 13 forks source link

Payment status is not updated #43

Closed PikaMug closed 3 years ago

PikaMug commented 3 years ago

Having an issue where after completing checkout, users aren't able to download the resource (button still says "Payment Pending"). Log for a single user is as follows:

[26-06-2021 18:04:18] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/oauth2/token
[26-06-2021 18:04:18] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 200
[26-06-2021 18:04:18] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/payments/payment
[26-06-2021 18:04:18] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 201
[26-06-2021 18:05:10] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/oauth2/token
[26-06-2021 18:05:10] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 200
[26-06-2021 18:05:10] PayPal\Core\PayPalHttpConnection : INFO: GET https://api.paypal.com/v1/payments/payment/PAYID-REDACTED
[26-06-2021 18:05:10] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 200
[26-06-2021 18:05:10] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/payments/payment/PAYID-REDACTED/execute
[26-06-2021 18:05:11] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 200
[26-06-2021 18:05:11] PayPal\Core\PayPalHttpConnection : INFO: GET https://api.paypal.com/v1/payments/payment/PAYID-REDACTED
[26-06-2021 18:05:12] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 200

No issues with PayPal - verified accounts in good standing, balance received in full. Still, I'm having to go into the nl2_resources_payments table and set their status from '0' to '1' each time. Any ideas?

samerton commented 3 years ago

Those logs all look okay to me, when the PayPal status is updated, PayPal will send a notification to a listener within the Resources module that should update the status.

Can you check if the file cache/logs/other-log.log exists, and if so, open it up and search for [PayPal] to see if anything's been logged?

PikaMug commented 3 years ago

No specific mention of PayPal, the only content is this repeated several times:

{"error":"invalid_client","error_description":"Client Authentication failed"}

However, the file was last modified Jun 4, so it would seem to predate this issue.

PikaMug commented 3 years ago

Updated to Nameless pr-10, but still no luck. Continuing to investigate.

PikaMug commented 3 years ago

It seems the issue may have been a malformed live Webhook URL within the PayPal developer portal. Now that's sorted, it appears I shouldn't have updated to pr-10, as I'm now getting:

[2021-07-01, 09:11:23] /home/user/public_html/site/modules/Resources/pages/resources/listener.php(33): Call to undefined function getallheaders()
samerton commented 3 years ago

Glad you were able to solve the issue, and thanks for the PR for pre-10 compatibility

PikaMug commented 3 years ago

You're welcome. While fixing the URL was a step in the right direction, my choosing to upgrade seems to have further complicated the issue. I'll likely submit more PRs in my attempt to resolve this.