Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
143 stars 127 forks source link

Rewrite the paypal system #222

Open Znote opened 8 years ago

Znote commented 8 years ago

The current IPN script is bad, and probably not working. I want to rewrite the paypal script in favor of their API. Useful resource: https://github.com/paypal/PayPal-PHP-SDK

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27746779-rewrite-the-paypal-system?utm_campaign=plugin&utm_content=tracker%2F532683&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F532683&utm_medium=issues&utm_source=github).
totolol123 commented 8 years ago

Any news? what should be done to achieve it? If this is not so hard, i can try doing it but i'm not very good with PHP xD @Znote

Raggaer commented 8 years ago

We dont really need the PHP-SDK

Heres what I got so far (need some more time to finish it)

https://gist.github.com/Raggaer/4e30b481a481d11eff07

https://gist.github.com/Raggaer/560eae49787c22bf4dcf

You can get started there. Using cURL and looking to this should help you achieve it

https://developer.paypal.com/docs/api/

I may need some more hours to finish this but my time is limited these days. So if someone wants to finish it before I do here are the gists

e00dan commented 8 years ago

Hey, what exactly got out of sync and is not working?

peonso commented 8 years ago

It's working here. ;0

Raggaer commented 8 years ago

The IPN is working but paypal is moving to REST API so why not start using it?

Felipe1993 commented 7 years ago

im stuck here i have verified my paypal account have enable ipn system with the url on it in my account configured the config.php znote added the znoteshop.lua in talkactions

but when players buy points i get the money and he never recieve the points

Raggaer commented 7 years ago

You should open a new issue. This is not related to IPN not working.

However this opens the case again... IPN is very outdated. I have used REST API on several projects working fine. Far superior with better testing (sandbox) and 0 problems.

Maybe its time to move out of IPN

Znote commented 7 years ago

@Raggaer I'll have a look at your gist code, I think you may be on to something. (anyting to avoid big messy sdk libs). Cornex has sponsored me with a VPS, so I may actually be able to test it out during development the upcoming weekends.

Raggaer commented 7 years ago

I have been working with the REST API these days. There are many things we can do with it.

We can for example make a blacklist with paypal users payer ID to exclude scammers. Subscriptions and all that stuff.

I am not into the PHP world but I know the API very good. The gist code shows how to create a payment, let the user approve it and the second gist code shows how to execute that payment.

I would be good to not request the OAuth token on each request tho. Maybe store the token and refresh when needed.

Znote commented 7 years ago

Got a working prototype now: https://gist.github.com/Znote/515e96a0de55ba44998fe88053033964 Gotta do some more testing, add/update some of th admin pages, and create a payment history page for users, so they can view their transaction activity on the AAC, as well as re-process requests if they are not directly approved. Based on the sample gist from @Raggaer 👍

joseluis2g commented 7 years ago

@Znote If you want to test with player we would be glad to give the information to you.

Znote commented 7 years ago

Shop history for the logged in account:

image

I hope this will also help new owners discover issues and reduce amount of debugging.

Gist testing files updated: https://gist.github.com/Znote/515e96a0de55ba44998fe88053033964

Also want to create this in a similar fashion for when purchasing stuff from the store, with status on if it is retrieved in-game etc.

Cepeen commented 6 years ago

It seems to be working fine in sandbox but I receive an error using live credentials:

https://gist.githubusercontent.com/Cepeen/7e44c001a08dac994b270b1f7a3af78d/raw/7ae7283fa759ebce30ce8b0f107b9cbde7386291/gistfile1.txt

I'm just getting started with this topic. Could you help me please?