Raised This Month: $32 Target: $400
 8% 

[ANY] PayPal Donations (Advanced)


Post New Thread Reply   
 
Thread Tools Display Modes
Morell
AlliedModders Donor
Join Date: Jun 2010
Location: World
Old 10-26-2017 , 08:23   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #31

Idea: Launch a command to the server when the donation is complete or listener to the server.
__________________
Morell is offline
Triniayo
Senior Member
Join Date: Apr 2011
Location: #include <germany>
Old 10-26-2017 , 16:08   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #32

Quote:
Originally Posted by Morell View Post
Idea: Launch a command to the server when the donation is complete or listener to the server.
Could probably add that. I'll think about it.
__________________
If you need any help, feel free to add me on Steam.


Triniayo is offline
Send a message via Skype™ to Triniayo
nguyenbaodanh
AlliedModders Donor
Join Date: Jun 2007
Location: HCMC, Vietnam
Old 10-26-2017 , 23:04   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #33

Quote:
Originally Posted by FreakyLike View Post
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.
nguyenbaodanh is offline
Triniayo
Senior Member
Join Date: Apr 2011
Location: #include <germany>
Old 10-27-2017 , 05:10   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #34

SourceBans doesn't support Durations of Flags. I believe there is a custom plugin for your purpose on the forums. but I'm not sure.

Edit: There's a plugin. Just found it: https://forums.alliedmods.net/showth...22#post1998822
__________________
If you need any help, feel free to add me on Steam.



Last edited by Triniayo; 10-27-2017 at 05:13.
Triniayo is offline
Send a message via Skype™ to Triniayo
SmackDaddy
Veteran Member
Join Date: Oct 2009
Old 10-27-2017 , 16:07   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #35

What if you only want them to have reserved slot perks (admin "b") and for a limited period of time -- does this support that?
SmackDaddy is offline
Triniayo
Senior Member
Join Date: Apr 2011
Location: #include <germany>
Old 10-28-2017 , 04:59   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #36

You should never give a user the flag b. Change the reserved slot flag to a custom flag.
__________________
If you need any help, feel free to add me on Steam.


Triniayo is offline
Send a message via Skype™ to Triniayo
michaelrw
Senior Member
Join Date: Jul 2017
Old 10-31-2017 , 01:40   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #37

I edited the index file to remove the divs for Tier3-5, since I only want to have 2 tiers.
I also edite the code with your Sourcebans edits so I can assign flag to users who donate.

Is there a way to make it so Tier 1 receives flag "x" and Tier 2 receives flag "y" ??
__________________

michaelrw is offline
Triniayo
Senior Member
Join Date: Apr 2011
Location: #include <germany>
Old 10-31-2017 , 03:56   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #38

Yes, this is possible. I will contact you
__________________
If you need any help, feel free to add me on Steam.


Triniayo is offline
Send a message via Skype™ to Triniayo
michaelrw
Senior Member
Join Date: Jul 2017
Old 11-03-2017 , 00:01   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #39

Quote:
Originally Posted by FreakyLike View Post
Yes, this is possible. I will contact you
any update on how to do this?
__________________

michaelrw is offline
Triniayo
Senior Member
Join Date: Apr 2011
Location: #include <germany>
Old 11-03-2017 , 07:35   Re: [ANY] PayPal Donations (Advanced)
Reply With Quote #40

Hey,

sorry I totally forgot that. Please message me on steam when you see that I'm online.
__________________
If you need any help, feel free to add me on Steam.


Triniayo is offline
Send a message via Skype™ to Triniayo
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode