Updating invoice structure

master
Nelson R. Perez 2017-01-11 13:50:22 -05:00
parent e4768c700c
commit af653d376a
2 changed files with 99 additions and 12 deletions

View File

@ -2,26 +2,17 @@ package de.bitsharesmunich.graphenej;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import de.bitsharesmunich.graphenej.interfaces.JsonSerializable;
import org.bitcoinj.core.Base58;
import de.bitsharesmunich.graphenej.interfaces.JsonSerializable;
/**
* Class used to handle invoice generation, compression and QR-Code data derivation,
* as detailed in <a href="http://docs.bitshares.eu/integration/merchants/merchant-protocol.html">this</> link.
* @author Nelson R. Pérez
*/
public class Invoice implements JsonSerializable {
public static class LineItem {
private String label;
private int quantity;
private String price;
public LineItem(String label, int quantity, String price){
this.label = label;
this.quantity = quantity;
this.price = price;
}
}
private String to;
private String to_label;
private String memo;
@ -40,6 +31,62 @@ public class Invoice implements JsonSerializable {
this.callback = callback;
}
public String getToLabel() {
return to_label;
}
public void setToLabel(String to_label) {
this.to_label = to_label;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public LineItem[] getLineItems() {
return line_items;
}
public void setLineItems(LineItem[] line_items) {
this.line_items = line_items;
}
public String getCallback() {
return callback;
}
public void setCallback(String callback) {
this.callback = callback;
}
@Override
public String toJsonString() {
Gson gson = new Gson();

View File

@ -0,0 +1,40 @@
package de.bitsharesmunich.graphenej;
/**
* Created by nelson on 1/11/17.
*/
public class LineItem {
private String label;
private int quantity;
private double price;
public LineItem(String label, int quantity, double price){
this.label = label;
this.quantity = quantity;
this.price = price;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String getLabel(){
return label;
}
public void setLabel(String label) {
this.label = label;
}
}