|
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
- First off download our teamgames-api.zip from https://download.teamgames.io/teamgames-v1.02.zip, unzip the file and include the .jar in your project.
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.
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.
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.
Lets take a look at your new donation page
You can find your donation script at: yoursubdomain.gamepayments.net
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.
FinCode: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(); }
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 by Genesis; 02-25-2023 at 07:03 AM.
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(); }
i remember when u very first (year+ ago) showed me the screenshots of this, glad its finally out.
Thank you for all the hard work you put into this and for sharing better ways for game payments!
Whats different between this and the previous system everythingrs
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.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |