Package org.adempiere.util
Class PaymentUtil
java.lang.Object
org.adempiere.util.PaymentUtil
Helper methods for payment processor
- Author:
- Elaine
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
encrpytCreditCard
(String value) Replace the front part of credit card number with 0, keeping the last 4 digit.static String
encrpytCvv
(String creditCardVV) Replace credit card cvv with 0static MBPBankAccount[]
getBankAccounts
(MBPartner bpartner, String creditCardNo, int C_PaymentProcessor_ID) Get business partner bank account by credit card number and payment processor id.static String
getCreditCardExp
(int creditCardExpMM, int creditCardExpYY, String delimiter) Build credit card expire stringstatic int
getPayAmtInCents
(BigDecimal payAmt) Convert payment amount from dollar to cents (i.e x100)static boolean
-
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
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
Replace credit card cvv with 0- Parameters:
creditCardVV
-- Returns:
- string fill with just 0
-
isNumeric
- Parameters:
str
-- Returns:
- true if str is a number
-
getPayAmtInCents
Convert payment amount from dollar to cents (i.e x100)- Parameters:
payAmt
-- Returns:
- amount in cents (truncated to int)
-
getCreditCardExp
Build credit card expire string- Parameters:
creditCardExpMM
- Expire monthcreditCardExpYY
- Expire yeardelimiter
- delimiter character between month and year- Returns:
- credit card expire string (for e.g 10/26)
-