ibilling.client
Class Charge

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

public class Charge
extends ClientObject

Represents a future invoice within a PaymentPlan. Each time when billing is processed (Invoicing processing is executed) a charge is processed. Fixed and Perpetual charges are converted into invoices. Complimentary charges are converted into invoices that are immediately balanced out with allowances. Freezes and Deferment produce no invoices.

Since:
1.0
See Also:
Serialized Form

Field Summary
private  java.lang.Integer index
          Sequential number of the charge within PaymentPlan.
private  java.lang.Boolean isPrepaid
          If true, payment was taken against this charge.
private  PaymentPlan paymentPlan
          Reference to the PaymentPlan holding the charges.
private  java.util.Date processedDate
          Date when the charge was processed by the invoicing process.
private static long serialVersionUID
          The Constant serialVersionUID.
private  java.lang.String type
          TYpe of charge.
 
Constructor Summary
Charge()
          Instantiates a new charge.
Charge(java.util.Date createDate, java.util.Date processedDate, java.lang.Boolean isPrepaid, java.lang.String type, java.lang.Integer merchantAccountCode, PaymentPlan paymentPlan, java.lang.String code, java.lang.Long id)
          Instantiates a new charge.
 
Method Summary
 boolean equals(java.lang.Object anotherObject)
           
 java.util.Date getBillingDate()
          Returns the date when this charge will be processed if no changes are made to the PaymentPlan or it's BillingCycle.
(package private)  java.lang.Integer getIndex()
          Gets the index of the charge.
 java.lang.Boolean getIsPrepaid()
          Gets the is prepaid.
 Charge getNextCharge()
          Returns charge that follows this charge in the billing sequence.
 PaymentPlan getPaymentPlan()
          Gets the payment plan.
 java.lang.Integer getPosition()
          Returns sequential position of this charge within the PaymentPlan.
 Charge getPrevCharge()
          Returns charge that precedes this charge in the billing sequence.
 java.util.Date getProcessedDate()
          Gets the processed date.
 java.lang.String getType()
          Gets the type.
 int hashCode()
           
(package private)  void setIndex(java.lang.Integer index)
          Assigns index to the charge.
 void setIsPrepaid(java.lang.Boolean isPrepaid)
          Set a value to isPrepaid.
 void setPaymentPlan(PaymentPlan paymentPlan)
          Sets the payment plan.
(package private)  void setProcessedDate(java.util.Date processedDate)
          Set a value to processedDate.
(package private)  void setType(java.lang.String type)
          Set a value to type.
 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

processedDate

private java.util.Date processedDate
Date when the charge was processed by the invoicing process.


isPrepaid

private java.lang.Boolean isPrepaid
If true, payment was taken against this charge. This doesn't guarantee that the invoice created from this charge will be automatically paid


type

private java.lang.String type
TYpe of charge.


index

private java.lang.Integer index
Sequential number of the charge within PaymentPlan. 0 indicates that the charge will be processed in the next billing process, 1 - the one after the next and so on


paymentPlan

private PaymentPlan paymentPlan
Reference to the PaymentPlan holding the charges.

Constructor Detail

Charge

Charge()
Instantiates a new charge.


Charge

Charge(java.util.Date createDate,
       java.util.Date processedDate,
       java.lang.Boolean isPrepaid,
       java.lang.String type,
       java.lang.Integer merchantAccountCode,
       PaymentPlan paymentPlan,
       java.lang.String code,
       java.lang.Long id)
Instantiates a new charge.

Parameters:
createDate - the create date
processedDate - the processed date
isPrepaid - the is prepaid
type - the type
merchantAccountCode - the merchant account code
paymentPlan - the payment plan
code - the code
id - the id
Method Detail

getProcessedDate

public java.util.Date getProcessedDate()
Gets the processed date.

Returns:
Returns the processedDate

setProcessedDate

void setProcessedDate(java.util.Date processedDate)
Set a value to processedDate.

Parameters:
processedDate - the processed date

getIsPrepaid

public java.lang.Boolean getIsPrepaid()
Gets the is prepaid.

Returns:
Returns the isPrepaid

setIsPrepaid

public void setIsPrepaid(java.lang.Boolean isPrepaid)
Set a value to isPrepaid.

Parameters:
isPrepaid - the is prepaid

getType

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

Returns:
Returns the type

setType

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

Parameters:
type - the type

getBillingDate

public java.util.Date getBillingDate()
Returns the date when this charge will be processed if no changes are made to the PaymentPlan or it's BillingCycle.

Returns:
Returns the billingDate

getPaymentPlan

public PaymentPlan getPaymentPlan()
Gets the payment plan.

Returns:
the payment plan

setPaymentPlan

public void setPaymentPlan(PaymentPlan paymentPlan)
Sets the payment plan.

Parameters:
paymentPlan - the new payment plan

getNextCharge

public Charge getNextCharge()
Returns charge that follows this charge in the billing sequence.

Returns:
the next charge

getPrevCharge

public Charge getPrevCharge()
Returns charge that precedes this charge in the billing sequence.

Returns:
the prev charge

getPosition

public java.lang.Integer getPosition()
Returns sequential position of this charge within the PaymentPlan. Unlike index, automatically adjusts its value when changes to payment plan are made

Returns:
the position

getIndex

java.lang.Integer getIndex()
Gets the index of the charge. The values is not dynamically adjusted and represents server's vision of the charge

Returns:
the index

setIndex

void setIndex(java.lang.Integer index)
Assigns index to the charge. For internal use only.

Parameters:
index - the new index

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

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