-
[PayPal] PayPal IPN - Automatic VIP [TESTED]
WOWW! I can't tell you how long I've waited for a working and tested IPN! So I thought, hell, I'm going to release one. Instructions are in Readme.txt
There are 2 parts to this release.
Standard Edition
Description: Works with UberCMS and RevCMS, but for rev you need to change wherever %habboname% is to {username}. You MUST read over Readme.txt for this to work. This is for one-time only payments for VIP. You pay, you get it for life.
Download: ipn.zip
Subscriptions Edition
Description: Now, this is for people who want to charge monthly. It inserts a row with the username and the expiration date.
Woops! I just realized I don't have the subscription code in my copy of the Hotel's CMS, and the server is offline. I will update it with the proper code, though!
CREDITS:
Otaku User - My Account is Safety-Banned after a joke I made. Account: Offline - If Sojobo could un-safety-ban me and the account 'Fatrix', then I can update proper credits. I logged onto multiple accounts because we have 2 servers, so we need 2 licenses.
Like, a hundredth to me for writing Readme.txt up and fixing it properly. But, that's not in comparison to the work the Otaku member did!
PM me if you want to purchase or need help with a Shoutcast Server or you just need help setting up any of my releases! :) My services are ALWAYS free, with the exception of VIP+ and Shoutcast servers!
// Script is working as of 12/17/2012 3:32PM (CST)
-
[PayPal] PayPal IPN - Automatic VIP [TESTED]
Nice scripts but why are we charging people to play on a retro? I thought we were over that already....
Sent from some remote location using Tapatalk...
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
FullmetalPride
OP
Thanks, I guess - but weren't you on that "WHY DO PEOPLE CHARGE FOR VIP?!?!?!" bandwagon?!
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
n0minal
Thanks, I guess - but weren't you on that "WHY DO PEOPLE CHARGE FOR VIP?!?!?!" bandwagon?!
Sorta. My main point is paying for multiple levels of VIP. VIP GOLD, VIP+ (I use VIP+ but only because I give free VIP commands.), etc., etc..but even if I was, it's still a very, VERY helpful script!
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
leenster
Nice scripts but why are we charging people to play on a retro? I thought we were over that already....
Sent from some remote location using Tapatalk...
Because private servers pay for them selves, right ?
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
Matthew
Because private servers pay for them selves, right ?
Exactly.
UPDATE: Almost got the code for the subscriptions! :) Just have to wait for my host to respond to why my server won't turn on.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
leenster
Nice scripts but why are we charging people to play on a retro? I thought we were over that already....
Sent from some remote location using Tapatalk...
Hello, owner of Faze hotel here. Just to confirm we do not charge people to play Faze infact users are given VIP free of charge and offered the chance to upgrade to a more feature rich 'VIP+' package. VIP+ funds pay for the servers we use to run.
Thanks.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
MatthewTS
Hello, owner of Faze hotel here. Just to confirm we do not charge people to play Faze infact users are given VIP free of charge and offered the chance to upgrade to a more feature rich 'VIP+' package. VIP+ funds pay for the servers we use to run.
Thanks.
YOU SNEAK YOU! At least tell me before you add me x)
Server's almost started up. :P
Until then, please enjoy this classy 80s song. A-Ha - Take On Me
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Where do i put my paypal email?
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
Bradshly
Where do i put my paypal email?
Read Readme.txt ;P
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
Matthew
Because private servers pay for them selves, right ?
Maybe if people more inclined to pull together again instead of complaining about fees/ donations/ etc. then we could have one big FREE hotel where those who run chipped in a little and maybe a worthy development would come out of it.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
n0minal
Maybe if people more inclined to pull together again instead of complaining about fees/ donations/ etc. then we could have one big FREE hotel where those who run chipped in a little and maybe a worthy development would come out of it.
LOL
While that's a good idea, it would NEVER work. If everyone is so inclined to keep their coded features to themselves, what makes you think they would want to band together and own a hotel? :/ Not to mention the fact EVERYONE wants to be staff. Although, more people = more mods needed. Habbo has like 12 a country, we could do like 50 for the whole hotel. Idk a thought.
Tl;dr no work now stfu hippie
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
FullmetalPride
LOL
While that's a good idea, it would NEVER work. If everyone is so inclined to keep their coded features to themselves, what makes you think they would want to band together and own a hotel? :/ Not to mention the fact EVERYONE wants to be staff. Although, more people = more mods needed. Habbo has like 12 a country, we could do like 50 for the whole hotel. Idk a thought.
Tl;dr no work now stfu hippie
There are some credible members of the community - only they're clouded by users who can't, for example, differentiate between a CMS and an emulator.
I'm just stating that the whole 'true retro bandwagon' is long gone - because the community has divided drastically.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
This is always helpful when you can't be fucked touching PHP. I remember back when nobody had these sort of systems in place.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
Moogly
This is always helpful when you can't be fucked touching PHP. I remember back when nobody had these sort of systems in place.
Mhmm. I released it only because I spent so long working on finding/building one, and I didn't want people to have to keep having these problemas.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
To change the currency, in paypal.php under
PHP Code:
$p->add_field('amount', $cost);
add
PHP Code:
$p->add_field('currency_code', 'GBP');
there you go it works.
change GBP to the currency code you wish to use
Lists of codes:
Quote:
AUD Australian Dollars
CAD Canadian Dollars
CHF Swiss Franc
CZK Czech Koruna
DKK Danish Krone
EUR Euros
GBP Pounds Sterling
HKD Hong Kong Dollar
HUF Hungarian Forint
ILS Israeli Shekel
JPY Japanese Yen
MXN Mexican Peso
NOK Norwegian Krone
NZD New Zealand Dollar
PLN Polish Zloty
SEK Swedish Krona
SGD Singapore Dollar
USD United States Dollars
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
Fundoctor
To change the currency, in paypal.php under
PHP Code:
$p->add_field('amount', $cost);
add
PHP Code:
$p->add_field('currency_code', 'GBP');
there you go it works.
change GBP to the currency code you wish to use
Lists of codes:
Like + Rep.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
I like it, few exploits found.. But they can easily be changed.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Thanks, but why add so much useless codes? Theres no need for a own class.
This is the one I use:
Code:
<?php
ini_set('display_errors', 1);
$contents = '';
// STEP 1: Read POST data
// reading posted data from directly from $_POST causes serialization
// issues with array data in POST
// reading raw POST data from input stream instead.
$raw_post_data = file_get_contents('php://input');
$raw_post_array = explode('&', $raw_post_data);
$myPost = array();
foreach ($raw_post_array as $keyval) {
$keyval = explode ('=', $keyval);
if (count($keyval) == 2)
$myPost[$keyval[0]] = urldecode($keyval[1]);
}
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
if(function_exists('get_magic_quotes_gpc')) {
$get_magic_quotes_exists = true;
}
foreach ($myPost as $key => $value) {
if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {
$value = urlencode(stripslashes($value));
} else {
$value = urlencode($value);
}
$req .= "&$key=$value";
}
// STEP 2: Post IPN data back to paypal to validate
$ch = curl_init('https://www.paypal.com/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
// In wamp like environments that do not come bundled with root authority certificates,
// please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set the directory path
// of the certificate as shown below.
// curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
if( !($res = curl_exec($ch)) ) {
// error_log("Got " . curl_error($ch) . " when processing IPN data");
curl_close($ch);
exit;
}
curl_close($ch);
// STEP 3: Inspect IPN validation result and act accordingly
if (strcmp ($res, "VERIFIED") == 0) {
// check whether the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment
// assign posted variables to local variables
$username = c_filter($_POST['custom']);
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'] + $_POST['mc_fee'];
$rounded = explode('.', $payment_amount);
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$type = $_POST['payment_type'];
ob_start();
var_dump($_POST);
$debug = ob_get_contents();
ob_end_clean();
$allowed = array('12' => 25, '13' => 25, '14' => 25, '20' => 50, '21' => 50, '22' => 50, '49' => 150, '50' => 150, '51' => 150, '89' => 300, '90' => 300, '91' => 300);
if($users->name_taken($username)) {
if (strtolower($payment_status) == 'completed' && strtolower($type) == 'instant') {
if (strtolower($payment_currency) == 'usd' && in_array($rounded[0], array_keys($allowed))) {
$diamonds = $allowed[$rounded[0]];
$newpoints = result("SELECT activity_points FROM users WHERE username = '" . $username . "' LIMIT 1") + $diamonds;
$update = query("UPDATE users SET activity_points = '" . $newpoints . "' WHERE username = '" . $username . "'");
$core->mus('updatepixels', $users->get_info('id', $username));
if ($update) {
$contents .= '
Username: ' . $username . '
Diamonds: ' . $diamonds . '
Currency: ' . $payment_currency . '
Paid: ' . $rounded[0] . ' (' . $payment_amount . ')
Debug: ' . $debug . '
';
} else {
$contents .= '
Unknown error.
Debug: ' . $debug . '
';
}
} else {
//currency or amout did not match. report that.
$contents .= '
Did not give diamonds beacuse the curreny and amount paid did not match.
' . $debug . '
';
}
} else {
//payment is not done. report that.
$contents .= '
Did not give diamonds beacuse the payment is not flagged as "completed" or was not instant
' . $debug . '
';
}
} else {
$contents .= '
Did not give diamonds beacuse the user did not exists.
' . $debug . '
';
}
$myFile = X . S . B . 'purchases/paypal-' . time() . '-' . rand(500, 45000) . '.txt';
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $contents);
fclose($fh);
} else if (strcmp ($res, "INVALID") == 0) {
// log for manual investigation
die("Invalid.");
}
?>
This one is giving "Diamonds" which is my buy-able currency at my hotel.
You should take a look at it. This will not for any CMS released, its just a simple way todo it without adding a bunch of useless codes.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
FullmetalPride
Mhmm. I released it only because I spent so long working on finding/building one, and I didn't want people to have to keep having these problemas.
You do know that it has been released before, right?
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
Roper
You do know that it has been released before, right?
I don't think he knows how to code PHP and needed one that fitted perfect for his CMS. He has tried to get a working one for ages but no-one wanted to help him out, people don't like the idea of micropayments at retros anymore.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
HickDead
I don't think he knows how to code PHP and needed one that fitted perfect for his CMS. He has tried to get a working one for ages but no-one wanted to help him out, people don't like the idea of micropayments at retros anymore.
There's a perfectly fine IPN released with every CMS release of mine.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
Jonteh
There's a perfectly fine IPN released with every CMS release of mine.
You said yourself that Uber 2.0's wasn't compatible. Also, there were specific reasons that I couldn't use it, like I never saw a template in there.
What did you mean about Micropayments? They don't like purchasing VIP, or they don't like having to tell their owners to activate VIP.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
FullmetalPride
What did you mean about Micropayments? They don't like purchasing VIP, or they don't like having to tell their owners to activate VIP.
*Ragezone habbo commuinty* They don't like purchasing VIP.
And personally I'm with them, many retro owners are like Paul LaFontaine and trying to drag money out of their players (DONATE OR I SHUTDOWN / BAN YOU!). Retros have become to much like Habbo, pay for dit, pay for dat. They've forgot WHY WE MAKE RETROS, the whole fucking point. The reason why people join retros is beacuse the don't wanna have to pay for everything, if they wanted to pay for everything they would pretty much stay with Habbo and not quit for retros.
-
Re: [PayPal] PayPal IPN - Automatic VIP [TESTED]
Quote:
Originally Posted by
HickDead
*Ragezone habbo commuinty* They don't like purchasing VIP.
And personally I'm with them, many retro owners are like Paul LaFontaine and trying to drag money out of their players (DONATE OR I SHUTDOWN / BAN YOU!). Retros have become to much like Habbo, pay for dit, pay for dat. They've forgot WHY WE MAKE RETROS, the whole fucking point. The reason why people join retros is beacuse the don't wanna have to pay for everything, if they wanted to pay for everything they would pretty much stay with Habbo and not quit for retros.
No. VIP is a optional thing on retros. Its the same thing on Habbo. If you want more benefits you have an option to purchase VIP. Personally on my hotel, I don't keep the money that is donated, I use it to pay for the servers, but if users don't donate I don't ban them or shutdown the hotel.