org.gitana.platform.services.billing

## Class PaymentMethodValidationUtil

- java.lang.Object
- - org.gitana.platform.services.billing.PaymentMethodValidationUtil

    public class PaymentMethodValidationUtil
    extends Object

Author:
  uzi

### Field Summary

Fields
`static int` `AMERICAN_EXPRESS`
`static int` `DINERS_CLUB`
`static int` `DISCOVER`
`static int` `EN_ROUTE`
`static int` `INVALID`
`static int` `MASTERCARD`
`static int` `VISA`

### Constructor Summary

Constructors
Constructor and Description
`PaymentMethodValidationUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static int` `getCreditCardTypeId(String number)` Determines the type of credit card.
`static String` `getCreditCardTypeName(int type)` Gets the name of the type of credit card.
`static boolean` `isExpired(int month, int year)`
`static boolean` `isValidCreditCardNumber(String number)` Determines whether the given credit card number is valid.
`static PaymentMethodValidation` `validate(String holderName, String number, int month, int year)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### INVALID

    public static final int INVALID

See Also:
  Constant Field Values

#### VISA

    public static final int VISA

See Also:
  Constant Field Values

#### MASTERCARD

    public static final int MASTERCARD

See Also:
  Constant Field Values

#### AMERICAN_EXPRESS

    public static final int AMERICAN_EXPRESS

See Also:
  Constant Field Values

#### EN_ROUTE

    public static final int EN_ROUTE

See Also:
  Constant Field Values

#### DINERS_CLUB

    public static final int DINERS_CLUB

See Also:
  Constant Field Values

#### DISCOVER

    public static final int DISCOVER

See Also:
  Constant Field Values

### Constructor Detail

#### PaymentMethodValidationUtil

    public PaymentMethodValidationUtil()

### Method Detail

#### isValidCreditCardNumber

    public static boolean isValidCreditCardNumber(String number)

Determines whether the given credit card number is valid.

Parameters:
  `number` -
Returns:

#### getCreditCardTypeId

    public static int getCreditCardTypeId(String number)

Determines the type of credit card.

Parameters:
  `number` -
Returns:

#### getCreditCardTypeName

    public static String getCreditCardTypeName(int type)

Gets the name of the type of credit card.

Parameters:
  `type` -
Returns:

#### isExpired

    public static boolean isExpired(int month,
                                    int year)

#### validate

    public static PaymentMethodValidation validate(String holderName,
                                                   String number,
                                                   int month,
                                                   int year)