Skip to content

VoucherTopup is a spigot plugin to allow player topup/refill/donate with truemoney wallet gift voucher system and very configurable, 100% free and open source!

License

Notifications You must be signed in to change notification settings

MinecraftChannel/VoucherTopup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VoucherTopup

VoucherTopup is a spigot plugin to allow player topup/refill/donate with truemoney wallet gift voucher system and very configurable, 100% free and open source!

Get VoucherTopup

Download

Compile

git clone https://github.com/MinecraftChannel/VoucherTopup
cd VoucherTopup
mvn clean install

Requirements

  • Java (JDK) 8 or above
  • Maven

Demo Servers

Developer API

Events
import com.google.gson.JsonObject;  
import th.in.mcch.vouchertopup.api.events.PlayerTopupEvent;  
import th.in.mcch.vouchertopup.api.events.TopupSuccessEvent;  
import org.bukkit.entity.Player;  
import org.bukkit.event.EventHandler;  
import org.bukkit.event.Listener;  
 
public class MyPlugin implements Listener {

   @EventHandler  
   public void onTopup(PlayerTopupEvent e) {  
       Player player = e.getPlayer();  
       String input = e.getInput();  
       e.setCancelled(true);  
   }

   @EventHandler  
   public void onTopupError(TopupErrorEvent e) { 
       Player player = e.getPlayer();  
       JsonObject result = e.getResult();  
   }

   @EventHandler  
   public void onTopupFailed(TopupFailedEvent e) {  
       Player player = e.getPlayer();  
       JsonObject result = e.getResult();  
   }

   @EventHandler  
   public void onTopupSuccess(TopupSuccessEvent e) {
       Player player = e.getPlayer();  
       JsonObject result = e.getResult();  
       System.out.println(result);  
       JsonObject status = e.getResult().getAsJsonObject().get("status").getAsJsonObject();  
       System.out.println(status);  
       JsonObject voucher = e.getResult().getAsJsonObject().get("data").getAsJsonObject().get("voucher").getAsJsonObject();  
       System.out.println(voucher);  
       double amount = voucher.get("redeemed_amount_baht").getAsDouble();  
       System.out.println("Redeem amount: " + amount + " by " + player.getName());  
   }
}

Open Source Libraries

About

VoucherTopup is a spigot plugin to allow player topup/refill/donate with truemoney wallet gift voucher system and very configurable, 100% free and open source!

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages