Updating invoice structure

This commit is contained in:
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.Gson;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import de.bitsharesmunich.graphenej.interfaces.JsonSerializable;
import org.bitcoinj.core.Base58; import org.bitcoinj.core.Base58;
import de.bitsharesmunich.graphenej.interfaces.JsonSerializable;
/** /**
* Class used to handle invoice generation, compression and QR-Code data derivation, * 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. * as detailed in <a href="http://docs.bitshares.eu/integration/merchants/merchant-protocol.html">this</> link.
* @author Nelson R. Pérez * @author Nelson R. Pérez
*/ */
public class Invoice implements JsonSerializable { 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;
private String to_label; private String to_label;
private String memo; private String memo;
@ -40,6 +31,62 @@ public class Invoice implements JsonSerializable {
this.callback = callback; 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 @Override
public String toJsonString() { public String toJsonString() {
Gson gson = new Gson(); 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;
}
}