Class Subscription<T>
- java.lang.Object
-
- com.broadleafcommerce.paymentgateway.domain.Subscription<T>
-
public class Subscription<T> extends Object
- Author:
- Chad Harchar (charchar) Many payment solutions allow you to set up subscriptions (recurring payments) with payment transactions. The following DTO represent the usual parameters that you may wish to pass: recurringAmount: the amount that you charge for every recurring payment frequency: the frequency of the recurring payment numberOfInstallments: the number of payments for this subscription startDate: the start date for this subscription
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Object>
additionalFields
Any extra properties needed to define the subscriptionprotected String
frequency
How often the customer will be chargedprotected String
numberOfInstallments
The number of times that the customer will be chargedprotected T
parent
protected javax.money.MonetaryAmount
recurringAmount
The amount that must be paid for each billing cycleprotected Instant
startDate
Start of when this subscription should be active.
-
Constructor Summary
Constructors Constructor Description Subscription()
Subscription(T parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subscription<T>
additionalFields(String key, Object value)
T
done()
Subscription<T>
frequency(String frequency)
Map<String,Object>
getAdditionalFields()
Any extra properties needed to define the subscriptionString
getFrequency()
How often the customer will be chargedString
getNumberOfInstallments()
The number of times that the customer will be chargedT
getParent()
javax.money.MonetaryAmount
getRecurringAmount()
The amount that must be paid for each billing cycleInstant
getStartDate()
Start of when this subscription should be active.Subscription<T>
numberOfInstallments(String numberOfInstallments)
Subscription<T>
recurringAmount(javax.money.MonetaryAmount recurringAmount)
Subscription<T>
startDate(Instant startDate)
boolean
subscriptionPopulated()
-
-
-
Field Detail
-
parent
protected T parent
-
recurringAmount
protected javax.money.MonetaryAmount recurringAmount
The amount that must be paid for each billing cycle
-
frequency
protected String frequency
How often the customer will be charged
-
numberOfInstallments
protected String numberOfInstallments
The number of times that the customer will be charged
-
startDate
protected Instant startDate
Start of when this subscription should be active. Unset indicates that this should always be active.
-
-
Constructor Detail
-
Subscription
public Subscription()
-
Subscription
public Subscription(T parent)
-
-
Method Detail
-
done
public T done()
-
additionalFields
public Subscription<T> additionalFields(String key, Object value)
-
recurringAmount
public Subscription<T> recurringAmount(javax.money.MonetaryAmount recurringAmount)
-
frequency
public Subscription<T> frequency(String frequency)
-
numberOfInstallments
public Subscription<T> numberOfInstallments(String numberOfInstallments)
-
startDate
public Subscription<T> startDate(Instant startDate)
-
subscriptionPopulated
public boolean subscriptionPopulated()
-
getParent
public T getParent()
-
getRecurringAmount
public javax.money.MonetaryAmount getRecurringAmount()
The amount that must be paid for each billing cycle- Returns:
- the amount that must be paid for each billing cycle
-
getFrequency
public String getFrequency()
How often the customer will be charged- Returns:
- how often the customer will be charged
-
getNumberOfInstallments
public String getNumberOfInstallments()
The number of times that the customer will be charged- Returns:
- the number of times that the customer will be charged
-
getStartDate
public Instant getStartDate()
Start of when this subscription should be active. Unset indicates that this should always be active.- Returns:
- the date when this subscription should start being active
-
-