Make paypal donations automatic

11/28/2013 18:55 .Light#1
Just like the title says, I was wondering how you would go at making the paypal donations automatic. Such as they donate for some cps, it automatically goes to the Prize NPC where they can claim it.

Any help would be appreciated.
11/28/2013 18:56 pro4never#2
this is all php related. Basically you pass data TO the paypal transaction and then process the confirmation FROM paypal using php to add the correct rewards to the correct account in the database.

The source simply loads these rewards during login.
11/28/2013 19:13 .Light#3
Yeah I understand that its PHP. When you set up a paypal donate button/shop sort of thing, you can set it to go to a certain page if its successful, and a certain page if it failed. I can figure out how to implement the npc and that whole part. The part I would have trouble with is how exactly does it know which option they chose. Say they choose 1kk cps instead of 10kk cps. I'm confused on how I would set that up.

Thanks for the quick reply by the way
11/28/2013 19:22 turk55#4
Instant Payment Notification. (IPN)
11/28/2013 19:43 .Light#5
Quote:
Originally Posted by turk55 View Post
Instant Payment Notification. (IPN)
Elaborate on that will ya? (:
11/28/2013 20:20 Super Aids#6
Quote:
Originally Posted by .Light View Post
Elaborate on that will ya? (:
I think google.com could do that.
11/28/2013 21:13 .Light#7
Quote:
Originally Posted by Super Aids View Post
I think google.com could do that.
>.< I googled. I was wanting the explanation in his words, never a bad idea to hear it in a different way. But thanks for the reply xD
11/28/2013 21:53 Smallxmac#8
You will not find better docs than from paypal themselves. What I did is that you bought donation points and with those points you bought items, it makes things a bit more simple for me. But all of that stuff is easy to do in php and easy to test within the paypal sandbox
11/28/2013 22:09 Otakanikaru#9
big tnx
11/28/2013 22:14 pro4never#10
As we've said. IPN notifies you with a structured response when a payment is made. Make sure that the transaction is linked to a specific account ID and it's VERY easy to add a new entry to db based on the payment information received.

EG:

Paypal sends IPN that uid 1000010 donated 10 usd. Your PHP script takes that data and adds say... 10 prize codes to the prizes table for that UID. The npc then reads from that table to control what options it displays and what prizes it gives out.


Again... it all boils down to the paypal API and has nothing really to do with programming (assuming you can write a basic php script and a basic npc script, you're fine)
11/28/2013 22:27 Super Aids#11
And on the other hand not related to Conquer at all, considering the process is the same for everything else. This should be in another section.
11/29/2013 01:44 .Light#12
Quote:
Originally Posted by pro4never View Post
As we've said. IPN notifies you with a structured response when a payment is made. Make sure that the transaction is linked to a specific account ID and it's VERY easy to add a new entry to db based on the payment information received.

EG:

Paypal sends IPN that uid 1000010 donated 10 usd. Your PHP script takes that data and adds say... 10 prize codes to the prizes table for that UID. The npc then reads from that table to control what options it displays and what prizes it gives out.


Again... it all boils down to the paypal API and has nothing really to do with programming (assuming you can write a basic php script and a basic npc script, you're fine)
Thank you xD believe it or not this did help a lot!
12/03/2013 05:28 MeGaMaX#13
this is not hard at all just use p a y m e n t w a l l . c o m like

[Only registered and activated users can see links. Click Here To Register...]

then do pingback script for the specify transaction id to allow the appliction you did in the pyw to add the w/e you want to the customer.

something like

Quote:
if($type == CREDIT_TYPE_CHARGEBACK)
{
include('../../...');
$query = $sql->Query("UPDATE UsersData SET VALUE = VALUE + $credits WHERE CustomerID = '$userId'");
$today = date("F j , Y , g:i a");
$username = $sql->fetcharray($sql->Query("SELECT email FROM Accounts WHERE CustomerID ='$userId'"));
$username = $username[0];
$query1 = $sql->Query("INSERT INTO _points_history VALUES('$username','$credits','$today')");
}
#Edit dont forget to do check if the transaction id is already received by the member or not or they will exploit it.