ibilling.client
Class PaymentPlan

java.lang.Object
  extended by ibilling.client.ClientObject
      extended by ibilling.client.PaymentPlan
All Implemented Interfaces:
java.io.Serializable

public class PaymentPlan
extends ClientObject

Represents a series of future payments that should be executed on the specified schedule using defined Payment Option. All future payments are encoded using Charge objects (see Charge) for more information

Since:
1.0
See Also:
Serialized Form

Field Summary
private  Adjustment adjustment
          reference to adjustment object explaining changes made to the plan
private  java.lang.Integer amount
          Amount of a single payment represented by the plan
private  java.lang.String billingCycleCode
          code specified the billing cycle.
private  java.util.List<Charge> charges
          list of the charges representing future payments
private  CustomerAccount customerAccount
          customer account owning this plan
private  java.lang.Integer deferredLength
          current total length of deferred charges or freezes included in the plan
private  java.lang.Integer deferredValue
          deferredLength multiplied by amount
private  java.util.Date firstBillingDate
          The date when first invoice is expected to be created
private  java.lang.String groupCode1
          optional group code for external systems
private  java.lang.String groupCode2
          optional group code for external systems
private  java.lang.String groupCode3
          optional group code for external systems
private  java.lang.String groupCode4
          optional group code for external systems
private  java.lang.String groupCode5
          optional group code for external systems
private  java.lang.String groupCode6
          optional group code for external systems
private  java.lang.String groupCode7
          optional group code for external systems
private  java.lang.String groupCode8
          optional group code for external systems
private  java.lang.String itemCode
          optional item code; tax code can be derived from it.
private  java.util.Date lastInvoicingDate
          the date when the invoice for this plan was last created
private  java.util.Date lastProcessingDate
          the date when this plan was processed by Invoicing Service for the last time.
private  java.util.Date lastUpdateDate
          the date when this plan was updated for the last time
