Create Gamepass Transaction
Create a transaction for player to buy a Gamepass.
Creating a Gamepass Transaction
Creates a purchase transaction for a player.
Method
String createGamepassTXN(Player player, String gamepassID)Parameters
| Parameter | Type | Description |
|---|---|---|
| player | Player | The player creating the transaction |
| gamepassID | String | The Gamepass ID from the Nexa Panel |
Example
String txnId = nexaAPI.createGamepassTXN(player, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
if (!txnId.startsWith("ERROR_")) {
player.sendMessage("Transaction Created: " + txnId);
}Success Response
Returns:
"TXN_ID"The player will get a clickable message to finish the transaction.
Example:
[Nexa] Transaction Created, Click here to confirm!Error Response
Returns:
ERROR_GAMEPASS_NOT_FOUNDor another error returned by the API.
Example:
if (txnId.startsWith("ERROR_")) {
player.sendMessage("Failed: " + txnId);
}