pootis-network / basic-donation-system

A simple donation system that supports many payment methods and various games such as Garry's Mod, SourceMod-compatibles and Minecraft.
http://pootisnetwork.heliohost.org/donate
GNU General Public License v3.0
7 stars 1 forks source link

successPP.php fails to retrieve $_POST data but Paypal IPN returns HTTP code 200 #6

Open crizztoffer opened 2 years ago

crizztoffer commented 2 years ago

Line 11 in successPP.php always reports that there is no return post data from paypal after a transaction is processed, and thus throws a 405. This is in sandbox. The IPN tracker DOES report an HTTP code of 200. All the error files contain nothing, and they each have been written to during testing to confirm write access. Under current paypal methodology for IPN use, cURL was adjusted to:

`curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_CAINFO, DIR . "/cert/cacert.pem"); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_data); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $this->follow_location); curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, true);

    curl_setopt($ch, CURLOPT_SSLVERSION, 6);`

Current PHP version is 8. Haven't been able to find a work around for showing success. I should also mention that setting usecurl to false still reports a 200, but throws a 405.

thexkey commented 2 years ago

Sadly, I don't have a paypal to help with this issue, thought that the PayPal side would have worked.

thexkey commented 2 years ago

Also, I have noticed you were using Sandbox. Have you enabled Sandbox mode in config.php?

crizztoffer commented 2 years ago

It sends to paypal just fine, but I think that things are a little dated in the successPP.php for retrieving a response of "completed." Making a paypal account is free and sandbox is easy to setup. I haven't quite figured this one out yet, but when I do I will share it.

On Mon, Oct 25, 2021 at 5:11 AM thexkey @.***> wrote:

Also, I have noticed you were using Sandbox. Have you enabled Sandbox mode in config.php?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pootis-network/basic-donation-system/issues/6#issuecomment-950861232, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSK7UMB3HQYME3F775IMTLUIVCO5ANCNFSM5GUZV7IQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

crizztoffer commented 2 years ago

I have enabled sandbox in the config.php - I tend to read a lot before I implement ;) ha ha.

On Mon, Oct 25, 2021 at 2:43 PM Daryn Alsup @.***> wrote:

It sends to paypal just fine, but I think that things are a little dated in the successPP.php for retrieving a response of "completed." Making a paypal account is free and sandbox is easy to setup. I haven't quite figured this one out yet, but when I do I will share it.

On Mon, Oct 25, 2021 at 5:11 AM thexkey @.***> wrote:

Also, I have noticed you were using Sandbox. Have you enabled Sandbox mode in config.php?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pootis-network/basic-donation-system/issues/6#issuecomment-950861232, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSK7UMB3HQYME3F775IMTLUIVCO5ANCNFSM5GUZV7IQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

thexkey commented 2 years ago

I haven't quite figured this one out yet, but when I do I will share it.

Yeah, the paypal code is very old, it suprised me when it did sorta worked for you.

crizztoffer commented 2 years ago

Okay I figured it out. I haven't made a working successPP.php script mind you, but I've done a lot of reading over the last few days about this issue in particular.

When you call the new IpnListener in successPP.php, no post data has been processed by IpnPP.php into form data. When paypal returns info, it's returned directly to ipnPP.php, and must be passed as variables into successPP.php. You are currently calling a connection that has already been completed in successPP.php that has already been closed. It's like you're trying to create a new connection but without any information to return in post.

I'll create a post insert and see if I can get the successPP.php to work correctly. If I can, I will update the code so you can merge

On Mon, Oct 25, 2021 at 2:51 PM thexkey @.***> wrote:

I haven't quite figured this one out yet, but when I do I will share it.

Yeah, the paypal code is very old, it suprised me when it did sorta worked for you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pootis-network/basic-donation-system/issues/6#issuecomment-951359943, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSK7UNDPOFEMM4YDY3JARTUIXGPZANCNFSM5GUZV7IQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

thexkey commented 2 years ago

Just remembered something: successPP relies on phplistener.php aka https://github.com/Quixotix/PHP-PayPal-IPN and that is for PHP 5, however i do not know if this affects anything when using PHP 8.

thexkey commented 2 years ago

i created a branch called LibraryPatch, commit 79534ff should have a fixed version of phplistener.php, but i dont know if it really works.

thexkey commented 2 years ago

any progress on this issue?

thexkey commented 2 years ago

i am working on this issue again, currently re-writing most of the entire web code to fix most of this mess and allow plugins