Thread: IPB Forums Shop Set Up

Results 1 to 5 of 5
  1. #1 IPB Forums Shop Set Up 
    Everything is Corrupt
    Corrupt's Avatar
    Join Date
    Oct 2020
    Posts
    115
    Thanks given
    15
    Thanks received
    36
    Rep Power
    63
    How to set up the Shop inside of IPB forums with donation claim





    Solak 718 Releases




    As I promised to a few people, once I got this working and finished, I would release it for others to use. This includes setting up the shop inside of the forums to correctly purchase and claim inside of your server.
    *The claim script was built in a 718+ server, so you may have to change it a bit*

    Step 1 : Setting up Payment Options



    Go to your control panel, under Commerce, Go to Payments - Settings.

    Go to the second tab Payment Methods and hit Create New button.

    In this example, we will set up PayPal.

    Click on PayPal option and click Save.

    On the next page, name it PayPal, check the Disabled: Do not use Subscriptions option, and next you need a Client ID and Secret ID. This uses REST API for passing information to and from payment gateways.

    Click on the blue text under the Client Id box create an application on PayPal's developer site. Create a developer account if you havent so already.

    Create a REST API Application, name it, select Merchant – Accept payments as a merchant (seller) option, and use your live account.

    After creating these, you will receive a Client ID and click reveal to get your Secret ID. Place those back in the store setting page, and click Save.

    Payment Method Set Up Done

    Create The Store and Products




    Go into Products, under Store in the Commerce sidebar.

    Create a new group, this will be your categories.

    After creating a group, create an item for purchase. by pressing the + button under the group, Add Product To This Group

    Create your product, adding images, name, description, price, stock, etc to the store.

    IMPORTANT

    Under the option on first page is Custom Fields. Create a custom field, by clicking custom field settings below the bar.

    Create a new custom field, lets say In-Game Name.

    Go back to finishing the product and make sure you add your new custom field to ALL PRODUCTS you are selling now and in the future.

    Creting products done.


    IMPORTANT!!

    Go into your database where your forums is, go into the table "nexus_purchases" and create a column "ps_claimed" as INT and set it to default 0.

    Store Claim Script



    Here is the store claim script you can use, that includes pulling in the name, checking price on invoice to prevent nulls or errors. Again this is built on 718+ so might have to change it, but make sure your RESULTSET query is not messed with.

    Code:
    package quantum.site;
    
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import com.rs.game.player.Player;
    
    /**
     * @author Quantum
     * This is for Store Claiming
     *  new Thread(new StoreClaim(player)).start(); 
     */
    public class StoreClaim implements Runnable {
    
    	public static final String HOST = ""; // website ip address 
    	public static final String USER = "";
    	public static final String PASS = "";
    	public static final String DATABASE = "";
    
    	private Player player;
    	private Connection conn;
    	private Statement stmt;
    
    	String name_claim;
    	
    	public StoreClaim(Player player) {
    		this.player = player;
    	}
    	
    	
    
    	public void run() {
    		try {
    			if (!connect(HOST, DATABASE, USER, PASS)) {
    				return;
    			}
    
    			String name = player.getDisplayName().replace("_", " ");
    			ResultSet connect = executeQuery("SELECT * FROM nexus_purchases WHERE JSON_VALUE(ps_custom_fields, '$.1') = '"+name+"' AND ps_claimed = 0 AND ps_cancelled = 0");//Dont touch
    			
    			while (connect.next()) { 
    				int packageID = connect.getInt("ps_item_id");
    	
    				player.sm("You have a purchase ready to be claimed!");
    				
    				switch(packageID) {
    				/**
    				 * Add your packages claiming here (go by ps_item_id)
    				 */
    				case 1:
    					
    					break;
    				}
    
    				connect.updateInt("ps_claimed", 1);
    				connect.updateRow();
    			}
    
    			destroy();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    	
    	/**
    	 *
    	 *     @Param host the host ip address or url
    	 *     @Param database the name of the database
    	 *     @Param user the user attached to the database
    	 *     @Param pass the users password
    	 *     @Return true if connected
    	 */
    	public boolean connect(String host, String database, String user, String pass) {
    		try {
    			this.conn = DriverManager.getConnection("jdbc:mysql://"+host+":3306/"+database, user, pass);
    			return true;
    		} catch (SQLException e) {
    			System.out.println("Failing connecting to database!");
    			return false;
    		}
    	}
    
    	/**
    	 * Disconnects from the MySQL server and destroy the connection
    	 * and statement instances
    	 */
    	public void destroy() {
            try {
        		conn.close();
            	conn = null;
            	if (stmt != null) {
        			stmt.close();
            		stmt = null;
            	}
            } catch(Exception e) {
                e.printStackTrace();
            }
        }
    
    	/**
    	 * Executes an update query on the database
    	 *     @Param query
    	 * @see {@link Statement#executeUpdate}
    	 */
    	public int executeUpdate(String query) {
            try {
            	this.stmt = this.conn.createStatement(1005, 1008);
                int results = stmt.executeUpdate(query);
                return results;
            } catch (SQLException ex) {
                ex.printStackTrace();
            }
            return -1;
        }
    
    	/**
    	 * Executres a query on the database
    	 *     @Param query
    	 * @see {@link Statement#executeQuery(String)}
    	 *     @Return the results, never null
    	 */
    	public ResultSet executeQuery(String query) {
            try {
            	this.stmt = this.conn.createStatement(1005, 1008);
                ResultSet results = stmt.executeQuery(query);
                return results;
            } catch (SQLException ex) {
                ex.printStackTrace();
            }
            return null;
        }
    
    
    }
    Hope you all enjoy!

    EDIT ; Added a few snippets of a shop.

    Attached image

    A small snippet of a shop, with groups, featured items, different currencies (can be set properly), support on purchases, new products.

    Attached image

    a snippet on what you see on view of product, including price, the in-game name function you put in earlier, and ability to check out. This also includes reviews of past people who bought and stock.

    Attached image

    A snippet of checkout, with ability to pick which payment method, split payment even, and an overview of cart items.
    Last edited by Corrupt; 06-28-2021 at 06:20 PM.
    Living in a Corrupted World

    Attached image
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Sep 2015
    Age
    24
    Posts
    532
    Thanks given
    68
    Thanks received
    115
    Rep Power
    414
    Might show us how would it look like once it's done, thanks for your contribution nonetheless
    Reply With Quote  
     

  3. #3  
    Everything is Corrupt
    Corrupt's Avatar
    Join Date
    Oct 2020
    Posts
    115
    Thanks given
    15
    Thanks received
    36
    Rep Power
    63
    Quote Originally Posted by Kiss My Axe View Post
    Might show us how would it look like once it's done, thanks for your contribution nonetheless
    Added!
    Living in a Corrupted World

    Attached image
    Reply With Quote  
     

  4. #4  
    shit im high af

    Chance's Avatar
    Join Date
    Feb 2012
    Age
    28
    Posts
    1,046
    Thanks given
    96
    Thanks received
    1,076
    Rep Power
    5000
    Good tutorial! Easy to follow and could really help smaller servers who can only afford to DIY!
    Quote Originally Posted by Nikolas RSPS View Post
    ill get a rune-server tattoo at 60,000 replies
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Jul 2018
    Posts
    87
    Thanks given
    182
    Thanks received
    49
    Rep Power
    0
    nice forum theme you got there

    Thanks for the tutorial. I'm sure it'll be useful to some people
    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. IPB installation + forum set-up
    By CarmeloAnthony in forum Buying
    Replies: 6
    Last Post: 02-05-2015, 01:45 PM
  2. Replies: 8
    Last Post: 04-26-2014, 09:32 PM
  3. Need Assistance With Setting Up IPB Forums | Dan |
    By aussie dan in forum Website Development
    Replies: 0
    Last Post: 12-19-2013, 03:40 AM
  4. 5$ Setting up PVP Point shop
    By Samsterz in forum Requests
    Replies: 2
    Last Post: 08-06-2010, 09:49 PM
  5. Replies: 3
    Last Post: 11-10-2009, 10:28 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
  •