-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Klarna, Payment properties and enums
- Loading branch information
1 parent
a98e2bb
commit 46795ea
Showing
19 changed files
with
577 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/com/checkout/payments/AbstractPaymentPlanType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.checkout.payments; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
|
||
import java.time.Instant; | ||
|
||
@Data | ||
public abstract class AbstractPaymentPlanType { | ||
|
||
@SerializedName("days_between_payments") | ||
private Integer daysBetweenPayments; | ||
|
||
@SerializedName("total_number_of_payments") | ||
private Integer totalNumberOfPayments; | ||
|
||
@SerializedName("current_payment_number") | ||
private Integer currentPaymentNumber; | ||
|
||
@SerializedName("expiry") | ||
private Instant expiry; | ||
|
||
protected AbstractPaymentPlanType( | ||
final Integer daysBetweenPayments, | ||
final Integer totalNumberOfPayments, | ||
final Integer currentPaymentNumber, | ||
final Instant expiry) { | ||
this.daysBetweenPayments = daysBetweenPayments; | ||
this.totalNumberOfPayments = totalNumberOfPayments; | ||
this.currentPaymentNumber = currentPaymentNumber; | ||
this.expiry = expiry; | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/checkout/payments/AmountVariability.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.checkout.payments; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
public enum AmountVariability { | ||
|
||
@SerializedName("Fixed") | ||
FIXED, | ||
|
||
@SerializedName("Variable") | ||
VARIABLE | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.checkout.payments; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
import java.time.Instant; | ||
|
||
@Getter | ||
@Setter | ||
@EqualsAndHashCode(callSuper = true) | ||
@ToString(callSuper = true) | ||
public class InstallmentPlan extends AbstractPaymentPlanType { | ||
|
||
@SerializedName("financing") | ||
private Boolean financing; | ||
|
||
@SerializedName("amount") | ||
private String amount; | ||
|
||
@Builder | ||
private InstallmentPlan( | ||
final Boolean financing, | ||
final String amount, | ||
final Integer daysBetweenPayments, | ||
final Integer totalNumberOfPayments, | ||
final Integer currentPaymentNumber, | ||
final Instant expiry) { | ||
super(daysBetweenPayments, totalNumberOfPayments, currentPaymentNumber, expiry); | ||
this.financing = financing; | ||
this.amount = amount; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.checkout.payments; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
import java.time.Instant; | ||
|
||
@Getter | ||
@Setter | ||
@EqualsAndHashCode(callSuper = true) | ||
@ToString(callSuper = true) | ||
public class RecurringPlan extends AbstractPaymentPlanType { | ||
|
||
@SerializedName("amount_variability") | ||
private AmountVariability amountVariability; | ||
|
||
@Builder | ||
private RecurringPlan( | ||
final AmountVariability amountVariability, | ||
final Integer daysBetweenPayments, | ||
final Integer totalNumberOfPayments, | ||
final Integer currentPaymentNumber, | ||
final Instant expiry) { | ||
super(daysBetweenPayments, totalNumberOfPayments, currentPaymentNumber, expiry); | ||
this.amountVariability = amountVariability; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.