Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Buycraft notification base/example
- *
- * @author Lmc
- * @copyright Buycraft.net (C) 2011
- */
- /**
- * Your API secret.
- *
- * Used in verificating that the notification is
- * actually coming from Buycraft and not another
- * site due to Buycraft is the only thing other
- * than you who should know your API secret.
- */
- define("API_SECRET", "5435a325285d426c815a43b1007997c012232df8");
- /**
- * Notification processing
- *
- */
- if(isset($_POST['json']) && isset($_POST['secret'])) // JSON encoded string and secret passed to us?
- {
- if($_POST['secret'] == API_SECRET) // API secret correct?
- {
- $notificationArray = json_decode($_POST['json']);
- /**
- * Validation passed!
- *
- * In here it is safe to proceed with processing the notification
- * knowing that it is actually from Buycraft and 100% legit.
- */
- $username = $notificationArray['username']; // Users minecraft account
- $packageId = $notificationArray['package']; // Package ID purchased
- $expireTime = $notificationArray['expire']; // Unix timestamp when the package expires (0 for a non-expiring package)
- $emailAddress = $notificationArray['email']; // The paypal email address for this user
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement