Thread: (sort of) Automatic custom donation page for paypal IPN.

Results 1 to 10 of 10
  1. #1 Custom donation page for paypal IPN. 
    Registered Member

    Join Date
    Oct 2014
    Posts
    192
    Thanks given
    31
    Thanks received
    15
    Rep Power
    81
    Media:
    Spoiler for Media:


    (The colors in the gif are way off because of the compression)


    Without any items:
    Attached image


    With one item:
    Attached image


    With 2 items & currency changed to USD:
    Attached image


    buy x amount of item:
    Attached image


    Items can have as many special deal as you wish:
    Attached image



    How to configure:
    Spoiler for configuration:

    Heres what the site consists of:
    -shop.php
    -styling.css
    -script.js
    -config-api.php
    -shop-config.php


    In the shop-config file you are capable of:
    -adding / removing new items, with ease,
    -setting the price of items,
    -changing the items image,
    -adding special deals, (ex: 1 mystery box for 10$ and 10 mystery box for only 90$ or 100 mystery box for only 800$)
    -changing the currency between US dollers and euro, (more currencies can easily be added)
    -enabling / disabling paypal sandbox mode, (for testing)
    -setting the amount of items per row, (if you dont set this, then it will just fill up as many items per row as it can fit)
    -setting the paypal email,
    -setting the return address that the player will be redirected to. (so you can redirect them to a thank-you.html page after the donation)



    How to use config.php:


    Changing the currency:
    Call function 'SetCurrency' and parse it the currency you want. there are only two option: 'USD' and 'EUR'
    ex:
    Code:
    SetCurrency("USD"); //options: EUR | USD


    Setting how many items there should be per row:
    Call function 'SetNumItemsPerRow' and parse the amount of items you want per row.
    ex:
    Code:
    SetNumItemsPerRow(3);


    Setting your paypal email:
    Call function 'SetPaypalEmail' and parse it the email of your paypal account
    ex:
    Code:
    SetPaypalEmail("[email protected]");



    Enabling / Disabling sandbox mode:
    Call function 'SetSandbox' and parse true or false
    ex:
    Code:
    SetSandbox(true);




    Adding new item & setting its image:
    Create an object of class 'Item' and call the functions SetName and SetImage.
    Make sure to call Show() as well.
    ex:
    Code:
    $mystery_box = new Item();
    $mystery_box->SetName("mbox");
    $mystery_box->SetImage("path/to/image.png");
    $mystery_box->Show();



    Setting the price of an item:
    To set the price of an item you have to add a "deal" by calling the items 'AddDeal' function,
    the 'AddDeal' function takes two arguments: the amount of that item and the price of that amount.
    ex:
    Code:
    $mystery_box = new Item();
    $mystery_box->SetName("Mystery Box");
    $mystery_box->SetImage("./images/mystery_box.png");
    $mystery_box->AddDeal(1,5); //one mbox for 5$
    $mystery_box->AddDeal(5,25); //five mboxes for 25$
    $mystery_box->AddDeal(10,50);//ten mboxes for 50$
    $mystery_box->AddDeal(50,250); //fifty mboxes for 250$
    $mystery_box->Show();





    Feel free to change the design of the page and then re-sell it if you you want. I don't mind.


    To make the site work all you need is an IPN listener script that hooks up with your database, as well as enabling IPN on your paypal account.
    If anyone want me to set it up for them, I'm willing to do it for a fee. Just pm me or write me on skype - username: Stav5.


    Link: https://www.dropbox.com/s/5zkob7s6dzdk1i1/shop.zip?dl=1
    Reply With Quote  
     

  2. #2  
    RuneCasino


    Join Date
    Jul 2007
    Posts
    1,647
    Thanks given
    175
    Thanks received
    257
    Rep Power
    358
    Looks nice actually for a starter, gj.
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Sep 2014
    Posts
    300
    Thanks given
    122
    Thanks received
    91
    Rep Power
    158
    Looks nice, sad to hear about that you got deceived...
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Oct 2014
    Posts
    192
    Thanks given
    31
    Thanks received
    15
    Rep Power
    81
    Quote Originally Posted by Armo View Post
    Looks nice actually for a starter, gj.
    thanks

    Quote Originally Posted by Banners View Post
    Looks nice, sad to hear about that you got deceived...
    thanks, i actually found out that i won the paypal dispute, today, so i got to keep the money after all
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Sep 2014
    Posts
    300
    Thanks given
    122
    Thanks received
    91
    Rep Power
    158
    Quote Originally Posted by stav5 View Post
    thanks, i actually found out that i won the paypal dispute, today, so i got to keep the money after all
    Haha great to hear.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jan 2018
    Posts
    1
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Thank you it's been a long time since I'm looking for a code like this
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    May 2016
    Age
    26
    Posts
    281
    Thanks given
    162
    Thanks received
    64
    Rep Power
    96
    Sorta looks like one of foxtrots
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Nov 2014
    Posts
    611
    Thanks given
    180
    Thanks received
    156
    Rep Power
    0
    This is a perfect example why fonts are so important.
    Try adding a suitable font and then compare.
    Reply With Quote  
     

  9. #9  
    KNOWLEDGE IS POWER

    OG KingFox's Avatar
    Join Date
    Dec 2006
    Age
    33
    Posts
    1,683
    Thanks given
    628
    Thanks received
    1,062
    Rep Power
    750
    Saw my name so i'll add some input hehehe.

    Opened the first shop.php i saw and saw this form:

    Code:
    <form id="donate_form" action=<?php echo ' "https://www.'.$SandboxMode.'paypal.com/cgi-bin/webscr" ' ?> method="post">
    <input type="hidden" name="cmd" value="_cart"/>
    <input type="hidden" name="upload" value="1">
    <input type="hidden" name="business" value=<?php echo '"'.$Paypal.'" ';?> />
    <input type="hidden" name="currency_code" value=<?php echo '"'.$Currency.'"';  ?> />
    <input type="hidden" name="return" value=<?php echo '"'.$Return.'" ';?> />
    <input type="hidden" name="custom" id="donate_custom_input" value=""/>
    </form>
    normally wouldn't be a problem, except this submits directly to paypal and the form can be modified beforehand. You should be submitting to your own script where each and every field is verified, then redirect to the paypal page.

    idk, didn't look at it super thoroughly, but if you intend to use this, just be warned of that

    EDIT:
    Why is there a class in a config file? o.o
    https://hastebin.com/ogomirudik.xml

    and i don't see any way that this is automated..OH JESUS THIS IS FROM LAST YEAR X.X

    Attached image
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Oct 2014
    Posts
    192
    Thanks given
    31
    Thanks received
    15
    Rep Power
    81
    Quote Originally Posted by Brandito View Post
    Sorta looks like one of foxtrots
    I'll take that as a compliment

    Quote Originally Posted by Thrallix View Post
    This is a perfect example why fonts are so important.
    Try adding a suitable font and then compare.
    You are right, I tried adding some better fonts and it looks way cleaner. Thanks for the advice



    Quote Originally Posted by OG KingFox View Post
    Saw my name so i'll add some input hehehe.
    I apologize for the horrors you might have seen in my code. I was hoping nobody would look at it

    Quote Originally Posted by OG KingFox View Post
    Opened the first shop.php i saw and saw this form:

    Code:
    <form id="donate_form" action=<?php echo ' "https://www.'.$SandboxMode.'paypal.com/cgi-bin/webscr" ' ?> method="post">
    <input type="hidden" name="cmd" value="_cart"/>
    <input type="hidden" name="upload" value="1">
    <input type="hidden" name="business" value=<?php echo '"'.$Paypal.'" ';?> />
    <input type="hidden" name="currency_code" value=<?php echo '"'.$Currency.'"';  ?> />
    <input type="hidden" name="return" value=<?php echo '"'.$Return.'" ';?> />
    <input type="hidden" name="custom" id="donate_custom_input" value=""/>
    </form>
    normally wouldn't be a problem, except this submits directly to paypal and the form can be modified beforehand. You should be submitting to your own script where each and every field is verified, then redirect to the paypal page.

    idk, didn't look at it super thoroughly, but if you intend to use this, just be warned of that
    I think my idea was that you would only do verification on the actual notification from paypal (which you would have to write yourself). That way if somebody did something malicious like change the currency or change the price from 100$ to 1$ you would just mark it as a faulty donation and not give the player the items while you still get to keep whatever money they did send (unless they refund if of course, which they probably will)

    EDIT:
    Why is there a class in a config file? o.o
    https://hastebin.com/ogomirudik.xml

    and i don't see any way that this is automated..OH JESUS THIS IS FROM LAST YEAR X.X
    I don't really remember my reasoning for the class....probably i was just thinking that it was the easiest thing to do at the time. (also, I had just done a lot of java so my mind was in a very "object-orianted" state at the time)
    And yeah im sorry it's not really fully automatic since it doesn't include anything to actually verify the donations and store them. but its great clickbait


    If anyone is actually trying to use this for their server i defiantly recommend you to buy a proper made one instead. Like one of Foxtrots.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 16
    Last Post: 10-14-2013, 03:01 AM
  2. [TUT] - Custom Donate Page.
    By Pehpero in forum Website Development
    Replies: 10
    Last Post: 12-01-2011, 05:03 AM
  3. Replies: 25
    Last Post: 05-31-2010, 11:59 PM
  4. how to make free money with PAYPAL!
    By Snow Cat123 in forum Chat
    Replies: 0
    Last Post: 05-06-2010, 07:41 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •