From 5a128fa8d390691af3284254fe8b6b50883fca76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Fri, 13 Oct 2023 16:44:45 +0200 Subject: [PATCH] Adds `method` property in `shipping` class --- .../com/checkout/payments/ShippingDetails.java | 16 ++++++++++++++++ .../payments/ShippingDetailsMethods.java | 18 ++++++++++++++++++ .../payments/ShippingDetailsTimeframe.java | 18 ++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 src/main/java/com/checkout/payments/ShippingDetailsMethods.java create mode 100644 src/main/java/com/checkout/payments/ShippingDetailsTimeframe.java diff --git a/src/main/java/com/checkout/payments/ShippingDetails.java b/src/main/java/com/checkout/payments/ShippingDetails.java index 5901ec12..78201d96 100644 --- a/src/main/java/com/checkout/payments/ShippingDetails.java +++ b/src/main/java/com/checkout/payments/ShippingDetails.java @@ -2,6 +2,7 @@ import com.checkout.common.Address; import com.checkout.common.Phone; +import com.checkout.sessions.DeliveryTimeframe; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; @@ -14,11 +15,26 @@ @AllArgsConstructor public final class ShippingDetails { + @SerializedName("first_name") + private String firstName; + + @SerializedName("last_name") + private String lastName; + + @SerializedName("email") + private String email; + private Address address; private Phone phone; @SerializedName("from_address_zip") private String fromAddressZip; + + @SerializedName("timeframe") + private ShippingDetailsTimeframe timeFrame; + + @SerializedName("method") + private ShippingDetailsMethods method; } diff --git a/src/main/java/com/checkout/payments/ShippingDetailsMethods.java b/src/main/java/com/checkout/payments/ShippingDetailsMethods.java new file mode 100644 index 00000000..1b125c42 --- /dev/null +++ b/src/main/java/com/checkout/payments/ShippingDetailsMethods.java @@ -0,0 +1,18 @@ +package com.checkout.payments; + +import com.google.gson.annotations.SerializedName; + +public enum ShippingDetailsMethods { + + @SerializedName("Digital") + DIGITAL, + + @SerializedName("PickUp") + PICK_UP, + + @SerializedName("BillingAddress") + BILLING_ADDRESS, + + @SerializedName("OtherAddress") + OTHER_ADDRESS, +} diff --git a/src/main/java/com/checkout/payments/ShippingDetailsTimeframe.java b/src/main/java/com/checkout/payments/ShippingDetailsTimeframe.java new file mode 100644 index 00000000..39866b84 --- /dev/null +++ b/src/main/java/com/checkout/payments/ShippingDetailsTimeframe.java @@ -0,0 +1,18 @@ +package com.checkout.payments; + +import com.google.gson.annotations.SerializedName; + +public enum ShippingDetailsTimeframe { + + @SerializedName("ElectronicDelivery") + ELECTRONIC_DELIVERY, + + @SerializedName("SameDay") + SAME_DAY, + + @SerializedName("Overnight") + OVERNIGHT, + + @SerializedName("TwoDayOrMore") + TWO_DAY_OR_MORE +}