Gamepayments Auto Donation Installation [ANY BASE][BETA]

Genesis

Extreme Donator
 
Sep 22, 2010
4,191
747
0
Now supports Stripe integration

Gamepayments - Webstore Installation

Gamepayments is a webstore system by TeamGames. Here's a quick tutorial on how to get started with transactions.

Support Discord

If you need more help or for some reason cannot understand the tutorial. You can post a comment on this thread or reach us at our support Discord. TeamGames

Getting started


Registration and API Key

  • After adding the teamgames-api.jar into your project the next step is to create an account at TeamGames, you will be making a TeamGames account which will be used to log into Gamepayments.
  • Once the account is created, select Java as your game platform, and register your subdomain.
  • Now you can grab your API Key which is located in your dashboard https://gamepayments.net/account/dashboard! Remember this API Key and do not share it with anyone.

Ba7mT8S.jpg


AUWprf4.jpg


XwPIqcn.jpg


Setting up your donation with Paypal

This part is very simple, after signing in go to https://gamepayments.net/account/gateway/update/paypal, enter your Paypal email and press Submit, then you're set.

P0ALjSn.jpg


Adding and removing items

To add a new product go to the products section of the website https://gamepayments.net/account/products and click create a new product.

mLc6ZyN.jpg


Lets take a look at your new donation page

You can find your donation script at: yoursubdomain.gamepayments.net

9OoQIx1.jpg


Making the auto donate work with your server

This part of the tutorial is for PI, but can easily be changed to work with any server. If you want me to add a snippet on the thread so it can work with your framework leave a comment with the server base you want the snippet for.

Code:
 if (playerCommand.equalsIgnoreCase("claim")) {
                new java.lang.Thread() {
                    public void run() {
                        try {
                            final com.teamgames.gamepayments.GamePaymentsResponse gamepaymentsResponse = com.teamgames.gamepayments.Transaction.getResponse("API_KEY", PLAYERUSERNAME);
                            com.teamgames.gamepayments.Transaction[] transactions = gamepaymentsResponse.transactions;
                            if (!gamepaymentsResponse.getMessage().equalsIgnoreCase("SUCCESS")) {
                                c.sendMessage(gamepaymentsResponse.getExtendedMessage());
                                return;
                            }
                            for (com.teamgames.gamepayments.Transaction transaction : transactions) {
                                c.getItems().addItem(transaction.productId, transaction.quantity);
                            }
                            c.sendMessage("Thank you for donating!");
                        } catch (Exception e) {
                            c.sendMessage("Api Services are currently offline. Please check back shortly");
                            e.printStackTrace();
                        }    
                    }
                }.start();
            }

Fin

You are now finished adding the auto donation script to your website and server. If you have any suggestions for features, leave a comment and let me know. This service is still in beta.
 
Last edited:
  • Like
Reactions: Vesia
The following code is for elvarg/OSRS PK

Code:
} else if(parts[0].startsWith("claim")) {
            new java.lang.Thread() {
                public void run() {
                    try {
                    	final com.teamgames.gamepayments.GamePaymentsResponse gamepaymentsResponse = com.teamgames.gamepayments.Transaction.getResponse("GamePayment secret key", "Gamepayment username");
                        com.teamgames.gamepayments.Transaction[] transaction = gamepaymentsResponse.getTransactions();
                        if (!gamepaymentsResponse.getMessage().equalsIgnoreCase("SUCCESS")) {
                            player.getPacketSender().sendMessage(gamepaymentsResponse.getExtendedMessage());
                            return;
                        }
                        for (com.teamgames.gamepayments.Transaction transaction1 : transaction) {
                        	player.getInventory().add(new Item(Integer.parseInt(transaction1.productId), transaction1.quantity));
                        }
                        player.getPacketSender().sendMessage("Thank you for donating!");
                    } catch (Exception e) {
                        player.getPacketSender().sendMessage("Api Services are currently offline. Please check back shortly!");
                        e.printStackTrace();
                    }    
                }
            }.start();
		}
 
  • Like
Reactions: Genesis
i remember when u very first (year+ ago) showed me the screenshots of this, glad its finally out.
 
Since you had the post removed, I will post it again. You will have to come up with a better way to call the API than in a thread that directly modifies the players information. Perhaps a micro service that checks for payments and updates a database for the server to query against.
 
  • Like
Reactions: Genesis
You can now choose to only accept payments from verified Paypal accounts and addresses

xFz0Ikj.png
 
OAuth2 and Two Factor Authentication now available (through email or an authenticator app such as Google Authenticator). Google, Facebook, Twitter, Microsoft, Discord and Github are all available sign-in options.

uMfTd6M.png
 

Users who are viewing this thread (total: 1, members: 0, guests: 1)

Who read this thread (total members: 1)