paypalnvp.util
Class FormatFields

java.lang.Object
  extended by paypalnvp.util.FormatFields
All Implemented Interfaces:
java.io.Serializable

public final class FormatFields
extends java.lang.Object
implements java.io.Serializable

Converts fields to the paypal required format.

See Also:
Serialized Form

Constructor Summary
FormatFields()
           
 
Method Summary
static java.lang.String getAmountField(float amount)
          Returns formated amount.
static java.lang.String getAmountField(int amount)
          Returns formated amount.
static java.lang.String getCardDateField(java.util.Date date)
          This method is used inside main classes, if any classes needs date argument you can use Java Date.
static java.lang.String getDateTimeField(java.util.Date dateTime)
          This method is used inside main classes, if any classes needs date argument you can use Java Date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatFields

public FormatFields()
Method Detail

getDateTimeField

public static java.lang.String getDateTimeField(java.util.Date dateTime)
This method is used inside main classes, if any classes needs date argument you can use Java Date. In short - you will not need to use this method. Paypal needs Coordinated Universal Time (UTC/GMT), using ISO 8601 format, and of type ns:dateTime for Date/Time formats An example date/time stamp is 2006-08-24T05:38:48Z

Parameters:
dateTime -
Returns:
Coordinated Universal Time (UTC/GMT), using ISO 8601 format, and of type ns:dateTime

getCardDateField

public static java.lang.String getCardDateField(java.util.Date date)
This method is used inside main classes, if any classes needs date argument you can use Java Date. In short - you will not need to use this method. Paypal cards needs date in MMYYYY format

Parameters:
date -
Returns:
String in MMYYYY format

getAmountField

public static java.lang.String getAmountField(float amount)
Returns formated amount. For example 24.7 will become "24.70". Returned amount can be used for setting amounts in PayPal requests.

Parameters:
amount -
Returns:

getAmountField

public static java.lang.String getAmountField(int amount)
Returns formated amount. For example 24.7 will become "24.70". Returned amount can be used for setting amounts in PayPal requests.

Parameters:
amount -
Returns: