 |
|
AlliedModders Donor
Join Date: Jun 2007
Location: HCMC, Vietnam
|

10-26-2017
, 23:04
Re: [ANY] PayPal Donations (Advanced)
|
#33
|
Quote:
Originally Posted by FreakyLike
If you want it for sourcebans, please edit "../classes/paypal-listener,php".
Replace the code with this code:
PHP Code:
<?php //namespace Listener;
require __DIR__.'/paypal-api.php'; require __DIR__.'/../includes/db.php'; require __DIR__.'/../config.php';
use PaypalIPN;
$ipn = new PaypalIPN();
// Uncomment below, if you want to use sandbox //$ipn->useSandbox();
$verified = $ipn->verifyIPN(); if ($verified) { /* * Process IPN * A list of variables is available here: * https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNandPDTVariables/ */ $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $steamid = $_POST['custom']; $payment_date = date('Y-m-d H:i:s'); $db->query('INSERT INTO sb_admins (user, authid, email, srv_flags) VALUES (?, ?, ?, ?)', [ $steamid, $steamid, $payer_email, $sourcebans_flag ]); }
// Reply with an empty 200 response to indicate to paypal the IPN was received correctly. header("HTTP/1.1 200 OK");
After this, edit your Config.php and replace everything with this code:
PHP Code:
<?php /* * Donation Amounts */ $amount_tier1 = "5.00"; // Donation Amount for Tier 1 $amount_tier2 = "10.00"; // Donation Amount for Tier 2 $amount_tier3 = "15.00"; // Donation Amount for Tier 3 $amount_tier4 = "25.00"; // Donation Amount for Tier 4 $amount_tier5 = "50.00"; // Donation Amount for Tier 5 /* * PayPal Settings */ // Enter the currency which you use. (for example: EUR, USD, CHF) $paypal_currency = "EUR"; /* * PayPal URL * Sandbox-URL: https://www.sandbox.paypal.com/cgi-bin/webscr * Live-URL: https://www.paypal.com/cgi-bin/webscr */ $paypal_url = "https://www.paypal.com/cgi-bin/webscr"; // Enter your PayPal E-Mail here. $paypal_email = "[email protected]"; //Enter your Notify URL here. $notify_url = "https://yourwebsite.com/donate/classes/paypal-listener.php"; // Enter your Success URL here. $success_url = "https://yourwebsite.com/donate/verify_success.php"; // Enter your Error URL here. $cancel_url = "https://yourwebsite.com/donate/verify_error.php"; /* * Steam API Settings */ // Enter your API Key here - You can find it at: http://steamcommunity.com/dev/apikey $steamauth['apikey'] = "YOUR-API-KEY"; // URL of your main website $steamauth['domainname'] = "http://yourdomain.com/donate"; // URL which user get redirected to after logout $steamauth['logoutpage'] = "http://yourdomain.com/donate"; // URL which user get redirected to after login $steamauth['loginpage'] = "http://yourdomain.com/donate";
// Custom Sourcemod-Flag which donators receive after donating $sourcebans_flag = "t";
|
Thanks alot!
and how about tier ?
For example ,I want tier 1 is vip , tier 2 is mod ?
or
Tier1 = 30 days
Tier2 = 60 days
__________________
Last edited by nguyenbaodanh; 10-26-2017 at 23:57.
|
|
|
|