Class PaymentUtil

java.lang.Object
org.adempiere.util.PaymentUtil

public class PaymentUtil extends Object
Helper methods for payment processor
Author:
Elaine
  • Constructor Details

    • PaymentUtil

      public PaymentUtil()
  • Method Details

    • getBankAccounts

      public static MBPBankAccount[] getBankAccounts(MBPartner bpartner, String creditCardNo, int C_PaymentProcessor_ID)
      Get business partner bank account by credit card number and payment processor id.
      Parameters:
      bpartner -
      creditCardNo -
      C_PaymentProcessor_ID -
      Returns:
      list of matching MBPBankAccount records
    • encrpytCreditCard

      public static String encrpytCreditCard(String value)
      Replace the front part of credit card number with 0, keeping the last 4 digit.
      Parameters:
      value - credit card number
      Returns:
      partially mask credit card number
    • encrpytCvv

      public static String encrpytCvv(String creditCardVV)
      Replace credit card cvv with 0
      Parameters:
      creditCardVV -
      Returns:
      string fill with just 0
    • isNumeric

      public static boolean isNumeric(String str)
      Parameters:
      str -
      Returns:
      true if str is a number
    • getPayAmtInCents

      public static int getPayAmtInCents(BigDecimal payAmt)
      Convert payment amount from dollar to cents (i.e x100)
      Parameters:
      payAmt -
      Returns:
      amount in cents (truncated to int)
    • getCreditCardExp

      public static String getCreditCardExp(int creditCardExpMM, int creditCardExpYY, String delimiter)
      Build credit card expire string
      Parameters:
      creditCardExpMM - Expire month
      creditCardExpYY - Expire year
      delimiter - delimiter character between month and year
      Returns:
      credit card expire string (for e.g 10/26)