private  java.lang.Integer length
          current length of the payment plan (for perpetual and complimentary plans, the length will be derived from the forecasting period (see FAQ)
private  java.lang.Integer linkAccount
          ???
private  PaymentPlan linkedParentPlan
          parent of this payment plan (current plan becomes active only after the parent plan is fully processed or canceled)
private  java.util.Date nextBillingDate
          The date when this plan will be processed next time.
private  PaymentOption paymentOption
          reference to the payment option to be used to charge payments
private  java.lang.String sellerCode
          optional code identifying the plan's seller in the external system
private static long serialVersionUID
          The Constant serialVersionUID.
private  java.lang.String status
          current status of the plan.
private  java.lang.String taxCode
          optional tax code defining tax amount.
private  java.lang.String type
          type of the payment plan.
private  java.lang.Integer value
          length multiplied by amount
 
Constructor Summary
PaymentPlan()
          Instantiates a new payment plan.
PaymentPlan(java.util.Date createDate, java.util.Date lastInvocingDate, java.util.Date lastProcessingDate, java.lang.String code, java.lang.String sellerCode, java.lang.Integer length, java.lang.Integer value, java.lang.Integer deferredLength, java.lang.Integer deferredValue, java.lang.Integer amount, java.lang.String groupCode1, java.lang.String groupCode2, java.lang.String groupCode3, java.lang.String groupCode4, java.lang.String groupCode5, java.lang.String groupCode6, java.lang.String groupCode7, java.lang.String groupCode8, java.lang.Integer merchantAccountCode, java.lang.String type, java.util.Date firstBillingDate, java.lang.String billingCycleCode, java.lang.String itemCode, java.lang.String taxCode, PaymentOption paymentOption, CustomerAccount customerAccount, java.lang.Long id, java.util.Date lastUpdateDate, java.util.Date nextBillingDate, java.lang.String status)
          Instantiates a new payment plan.
 
Method Summary
 void add(java.lang.Integer position, java.lang.Integer length, boolean isFreeze)
          Adds specified number of charges at the specified position to this payment plan
(package private)  void addCharge(Charge charge, java.lang.Integer position)
          Adds the specified charge at the indicated position
 void cancel()
          Cancels the payment plan.
 Adjustment createAdjustment()
          Creates an Adjustment object and assigns it to the plan.
 Adjustment createAdjustmentExtended(java.lang.String code, java.lang.String notes, java.lang.String adjustmentReasonCode)
          Creates an Adjustment object with the specified values.
 PaymentPlan createLinkedPaymentPlan()
          Creates and returns a new payment plan linked to this plan.
 PaymentPlan createLinkedPaymentPlanBasic(java.lang.String code, java.lang.String type, java.lang.Integer amount, java.lang.Integer length)
          Creates linked payment plan with specified values.
 PaymentPlan createLinkedPaymentPlanExtended(java.lang.String code, java.lang.String type, java.lang.Integer amount, java.lang.Integer length, PaymentOption paymentOption, java.lang.String sellerCode, java.lang.String itemCode, java.lang.String taxCode, java.lang.String groupCode1, java.lang.String groupCode2, java.lang.String groupCode3, java.lang.String groupCode4, java.lang.String groupCode5, java.lang.String groupCode6, java.lang.String groupCode7, java.lang.String groupCode8)
          Creates linked payment plan with specified values.
(package private)  java.util.List<Charge> createListCharges(int size)
          Allocates list with charges to the specified size
private  void decrementChargesListParameters(Charge charge)
          Recalculates all charge depended fields of a plan due to the existing charge being removed
 boolean equals(java.lang.Object anotherObject)
           
 Adjustment getAdjustment()
          Gets the adjustment.
 java.lang.Integer getAmount()
          Gets the amount.
 java.lang.String getBillingCycleCode()
          Gets the billing cycle code.
 java.util.List<Charge> getCharges()
          Returns a copy of the list of charges within the plan
(package private)  java.util.List<Charge> getChargesInternal()
          Returns list of charges.
 CustomerAccount getCustomerAccount()
          Gets the customer account.
 java.lang.Integer getDeferredLength()
          Gets the deferred length.
 java.lang.Integer getDeferredValue()
          Gets the deferred value.
 java.util.Date getFirstBillingDate()
          Gets the first billing date.
 java.lang.String getGroupCode1()
          Gets the group code1.
 java.lang.String getGroupCode2()
          Gets the group code2.
 java.lang.String getGroupCode3()
          Gets the group code3.
 java.lang.String getGroupCode4()
          Gets the group code4.
 java.lang.String getGroupCode5()
          Gets the group code5.
 java.lang.String getGroupCode6()
          Gets the group code6.
 java.lang.String getGroupCode7()
          Gets the group code7.
 java.lang.String getGroupCode8()
          Gets the group code8.
 java.lang.String getItemCode()
          Gets the item code.
 java.util.Date getLastInvoicingDate()
          Gets the last invocing date.
 java.util.Date getLastProcessingDate()
          Gets the last processing date.
 java.util.Date getLastUpdateDate()
          getLastUpdateDate method.
 java.lang.Integer getLength()
          Gets the length.
(package private)  java.lang.Integer getLinkAccount()
          Gets the link account.
 PaymentPlan getLinkedParentPlan()
          Gets the link parent plan.
 java.util.Date getNextBillingDate()
          Gets the next billing date.
 Charge getNextCharge()
          Returns charge that will be processed in the next processing of the plan
 PaymentOption getPaymentOption()
          Gets the payment option.
 java.lang.String getSellerCode()
          Gets the seller code.
 java.lang.String getStatus()
          Gets the status.
 java.lang.String getTaxCode()
          Gets the tax code.
 java.lang.String getType()
          Gets the type.
 java.lang.Integer getValue()
          Gets the value.
 int hashCode()
           
private  void incrementChargesListParameters(Charge charge)
          Recalculates all charge depended fields of a plan due to the new charge being added
 void remove(Charge charge)
          Removes the specified charge from the plan
 void removePosition(int position)
          Removes a single charge at the specified position
 void removeRange(java.lang.Integer position, java.lang.Integer length)
          Removes specified range of charges
 void replace(java.util.List<Charge> chargesList)
           
 void replaceRange(java.lang.Integer position, java.lang.Integer length)
          Replaced the specified range of regular charges with freezes Convenience method to "cancel" payments within a plan
 void setAdjustment(Adjustment adjustment)
          Sets the adjustment.
 void setAmount(java.lang.Integer amount)
          Set a value to amount.
 void setBillingCycleCode(java.lang.String billingCycleCode)
          Set a value to billingCycleCode.
(package private)  void setCharges(java.util.List<Charge> charges)
          Assigns charge list to the payment plan.
(package private)  void setCustomerAccount(CustomerAccount customerAccount)
          Sets the customer account.
(package private)  void setDeferredLength(java.lang.Integer deferredLength)
          Set a value to deferredLength.
(package private)  void setDeferredValue(java.lang.Integer deferredValue)
          Set a value to deferredValue.
 void setFirstBillingDate(java.util.Date firstBillingDate)
          Set a value to firstBillingDate.
 void setGroupCode1(java.lang.String groupCode1)
          Set a value to groupCode1.
 void setGroupCode2(java.lang.String groupCode2)
          Set a value to groupCode2.
 void setGroupCode3(java.lang.String groupCode3)
          Set a value to groupCode3.
 void setGroupCode4(java.lang.String groupCode4)
          Set a value to groupCode4.
 void setGroupCode5(java.lang.String groupCode5)
          Set a value to groupCode5.
 void setGroupCode6(java.lang.String groupCode6)
          Set a value to groupCode6.
 void setGroupCode7(java.lang.String groupCode7)
          Set a value to groupCode7.
 void setGroupCode8(java.lang.String groupCode8)
          Set a value to groupCode8.
 void setItemCode(java.lang.String itemCode)
          Set a value to itemCode.
(package private)  void setLastInvoicingDate(java.util.Date lastInvoicingDate)
          Set a value to lastInvoicingDate.
(package private)  void setLastProcessingDate(java.util.Date lastProcessingDate)
          Set a value to lastProcessingDate.
(package private)  void setLastUpdateDate(java.util.Date lastUpdateDate)
          setLastUpdateDate method.
(package private)  void setLength(java.lang.Integer length)
          Set a value to length.
(package private)  void setLinkAccount(java.lang.Integer linkAccount)
          Sets the link account.
(package private)  void setLinkedParentPlan(PaymentPlan linkedParentPlan)
          Sets the link parent plan.
(package private)  void setNextBillingDate(java.util.Date nextBillingDate)
          Sets the next billing date.
 void setPaymentOption(PaymentOption paymentOption)
          Sets the payment option.
 void setSellerCode(java.lang.String sellerCode)
          Set a value to sellerCode.
(package private)  void setStatus(java.lang.String status)
          Sets the status.
 void setTaxCode(java.lang.String taxCode)
          Set a value to taxCode.
 void setType(java.lang.String type)
          Set a value to type.
(package private)  void setValue(java.lang.Integer value)
          Set a value to value.
 java.lang.String type()
          Returns the type of the object instance using library's terminology In most cases it will match ClassName, but when a single class may represent multiple conceptual objects, the value will differ.
 
Methods inherited from class ibilling.client.ClientObject
getClientProperty, getCode, getCreateDate, getId, getMerchantAccountCode, getRefId, hasClientProperty, setClientProperty, setCode, setCreateDate, setId, setMerchantAccountCode, setRefId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
The Constant serialVersionUID.

See Also:
Constant Field Values

lastInvoicingDate

private java.util.Date lastInvoicingDate
the date when the invoice for this plan was last created


lastProcessingDate

private java.util.Date lastProcessingDate
the date when this plan was processed by Invoicing Service for the last time. The invoice may or may not have been created on the day (not created in case of deferment or freeze)


sellerCode

private java.lang.String sellerCode
optional code identifying the plan's seller in the external system


length

private java.lang.Integer length
current length of the payment plan (for perpetual and complimentary plans, the length will be derived from the forecasting period (see FAQ)


value

private java.lang.Integer value
length multiplied by amount


deferredLength

private java.lang.Integer deferredLength
current total length of deferred charges or freezes included in the plan


deferredValue

private java.lang.Integer deferredValue
deferredLength multiplied by amount


amount

private java.lang.Integer amount
Amount of a single payment represented by the plan


groupCode1

private java.lang.String groupCode1
optional group code for external systems


groupCode2

private java.lang.String groupCode2
optional group code for external systems


groupCode3

private java.lang.String groupCode3
optional group code for external systems


groupCode4

private java.lang.String groupCode4
optional group code for external systems


groupCode5

private java.lang.String groupCode5
optional group code for external systems


groupCode6

private java.lang.String groupCode6
optional group code for external systems


groupCode7

private java.lang.String groupCode7
optional group code for external systems


groupCode8

private java.lang.String groupCode8
optional group code for external systems


type

private java.lang.String type
type of the payment plan. See PaymentPlanType


firstBillingDate

private java.util.Date firstBillingDate
The date when first invoice is expected to be created


nextBillingDate

private java.util.Date nextBillingDate
The date when this plan will be processed next time. The invoice might not be created as a result of processing if the next charge is of type Deferred or Freeze


billingCycleCode

private java.lang.String billingCycleCode
code specified the billing cycle. Billing cycle defines time period of the payment recurrence (monthly, weekly, annually) and date when the charge is to happen (for weekly/biweekly - day of week and for others - day of the month)


itemCode

private java.lang.String itemCode
optional item code; tax code can be derived from it. requires preliminary setup via portal


taxCode

private java.lang.String taxCode
optional tax code defining tax amount. requires preliminary setup via portal


lastUpdateDate

private java.util.Date lastUpdateDate
the date when this plan was updated for the last time


status

private java.lang.String status
current status of the plan. See PaymentPlanStatus


linkAccount

private java.lang.Integer linkAccount
???


charges

private java.util.List<Charge> charges
list of the charges representing future payments


paymentOption

private PaymentOption paymentOption
reference to the payment option to be used to charge payments


customerAccount

private CustomerAccount customerAccount
customer account owning this plan


linkedParentPlan

private PaymentPlan linkedParentPlan
parent of this payment plan (current plan becomes active only after the parent plan is fully processed or canceled)


adjustment

private Adjustment adjustment
reference to adjustment object explaining changes made to the plan

Constructor Detail

PaymentPlan

PaymentPlan()
Instantiates a new payment plan.


PaymentPlan

PaymentPlan(java.util.Date createDate,
            java.util.Date lastInvocingDate,
            java.util.Date lastProcessingDate,
            java.lang.String code,
            java.lang.String sellerCode,
            java.lang.Integer length,
            java.lang.Integer value,
            java.lang.Integer deferredLength,
            java.lang.Integer deferredValue,
            java.lang.Integer amount,
            java.lang.String groupCode1,
            java.lang.String groupCode2,
            java.lang.String groupCode3,
            java.lang.String groupCode4,
            java.lang.String groupCode5,
            java.lang.String groupCode6,
            java.lang.String groupCode7,
            java.lang.String groupCode8,
            java.lang.Integer merchantAccountCode,
            java.lang.String type,
            java.util.Date firstBillingDate,
            java.lang.String billingCycleCode,
            java.lang.String itemCode,
            java.lang.String taxCode,
            PaymentOption paymentOption,
            CustomerAccount customerAccount,
            java.lang.Long id,
            java.util.Date lastUpdateDate,
            java.util.Date nextBillingDate,
            java.lang.String status)
Instantiates a new payment plan.

Parameters:
createDate - the create date
lastInvocingDate - the last invocing date
lastProcessingDate - the last processing date
code - the code
sellerCode - the seller code
length - the length
value - the value
deferredLength - the deferred length
deferredValue - the deferred value
amount - the amount
groupCode1 - the group code1
groupCode2 - the group code2
groupCode3 - the group code3
groupCode4 - the group code4
groupCode5 - the group code5
groupCode6 - the group code6
groupCode7 - the group code7
groupCode8 - the group code8
merchantAccountCode - the merchant account code
type - the type
firstBillingDate - the first billing date
billingCycleCode - the billing cycle code
itemCode - the item code
taxCode - the tax code
paymentOption - the payment option
customerAccount - the customer account
id - the id
lastUpdateDate - the last update date
nextBillingDate - the next billing date
status - the status
Method Detail

getLastInvoicingDate

public java.util.Date getLastInvoicingDate()
Gets the last invocing date.

Returns:
Returns the lastInvoicingDate

setLastInvoicingDate

void setLastInvoicingDate(java.util.Date lastInvoicingDate)
Set a value to lastInvoicingDate.

Parameters:
lastInvoicingDate - the last invoicing date

getLastProcessingDate

public java.util.Date getLastProcessingDate()
Gets the last processing date.

Returns:
Returns the lastProcessingDate

setLastProcessingDate

void setLastProcessingDate(java.util.Date lastProcessingDate)
Set a value to lastProcessingDate.

Parameters:
lastProcessingDate - the last processing date

getSellerCode

public java.lang.String getSellerCode()
Gets the seller code.

Returns:
Returns the sellerCode

setSellerCode

public void setSellerCode(java.lang.String sellerCode)
Set a value to sellerCode.

Parameters:
sellerCode - the seller code

getLength

public java.lang.Integer getLength()
Gets the length.

Returns:
Returns the length

setLength

void setLength(java.lang.Integer length)
Set a value to length.

Parameters:
length - the length

getValue

public java.lang.Integer getValue()
Gets the value.

Returns:
Returns the value

setValue

void setValue(java.lang.Integer value)
Set a value to value.

Parameters:
value - the value

getDeferredLength

public java.lang.Integer getDeferredLength()
Gets the deferred length.

Returns:
Returns the deferredLength

setDeferredLength

void setDeferredLength(java.lang.Integer deferredLength)
Set a value to deferredLength.

Parameters:
deferredLength - the deferred length

getDeferredValue

public java.lang.Integer getDeferredValue()
Gets the deferred value.

Returns:
Returns the deferredValue

setDeferredValue

void setDeferredValue(java.lang.Integer deferredValue)
Set a value to deferredValue.

Parameters:
deferredValue - the deferred value

getAmount

public java.lang.Integer getAmount()
Gets the amount.

Returns:
Returns the amount

setAmount

public void setAmount(java.lang.Integer amount)
Set a value to amount.

Parameters:
amount - the amount

getGroupCode1

public java.lang.String getGroupCode1()
Gets the group code1.

Returns:
Returns the groupCode1

setGroupCode1

public void setGroupCode1(java.lang.String groupCode1)
Set a value to groupCode1.

Parameters:
groupCode1 - the group code1

getGroupCode2

public java.lang.String getGroupCode2()
Gets the group code2.

Returns:
Returns the groupCode2

setGroupCode2

public void setGroupCode2(java.lang.String groupCode2)
Set a value to groupCode2.

Parameters:
groupCode2 - the group code2

getGroupCode3

public java.lang.String getGroupCode3()
Gets the group code3.

Returns:
Returns the groupCode3

setGroupCode3

public void setGroupCode3(java.lang.String groupCode3)
Set a value to groupCode3.

Parameters:
groupCode3 - the group code3

getGroupCode4

public java.lang.String getGroupCode4()
Gets the group code4.

Returns:
Returns the groupCode4

setGroupCode4

public void setGroupCode4(java.lang.String groupCode4)
Set a value to groupCode4.

Parameters:
groupCode4 - the group code4

getGroupCode5

public java.lang.String getGroupCode5()
Gets the group code5.

Returns:
Returns the groupCode5

setGroupCode5

public void setGroupCode5(java.lang.String groupCode5)
Set a value to groupCode5.

Parameters:
groupCode5 - the group code5

getGroupCode6

public java.lang.String getGroupCode6()
Gets the group code6.

Returns:
Returns the groupCode6

setGroupCode6

public void setGroupCode6(java.lang.String groupCode6)
Set a value to groupCode6.

Parameters:
groupCode6 - the group code6

getGroupCode7

public java.lang.String getGroupCode7()
Gets the group code7.

Returns:
Returns the groupCode7

setGroupCode7

public void setGroupCode7(java.lang.String groupCode7)
Set a value to groupCode7.

Parameters:
groupCode7 - the group code7

getGroupCode8

public java.lang.String getGroupCode8()
Gets the group code8.

Returns:
Returns the groupCode8

setGroupCode8

public void setGroupCode8(java.lang.String groupCode8)
Set a value to groupCode8.

Parameters:
groupCode8 - the group code8

getType

public java.lang.String getType()
Gets the type.

Returns:
Returns the type

setType

public void setType(java.lang.String type)
Set a value to type.

Parameters:
type - the type

getFirstBillingDate

public java.util.Date getFirstBillingDate()
Gets the first billing date.

Returns:
Returns the firstBillingDate

setFirstBillingDate

public void setFirstBillingDate(java.util.Date firstBillingDate)
Set a value to firstBillingDate.

Parameters:
firstBillingDate - the first billing date

createListCharges

java.util.List<Charge> createListCharges(int size)
Allocates list with charges to the specified size

Parameters:
size - the size
Returns:
the list< charge>

getBillingCycleCode

public java.lang.String getBillingCycleCode()
Gets the billing cycle code.

Returns:
Returns the billingCycleCode

setBillingCycleCode

public void setBillingCycleCode(java.lang.String billingCycleCode)
Set a value to billingCycleCode.

Parameters:
billingCycleCode - the billing cycle code

getItemCode

public java.lang.String getItemCode()
Gets the item code.

Returns:
Returns the itemCode

setItemCode

public void setItemCode(java.lang.String itemCode)
Set a value to itemCode.

Parameters:
itemCode - the item code

getTaxCode

public java.lang.String getTaxCode()
Gets the tax code.

Returns:
Returns the taxCode

setTaxCode

public void setTaxCode(java.lang.String taxCode)
Set a value to taxCode.

Parameters:
taxCode - the tax code

getChargesInternal

java.util.List<Charge> getChargesInternal()
Returns list of charges. Internal method. Should not be used by clients. Use getChanges instead. The actual charge list should never be exposed to the clients.

Returns:
the charges internal

getCharges

public java.util.List<Charge> getCharges()
Returns a copy of the list of charges within the plan

Returns:
copy of the list of charges

getStatus

public java.lang.String getStatus()
Gets the status.

Returns:
the status

setStatus

void setStatus(java.lang.String status)
Sets the status.

Parameters:
status - the new status

setCharges

void setCharges(java.util.List<Charge> charges)
Assigns charge list to the payment plan. For internal use only.

Parameters:
charges - the new charges

getPaymentOption

public PaymentOption getPaymentOption()
Gets the payment option.

Returns:
the payment option

setPaymentOption

public void setPaymentOption(PaymentOption paymentOption)
Sets the payment option.

Parameters:
paymentOption - the new payment option

getCustomerAccount

public CustomerAccount getCustomerAccount()
Gets the customer account.

Returns:
the customer account

setCustomerAccount

void setCustomerAccount(CustomerAccount customerAccount)
Sets the customer account.

Parameters:
customerAccount - the new customer account

getLinkedParentPlan

public PaymentPlan getLinkedParentPlan()
Gets the link parent plan.

Returns:
the link parent plan

setLinkedParentPlan

void setLinkedParentPlan(PaymentPlan linkedParentPlan)
Sets the link parent plan.

Parameters:
linkedParentPlan - the new link parent plan

createLinkedPaymentPlan

public PaymentPlan createLinkedPaymentPlan()
Creates and returns a new payment plan linked to this plan. The child plan will automatically inherit merchantAccountCode, billingCycleCode and customerAccount

Returns:
paymentPlan PaymentPlan

createLinkedPaymentPlanBasic

public PaymentPlan createLinkedPaymentPlanBasic(java.lang.String code,
                                                java.lang.String type,
                                                java.lang.Integer amount,
                                                java.lang.Integer length)
                                         throws ClientException
Creates linked payment plan with specified values. createLinkedPaymentPlan()

Parameters:
code - String
amount - Integer
length - Integer
type - the type
Returns:
paymentPlan PaymentPlan
Throws:
ClientException - the client exception

createLinkedPaymentPlanExtended

public PaymentPlan createLinkedPaymentPlanExtended(java.lang.String code,
                                                   java.lang.String type,
                                                   java.lang.Integer amount,
                                                   java.lang.Integer length,
                                                   PaymentOption paymentOption,
                                                   java.lang.String sellerCode,
                                                   java.lang.String itemCode,
                                                   java.lang.String taxCode,
                                                   java.lang.String groupCode1,
                                                   java.lang.String groupCode2,
                                                   java.lang.String groupCode3,
                                                   java.lang.String groupCode4,
                                                   java.lang.String groupCode5,
                                                   java.lang.String groupCode6,
                                                   java.lang.String groupCode7,
                                                   java.lang.String groupCode8)
                                            throws ClientException
Creates linked payment plan with specified values. createLinkedPaymentPlan()

Parameters:
code - the code
type - the type
amount - the amount
length - the length
paymentOption - the payment option
sellerCode - the seller code
itemCode - the item code
taxCode - the tax code
groupCode1 - the group code1
groupCode2 - the group code2
groupCode3 - the group code3
groupCode4 - the group code4
groupCode5 - the group code5
groupCode6 - the group code6
groupCode7 - the group code7
groupCode8 - the group code8
Returns:
the payment plan
Throws:
ClientException - the client exception

add

public void add(java.lang.Integer position,
                java.lang.Integer length,
                boolean isFreeze)
         throws ClientException
Adds specified number of charges at the specified position to this payment plan

Parameters:
position - the position where the first charge will be instered
length - the number of charges to add
isFreeze - if true, the charge is added as freeze; otherwise, it is added as a regular charge
Throws:
ClientException - in case invalid field values

removeRange

public void removeRange(java.lang.Integer position,
                        java.lang.Integer length)
Removes specified range of charges

Parameters:
position - position of the first charge to remove
length - the number of charges to remove after the first one

replaceRange

public void replaceRange(java.lang.Integer position,
                         java.lang.Integer length)
Replaced the specified range of regular charges with freezes Convenience method to "cancel" payments within a plan

Parameters:
position - position of the first charge to remove
length - the number of charges to remove after the first one

replace

public void replace(java.util.List<Charge> chargesList)

cancel

public void cancel()
Cancels the payment plan. Removes all charges, changes status and recalculates all value and length fields


removePosition

public void removePosition(int position)
Removes a single charge at the specified position

Parameters:
position - the position of the charge to be removed

remove

public void remove(Charge charge)
Removes the specified charge from the plan

Parameters:
charge - the charge to be removed

addCharge

void addCharge(Charge charge,
               java.lang.Integer position)
         throws ClientException
Adds the specified charge at the indicated position

Parameters:
charge - the charge to be added
position - the position at which the charge is to be added
Throws:
ClientException - when invalid field values are supplied

getNextCharge

public Charge getNextCharge()
Returns charge that will be processed in the next processing of the plan

Returns:
the next charge

type

public java.lang.String type()
Description copied from class: ClientObject
Returns the type of the object instance using library's terminology In most cases it will match ClassName, but when a single class may represent multiple conceptual objects, the value will differ.

Specified by:
type in class ClientObject
Returns:
the type of the client object

createAdjustment

public Adjustment createAdjustment()
Creates an Adjustment object and assigns it to the plan. The Adjustment inherits values of merchantAccountCode and customerAccount

Returns:
the newly created Adjustment

createAdjustmentExtended

public Adjustment createAdjustmentExtended(java.lang.String code,
                                           java.lang.String notes,
                                           java.lang.String adjustmentReasonCode)
Creates an Adjustment object with the specified values. createAdjustment()

Parameters:
code - the code
notes - the notes
adjustmentReasonCode - the adjustment reason code
Returns:
the adjustment

getLastUpdateDate

public java.util.Date getLastUpdateDate()
getLastUpdateDate method.

Returns:
the last update date

setLastUpdateDate

void setLastUpdateDate(java.util.Date lastUpdateDate)
setLastUpdateDate method.

Parameters:
lastUpdateDate - the last update date

getAdjustment

public Adjustment getAdjustment()
Gets the adjustment.

Returns:
the adjustment

setAdjustment

public void setAdjustment(Adjustment adjustment)
Sets the adjustment.

Parameters:
adjustment - the new adjustment

getNextBillingDate

public java.util.Date getNextBillingDate()
Gets the next billing date.

Returns:
the next billing date

setNextBillingDate

void setNextBillingDate(java.util.Date nextBillingDate)
Sets the next billing date.

Parameters:
nextBillingDate - the new next billing date

incrementChargesListParameters

private void incrementChargesListParameters(Charge charge)
Recalculates all charge depended fields of a plan due to the new charge being added

Parameters:
charge - the charge

decrementChargesListParameters

private void decrementChargesListParameters(Charge charge)
Recalculates all charge depended fields of a plan due to the existing charge being removed

Parameters:
charge - the charge

getLinkAccount

java.lang.Integer getLinkAccount()
Gets the link account.

Returns:
the link account

setLinkAccount

void setLinkAccount(java.lang.Integer linkAccount)
Sets the link account.

Parameters:
linkAccount - the new link account

equals

public boolean equals(java.lang.Object anotherObject)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object