Advertisement
kjl13

BUYCRAFT JAVA STUFF FOR MIKE

Jan 21st, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 21.43 KB | None | 0 0
  1. BuycraftAPI class:
  2.  
  3. package com.faithfulmc.util.buycraft;
  4.  
  5. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  6. import java.io.*;
  7.  
  8. public class BuycraftAPI
  9. {
  10.     public static final String ENDPOINT = "https://plugin.buycraft.net";
  11.     private final String secret;
  12.    
  13.     public BuycraftAPI(final String secret) {
  14.         this.secret = secret;
  15.     }
  16.    
  17.     public JsonElement buycraftGET(final String subURL) throws IOException {
  18.         final JsonParser jsonParser;
  19.         final BufferedReader bufferedReader;
  20.         return new HTTPRequest("https://plugin.buycraft.net/" + subURL).open().requestMethod("GET").setRequestProperty("X-Buycraft-Secret", this.secret).disconnectAndReturn(self -> {
  21.             jsonParser = new JsonParser();
  22.             new BufferedReader(new InputStreamReader(self.getHttpURLConnection().getInputStream()));
  23.             return jsonParser.parse((Reader)bufferedReader);
  24.         });
  25.     }
  26.    
  27.     public JsonElement buycraftPOST(final String subURL, final JsonObject json) throws IOException {
  28.         final String jsonString = json.toString();
  29.         System.out.println(jsonString);
  30.         final HTTPRequest request = new HTTPRequest("https://plugin.buycraft.net/" + subURL);
  31.         try {
  32.             request.open().requestMethod("POST").setRequestProperty("X-Buycraft-Secret", this.secret).setRequestProperty("Content-Length", Integer.toString(jsonString.getBytes().length)).setRequestProperty("Content-Type", "application/json").doOutput(true).outputStream(outputStream -> new DataOutputStream(outputStream).writeBytes(jsonString));
  33.             final JsonParser jsonParser;
  34.             final BufferedReader bufferedReader;
  35.             return request.disconnectAndReturn(self -> {
  36.                 jsonParser = new JsonParser();
  37.                 new BufferedReader(new InputStreamReader(self.getHttpURLConnection().getInputStream()));
  38.                 return jsonParser.parse((Reader)bufferedReader);
  39.             });
  40.         }
  41.         catch (IOException exception) {
  42.             final JsonParser jsonParser2;
  43.             final BufferedReader bufferedReader2;
  44.             return request.disconnectAndReturn(self -> {
  45.                 jsonParser2 = new JsonParser();
  46.                 new BufferedReader(new InputStreamReader(self.getHttpURLConnection().getErrorStream()));
  47.                 return jsonParser2.parse((Reader)bufferedReader2);
  48.             });
  49.         }
  50.     }
  51. }
  52.  
  53. HTTPRequest Class
  54. package com.faithfulmc.util.buycraft;
  55.  
  56. import java.net.*;
  57. import java.io.*;
  58. import java.util.function.*;
  59.  
  60. public class HTTPRequest
  61. {
  62.     private final URL url;
  63.     private HttpURLConnection httpURLConnection;
  64.    
  65.     public HTTPRequest(final String url) throws MalformedURLException {
  66.         this.url = new URL(url);
  67.     }
  68.    
  69.     public HTTPRequest open() throws IOException {
  70.         this.httpURLConnection = (HttpURLConnection)this.url.openConnection();
  71.         return this;
  72.     }
  73.    
  74.     public HTTPRequest requestMethod(final String method) throws ProtocolException {
  75.         this.httpURLConnection.setRequestMethod(method);
  76.         return this;
  77.     }
  78.    
  79.     public HTTPRequest setRequestProperty(final String property, final String value) {
  80.         this.httpURLConnection.setRequestProperty(property, value);
  81.         return this;
  82.     }
  83.    
  84.     public HTTPRequest useCaches(final boolean useCaches) {
  85.         this.httpURLConnection.setUseCaches(useCaches);
  86.         return this;
  87.     }
  88.    
  89.     public HTTPRequest doInput(final boolean doInput) {
  90.         this.httpURLConnection.setDoInput(doInput);
  91.         return this;
  92.     }
  93.    
  94.     public HTTPRequest doOutput(final boolean doOutput) {
  95.         this.httpURLConnection.setDoOutput(doOutput);
  96.         return this;
  97.     }
  98.    
  99.     public HTTPRequest outputStream(final HTTPRequestConsumer<OutputStream> function) throws IOException {
  100.         function.accept(this.httpURLConnection.getOutputStream());
  101.         return this;
  102.     }
  103.    
  104.     public HTTPRequest inputStream(final HTTPRequestConsumer<InputStream> function) throws IOException {
  105.         function.accept(this.httpURLConnection.getInputStream());
  106.         return this;
  107.     }
  108.    
  109.     public HTTPRequest errorStream(final Function<InputStream, ?> function) throws IOException {
  110.         function.apply(this.httpURLConnection.getErrorStream());
  111.         return this;
  112.     }
  113.    
  114.     public HTTPRequest disconnect() {
  115.         this.httpURLConnection.disconnect();
  116.         return this;
  117.     }
  118.    
  119.     public <T> T disconnectAndReturn(final HTTPRequestFunction<T> function) throws IOException {
  120.         return function.apply(this);
  121.     }
  122.    
  123.     public HttpURLConnection getHttpURLConnection() {
  124.         return this.httpURLConnection;
  125.     }
  126.    
  127.     @FunctionalInterface
  128.     public interface HTTPRequestConsumer<T>
  129.     {
  130.         void accept(final T p0) throws IOException;
  131.     }
  132.    
  133.     @FunctionalInterface
  134.     public interface HTTPRequestFunction<T>
  135.     {
  136.         T apply(final HTTPRequest p0) throws IOException;
  137.     }
  138. }
  139.  
  140. Buycraft Framework Class
  141. package com.faithfulmc.framework.buycraft;
  142.  
  143. import com.faithfulmc.util.buycraft.*;
  144. import com.faithfulmc.framework.buycraft.api.to.*;
  145. import com.faithfulmc.framework.buycraft.api.*;
  146. import java.io.*;
  147. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  148. import java.util.*;
  149. import com.faithfulmc.framework.buycraft.api.from.*;
  150. import java.time.format.*;
  151. import java.time.temporal.*;
  152. import com.faithfulmc.framework.*;
  153.  
  154. public class BuycraftFramework
  155. {
  156.     public static final DateTimeFormatter DATE_FORMATTER;
  157.     public static final BuycraftAPI INSTANCE;
  158.     public static List<BuycraftCategory> CACHED_CATEGORIES;
  159.    
  160.     public static UUID getFromCompressed(final String string) {
  161.         return UUID.fromString(string.replaceFirst("(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", "$1-$2-$3-$4-$5"));
  162.     }
  163.    
  164.     public static BuycraftPostResponse addManualPayment(final ManualPayment manualPayment) throws BuycraftException {
  165.         final JsonObject jsonObject = manualPayment.toJSON();
  166.         JsonElement returnObject;
  167.         try {
  168.             returnObject = BuycraftFramework.INSTANCE.buycraftPOST("payments", jsonObject);
  169.         }
  170.         catch (IOException exception) {
  171.             throw new BuycraftException(exception);
  172.         }
  173.         return new BuycraftPostResponse((returnObject != null && returnObject.isJsonObject()) ? returnObject.getAsJsonObject() : null);
  174.     }
  175.    
  176.     public static List<BuycraftCategory> getCachedCategories() throws BuycraftException {
  177.         if (BuycraftFramework.CACHED_CATEGORIES != null) {
  178.             return BuycraftFramework.CACHED_CATEGORIES;
  179.         }
  180.         BuycraftFramework.CACHED_CATEGORIES = new ArrayList<BuycraftCategory>();
  181.         JsonElement returnObject;
  182.         try {
  183.             returnObject = BuycraftFramework.INSTANCE.buycraftGET("listing");
  184.         }
  185.         catch (IOException exception) {
  186.             throw new BuycraftException(exception);
  187.         }
  188.         if (returnObject.isJsonObject()) {
  189.             final JsonArray jsonArray = returnObject.getAsJsonObject().getAsJsonArray("categories");
  190.             for (final JsonElement jsonElement : jsonArray) {
  191.                 BuycraftFramework.CACHED_CATEGORIES.add(new BuycraftCategory(jsonElement.getAsJsonObject()));
  192.             }
  193.             return BuycraftFramework.CACHED_CATEGORIES;
  194.         }
  195.         throw new BuycraftException(returnObject.toString());
  196.     }
  197.    
  198.     public static List<BuycraftPayment> getPayments() throws BuycraftException {
  199.         JsonArray returnObject;
  200.         try {
  201.             returnObject = BuycraftFramework.INSTANCE.buycraftGET("payments").getAsJsonArray();
  202.         }
  203.         catch (IOException exception) {
  204.             throw new BuycraftException(exception);
  205.         }
  206.         final List<BuycraftPayment> payments = new ArrayList<BuycraftPayment>();
  207.         for (final JsonElement jsonElement : returnObject) {
  208.             payments.add(new BuycraftPayment(jsonElement.getAsJsonObject()));
  209.         }
  210.         return payments;
  211.     }
  212.    
  213.     static {
  214.         DATE_FORMATTER = new DateTimeFormatterBuilder().appendValue(ChronoField.YEAR).appendLiteral('-').appendValue(ChronoField.MONTH_OF_YEAR).appendLiteral('-').appendValue(ChronoField.DAY_OF_MONTH).appendLiteral('T').appendValue(ChronoField.HOUR_OF_DAY).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR).toFormatter();
  215.         INSTANCE = BasePlugin.getPlugin().getBuycraftAPI();
  216.         BuycraftFramework.CACHED_CATEGORIES = null;
  217.     }
  218. }
  219.  
  220. BuycraftException Class
  221. package com.faithfulmc.framework.buycraft.api;
  222.  
  223. public class BuycraftException extends Exception
  224. {
  225.     public BuycraftException() {
  226.     }
  227.    
  228.     public BuycraftException(final String message) {
  229.         super(message);
  230.     }
  231.    
  232.     public BuycraftException(final String message, final Throwable cause) {
  233.         super(message, cause);
  234.     }
  235.    
  236.     public BuycraftException(final Throwable cause) {
  237.         super(cause);
  238.     }
  239.    
  240.     public BuycraftException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) {
  241.         super(message, cause, enableSuppression, writableStackTrace);
  242.     }
  243. }
  244.  
  245. Buycraft API TO Package -
  246.  
  247. Buycraft Category Class:
  248. package com.faithfulmc.framework.buycraft.api.from;
  249.  
  250. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  251. import java.util.*;
  252.  
  253. public class BuycraftCategory
  254. {
  255.     private int id;
  256.     private int order;
  257.     private String name;
  258.     private boolean only_subcategories;
  259.     private List<BuycraftCategory> subcategories;
  260.     private List<BuycraftPackage> packages;
  261.    
  262.     public BuycraftCategory(final int id, final int order, final String name, final boolean only_subcategories, final List<BuycraftCategory> subcategories, final List<BuycraftPackage> packages) {
  263.         this.id = id;
  264.         this.order = order;
  265.         this.name = name;
  266.         this.only_subcategories = only_subcategories;
  267.         this.subcategories = subcategories;
  268.         this.packages = packages;
  269.     }
  270.    
  271.     public BuycraftCategory(final JsonObject jsonObject) {
  272.         this.id = jsonObject.get("id").getAsInt();
  273.         this.order = jsonObject.get("order").getAsInt();
  274.         this.name = jsonObject.get("name").getAsString();
  275.         this.only_subcategories = (jsonObject.has("only_subcategories") && jsonObject.get("only_subcategories").getAsBoolean());
  276.         this.subcategories = new ArrayList<BuycraftCategory>();
  277.         if (jsonObject.has("subcategories")) {
  278.             for (final JsonElement jsonElement : jsonObject.getAsJsonArray("subcategories")) {
  279.                 this.subcategories.add(new BuycraftCategory(jsonElement.getAsJsonObject()));
  280.             }
  281.         }
  282.         this.packages = new ArrayList<BuycraftPackage>();
  283.         if (jsonObject.has("packages")) {
  284.             for (final JsonElement jsonElement : jsonObject.getAsJsonArray("packages")) {
  285.                 this.packages.add(new BuycraftPackage(jsonElement.getAsJsonObject()));
  286.             }
  287.         }
  288.     }
  289.    
  290.     public int getId() {
  291.         return this.id;
  292.     }
  293.    
  294.     public int getOrder() {
  295.         return this.order;
  296.     }
  297.    
  298.     public String getName() {
  299.         return this.name;
  300.     }
  301.    
  302.     public boolean isOnly_subcategories() {
  303.         return this.only_subcategories;
  304.     }
  305.    
  306.     public List<BuycraftCategory> getSubcategories() {
  307.         return this.subcategories;
  308.     }
  309.    
  310.     public List<BuycraftPackage> getPackages() {
  311.         return this.packages;
  312.     }
  313.    
  314.     public List<BuycraftPackage> getPackagesRecursively() {
  315.         final List<BuycraftPackage> packages = new ArrayList<BuycraftPackage>();
  316.         packages.addAll(this.packages);
  317.         for (final BuycraftCategory subCategory : this.subcategories) {
  318.             packages.addAll(subCategory.getPackagesRecursively());
  319.         }
  320.         return packages;
  321.     }
  322. }
  323.  
  324. Buycraft Currency Class:
  325. package com.faithfulmc.framework.buycraft.api.from;
  326.  
  327. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  328.  
  329. public class BuycraftCurrency
  330. {
  331.     private String iso_4217;
  332.     private String symbol;
  333.    
  334.     public BuycraftCurrency(final String iso_4217, final String symbol) {
  335.         this.iso_4217 = iso_4217;
  336.         this.symbol = symbol;
  337.     }
  338.    
  339.     public BuycraftCurrency(final JsonObject jsonObject) {
  340.         this.iso_4217 = jsonObject.get("iso_4217").getAsString();
  341.         this.symbol = jsonObject.get("symbol").getAsString();
  342.     }
  343.    
  344.     public String getIso_4217() {
  345.         return this.iso_4217;
  346.     }
  347.    
  348.     public String getSymbol() {
  349.         return this.symbol;
  350.     }
  351. }
  352.  
  353. Buycraft Package Class:
  354. package com.faithfulmc.framework.buycraft.api.from;
  355.  
  356. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  357.  
  358. public class BuycraftPackage
  359. {
  360.     private int id;
  361.     private int order;
  362.     private String name;
  363.     private double price;
  364.     private BuycraftSale sale;
  365.    
  366.     public BuycraftPackage(final int id, final int order, final String name, final double price, final BuycraftSale sale) {
  367.         this.id = id;
  368.         this.order = order;
  369.         this.name = name;
  370.         this.price = price;
  371.         this.sale = sale;
  372.     }
  373.    
  374.     public BuycraftPackage(final JsonObject jsonObject) {
  375.         this.id = jsonObject.get("id").getAsInt();
  376.         this.order = jsonObject.get("order").getAsInt();
  377.         this.name = jsonObject.get("name").getAsString();
  378.         this.price = jsonObject.get("price").getAsDouble();
  379.         this.sale = new BuycraftSale(jsonObject.get("sale").getAsJsonObject());
  380.     }
  381.    
  382.     public int getId() {
  383.         return this.id;
  384.     }
  385.    
  386.     public int getOrder() {
  387.         return this.order;
  388.     }
  389.    
  390.     public String getName() {
  391.         return this.name;
  392.     }
  393.    
  394.     public double getPrice() {
  395.         return this.price;
  396.     }
  397.    
  398.     public BuycraftSale getSale() {
  399.         return this.sale;
  400.     }
  401. }
  402.  
  403. Buycraft Payment Class
  404. package com.faithfulmc.framework.buycraft.api.from;
  405.  
  406. import java.util.*;
  407. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  408. import com.faithfulmc.framework.buycraft.*;
  409. import java.time.*;
  410.  
  411. public class BuycraftPayment
  412. {
  413.     private int id;
  414.     private double amount;
  415.     private Date date;
  416.     private BuycraftCurrency currency;
  417.     private BuycraftPlayer player;
  418.    
  419.     public BuycraftPayment(final int id, final double amount, final Date date, final BuycraftCurrency currency, final BuycraftPlayer player) {
  420.         this.id = id;
  421.         this.amount = amount;
  422.         this.date = date;
  423.         this.currency = currency;
  424.         this.player = player;
  425.     }
  426.    
  427.     public BuycraftPayment(final JsonObject jsonObject) {
  428.         this.id = jsonObject.get("id").getAsInt();
  429.         this.amount = jsonObject.get("amount").getAsDouble();
  430.         final String dateString = jsonObject.get("date").getAsString();
  431.         final String dateTime = dateString.substring(0, dateString.length() - 9);
  432.         this.date = Date.from(LocalDateTime.from(BuycraftFramework.DATE_FORMATTER.parse(dateTime)).atZone(ZoneId.of("UTC")).toInstant());
  433.         this.currency = new BuycraftCurrency(jsonObject.get("currency").getAsJsonObject());
  434.         this.player = new BuycraftPlayer(jsonObject.get("player").getAsJsonObject());
  435.     }
  436.    
  437.     public int getId() {
  438.         return this.id;
  439.     }
  440.    
  441.     public double getAmount() {
  442.         return this.amount;
  443.     }
  444.    
  445.     public Date getDate() {
  446.         return this.date;
  447.     }
  448.    
  449.     public BuycraftCurrency getCurrency() {
  450.         return this.currency;
  451.     }
  452.    
  453.     public BuycraftPlayer getPlayer() {
  454.         return this.player;
  455.     }
  456. }
  457.  
  458. Buycraft Player CLASS
  459. package com.faithfulmc.framework.buycraft.api.from;
  460.  
  461. import java.util.*;
  462. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  463. import com.faithfulmc.framework.buycraft.*;
  464.  
  465. public class BuycraftPlayer
  466. {
  467.     private int id;
  468.     private String name;
  469.     private UUID uuid;
  470.    
  471.     public BuycraftPlayer(final int id, final String name, final UUID uuid) {
  472.         this.id = id;
  473.         this.name = name;
  474.         this.uuid = uuid;
  475.     }
  476.    
  477.     public BuycraftPlayer(final JsonObject jsonObject) {
  478.         this.id = jsonObject.get("id").getAsInt();
  479.         this.name = jsonObject.get("name").getAsString();
  480.         this.uuid = BuycraftFramework.getFromCompressed(jsonObject.get("uuid").getAsString());
  481.     }
  482.    
  483.     public int getId() {
  484.         return this.id;
  485.     }
  486.    
  487.     public String getName() {
  488.         return this.name;
  489.     }
  490.    
  491.     public UUID getUuid() {
  492.         return this.uuid;
  493.     }
  494. }
  495.  
  496. Buycraft Sale Class:
  497. package com.faithfulmc.framework.buycraft.api.from;
  498.  
  499. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  500.  
  501. public class BuycraftSale
  502. {
  503.     private boolean active;
  504.     private double discount;
  505.    
  506.     public BuycraftSale(final boolean active, final double discount) {
  507.         this.active = active;
  508.         this.discount = discount;
  509.     }
  510.    
  511.     public BuycraftSale(final JsonObject jsonObject) {
  512.         this.active = jsonObject.get("active").getAsBoolean();
  513.         this.discount = jsonObject.get("discount").getAsDouble();
  514.     }
  515.    
  516.     public boolean isActive() {
  517.         return this.active;
  518.     }
  519.    
  520.     public double getDiscount() {
  521.         return this.discount;
  522.     }
  523. }
  524.  
  525. Buycraft API to package -
  526.  
  527. BuycraftPostResponse class:
  528. package com.faithfulmc.framework.buycraft.api.to;
  529.  
  530. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  531.  
  532. public class BuycraftPostResponse
  533. {
  534.     private Integer error_code;
  535.     private String error_message;
  536.    
  537.     public BuycraftPostResponse(final Integer error_code, final String error_message) {
  538.         this.error_code = error_code;
  539.         this.error_message = error_message;
  540.     }
  541.    
  542.     public BuycraftPostResponse(final JsonObject jsonObject) {
  543.         if (jsonObject != null) {
  544.             this.error_code = (jsonObject.has("error_code") ? jsonObject.get("error_code").getAsInt() : null);
  545.             this.error_message = (jsonObject.has("error_message") ? jsonObject.get("error_message").getAsString() : null);
  546.         }
  547.     }
  548.    
  549.     public boolean isSuccess() {
  550.         return this.error_code == null || this.error_code == 203;
  551.     }
  552.    
  553.     public Integer getError_code() {
  554.         return this.error_code;
  555.     }
  556.    
  557.     public String getError_message() {
  558.         return this.error_message;
  559.     }
  560. }
  561.  
  562. Manual Payment Class:
  563. package com.faithfulmc.framework.buycraft.api.to;
  564.  
  565. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  566. import java.util.*;
  567.  
  568. public class ManualPayment
  569. {
  570.     private String ign;
  571.     private double price;
  572.     private List<PaymentPackage> packages;
  573.    
  574.     public ManualPayment(final String ign, final double price, final List<PaymentPackage> packages) {
  575.         this.ign = ign;
  576.         this.price = price;
  577.         this.packages = packages;
  578.     }
  579.    
  580.     public String getIgn() {
  581.         return this.ign;
  582.     }
  583.    
  584.     public double getPrice() {
  585.         return this.price;
  586.     }
  587.    
  588.     public List<PaymentPackage> getPackages() {
  589.         return this.packages;
  590.     }
  591.    
  592.     public JsonObject toJSON() {
  593.         final JsonObject jsonObject = new JsonObject();
  594.         jsonObject.addProperty("ign", this.ign);
  595.         jsonObject.addProperty("price", (Number)this.price);
  596.         final JsonArray packageArray = new JsonArray();
  597.         for (final PaymentPackage paymentPackage : this.packages) {
  598.             packageArray.add((JsonElement)paymentPackage.toJSON());
  599.         }
  600.         jsonObject.add("packages", (JsonElement)packageArray);
  601.         return jsonObject;
  602.     }
  603. }
  604.  
  605. Payment Package Class:
  606. package com.faithfulmc.framework.buycraft.api.to;
  607.  
  608. import org.bukkit.craftbukkit.libs.com.google.gson.*;
  609. import java.util.*;
  610.  
  611. public class PaymentPackage
  612. {
  613.     private int id;
  614.     private Map<String, Object> options;
  615.    
  616.     public PaymentPackage(final int id, final Map<String, Object> options) {
  617.         this.id = id;
  618.         this.options = options;
  619.     }
  620.    
  621.     public int getId() {
  622.         return this.id;
  623.     }
  624.    
  625.     public Map<String, Object> getOptions() {
  626.         return this.options;
  627.     }
  628.    
  629.     public Double getPrice() {
  630.         return this.options.get("price");
  631.     }
  632.    
  633.     public Integer getServer() {
  634.         return this.options.get("server");
  635.     }
  636.    
  637.     public Integer getGlobal() {
  638.         return this.options.get("global");
  639.     }
  640.    
  641.     public JsonObject toJSON() {
  642.         final JsonObject jsonObject = new JsonObject();
  643.         jsonObject.addProperty("id", (Number)this.id);
  644.         final JsonObject paymentOptionsObject = new JsonObject();
  645.         for (final Map.Entry<String, Object> entry : this.options.entrySet()) {
  646.             final String property = entry.getKey();
  647.             final Object value = entry.getValue();
  648.             if (value instanceof Number) {
  649.                 paymentOptionsObject.addProperty(property, (Number)value);
  650.             }
  651.             else if (value instanceof Boolean) {
  652.                 paymentOptionsObject.addProperty(property, (Boolean)value);
  653.             }
  654.             else {
  655.                 if (!(value instanceof String)) {
  656.                     throw new JsonParseException("Failed to serialize '" + property + "':" + "'" + value.toString() + "'");
  657.                 }
  658.                 paymentOptionsObject.addProperty(property, (String)value);
  659.             }
  660.         }
  661.         jsonObject.add("options", (JsonElement)paymentOptionsObject);
  662.         return jsonObject;
  663.     }
  664. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement