diff --git a/src/main/java/com/oddprints/prodigi/pojos/Order.java b/src/main/java/com/oddprints/prodigi/pojos/Order.java index 5b08539..303f68c 100644 --- a/src/main/java/com/oddprints/prodigi/pojos/Order.java +++ b/src/main/java/com/oddprints/prodigi/pojos/Order.java @@ -23,12 +23,14 @@ public class Order { private List charges; private List shipments; private String merchantReference; + private String idempotencyKey; public static class Builder { private List builderItems; private ShippingMethod builderShippingMethod; private Recipient builderRecipient; private String builderMerchantReference; + private String builderIdempotencyReference; public Builder(ShippingMethod shippingMethod, Recipient recipient) { builderItems = new ArrayList<>(); @@ -53,12 +55,18 @@ public Builder merchantReference(String merchantReference) { return this; } + public Builder idempotencyReference(String idempotencyReference) { + builderIdempotencyReference = idempotencyReference; + return this; + } + public Order build() { Order order = new Order(); order.setItems(builderItems); order.setShippingMethod(builderShippingMethod); order.setRecipient(builderRecipient); order.setMerchantReference(builderMerchantReference); + order.setIdempotencyKey(builderIdempotencyReference); return order; } } @@ -106,6 +114,14 @@ public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; } + public String getIdempotencyKey() { + return idempotencyKey; + } + + public void setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + @JsonIgnore // don't serialise... public Status getStatus() { return status;