Package org.compiere.model
Class MPaymentTransaction
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_C_PaymentTransaction
org.compiere.model.MPaymentTransaction
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_C_PaymentTransaction
,I_Persistent
,PaymentInterface
,ProcessCall
,Evaluatee
public class MPaymentTransaction
extends X_C_PaymentTransaction
implements ProcessCall, PaymentInterface
Online payment transaction
- Author:
- Elaine
- See Also:
-
Field Summary
Fields inherited from class org.compiere.model.X_C_PaymentTransaction
CREDITCARDTYPE_AD_Reference_ID, CREDITCARDTYPE_Amex, CREDITCARDTYPE_ATM, CREDITCARDTYPE_Diners, CREDITCARDTYPE_Discover, CREDITCARDTYPE_MasterCard, CREDITCARDTYPE_PurchaseCard, CREDITCARDTYPE_Visa, R_AVSADDR_AD_Reference_ID, R_AVSADDR_Match, R_AVSADDR_NoMatch, R_AVSADDR_Unavailable, R_AVSZIP_AD_Reference_ID, R_AVSZIP_Match, R_AVSZIP_NoMatch, R_AVSZIP_Unavailable, TENDERTYPE_Account, TENDERTYPE_AD_Reference_ID, TENDERTYPE_Cash, TENDERTYPE_Check, TENDERTYPE_CreditCard, TENDERTYPE_DirectDebit, TENDERTYPE_DirectDeposit, TRXTYPE_AD_Reference_ID, TRXTYPE_Authorization, TRXTYPE_CreditPayment, TRXTYPE_DelayedCapture, TRXTYPE_Sales, TRXTYPE_VoiceAuthorization, TRXTYPE_Void
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, p_ctx, p_info, UUID_NEW_RECORD, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
Fields inherited from interface org.compiere.model.I_C_PaymentTransaction
accessLevel, COLUMNNAME_A_City, COLUMNNAME_A_Country, COLUMNNAME_A_EMail, COLUMNNAME_A_Ident_DL, COLUMNNAME_A_Ident_SSN, COLUMNNAME_A_Name, COLUMNNAME_A_State, COLUMNNAME_A_Street, COLUMNNAME_A_Zip, COLUMNNAME_AccountNo, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_OrgTrx_ID, COLUMNNAME_C_Activity_ID, COLUMNNAME_C_BankAccount_ID, COLUMNNAME_C_BP_BankAccount_ID, COLUMNNAME_C_BPartner_ID, COLUMNNAME_C_Campaign_ID, COLUMNNAME_C_CashBook_ID, COLUMNNAME_C_Charge_ID, COLUMNNAME_C_ConversionType_ID, COLUMNNAME_C_Currency_ID, COLUMNNAME_C_Invoice_ID, COLUMNNAME_C_Order_ID, COLUMNNAME_C_Payment_ID, COLUMNNAME_C_PaymentBatch_ID, COLUMNNAME_C_PaymentProcessor_ID, COLUMNNAME_C_PaymentTransaction_ID, COLUMNNAME_C_PaymentTransaction_UU, COLUMNNAME_C_POSTenderType_ID, COLUMNNAME_C_Project_ID, COLUMNNAME_CheckNo, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_CreditCardExpMM, COLUMNNAME_CreditCardExpYY, COLUMNNAME_CreditCardNumber, COLUMNNAME_CreditCardType, COLUMNNAME_CreditCardVV, COLUMNNAME_CustomerAddressID, COLUMNNAME_CustomerPaymentProfileID, COLUMNNAME_CustomerProfileID, COLUMNNAME_DateTrx, COLUMNNAME_Description, COLUMNNAME_IBAN, COLUMNNAME_IsActive, COLUMNNAME_IsApproved, COLUMNNAME_IsDelayedCapture, COLUMNNAME_IsOnline, COLUMNNAME_IsReceipt, COLUMNNAME_IsSelfService, COLUMNNAME_IsVoided, COLUMNNAME_Micr, COLUMNNAME_Orig_TrxID, COLUMNNAME_PayAmt, COLUMNNAME_PONum, COLUMNNAME_Processed, COLUMNNAME_R_AuthCode, COLUMNNAME_R_AvsAddr, COLUMNNAME_R_AvsZip, COLUMNNAME_R_CVV2Match, COLUMNNAME_R_Info, COLUMNNAME_R_PnRef, COLUMNNAME_R_RespMsg, COLUMNNAME_R_Result, COLUMNNAME_R_VoidMsg, COLUMNNAME_Ref_PaymentTransaction_ID, COLUMNNAME_RoutingNo, COLUMNNAME_SwiftCode, COLUMNNAME_TaxAmt, COLUMNNAME_TenderType, COLUMNNAME_TrxType, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_User1_ID, COLUMNNAME_User2_ID, COLUMNNAME_VoiceAuthCode, COLUMNNAME_VoidIt, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMPaymentTransaction
(Properties ctx, int C_PaymentTransaction_ID, String trxName) MPaymentTransaction
(Properties ctx, String C_PaymentTransaction_UU, String trxName) UUID based ConstructorMPaymentTransaction
(Properties ctx, ResultSet rs, String trxName) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
beforeSave
(boolean newRecord) Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.static MPaymentTransaction
copyFrom
(MPaymentTransaction from, Timestamp dateTrx, String trxType, String orig_TrxID, String trxName) Create new payment transaction from existing payment transaction recordcreatePayment
(String trxName) Create payment using details from this recordboolean
delayCaptureOnlineAuthorizationPaymentTransaction
(int C_Invoice_ID) Perform online delay capture (TRXTYPE_DelayedCapture) of authorized (TRXTYPE_Authorization) payment.static int[]
getAuthorizationPaymentTransactionIDs
(int[] orderIDList, int C_Invoice_ID, String trxName) Get authorized credit card payment transactions that are pending delay capturestatic int[]
getAuthorizationPaymentTransactionIDs
(int C_Order_ID, int C_Invoice_ID, String trxName) Get authorized credit card payment transactions that are pending delay capturegetCreditCardName
(String CreditCardType) getPO()
Get Persistent Objectboolean
Execute online payment processingvoid
setAmount
(int C_Currency_ID, BigDecimal payAmt) Set payment amount and currencyboolean
setCreditCard
(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, int creditCardExpMM, int creditCardExpYY) Set credit card detailsboolean
setCreditCard
(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, String creditCardExp) Set credit card detailsvoid
setErrorMessage
(String errorMessage) boolean
Find and set bank account payment processor (C_BankAccount_Processor)boolean
setPaymentProcessor
(String tender, String CCType, int C_PaymentProcessor_ID) Find and set bank account payment processor (C_BankAccount_Processor)void
setProcessUI
(IProcessUI processUI) Set process UI interfaceboolean
startProcess
(Properties ctx, ProcessInfo pi, Trx trx) Process Online Payment.toString()
String Representationboolean
Void online authorization (TRXTYPE_Authorization) of paymentMethods inherited from class org.compiere.model.X_C_PaymentTransaction
get_AccessLevel, getA_City, getA_Country, getA_EMail, getA_Ident_DL, getA_Ident_SSN, getA_Name, getA_State, getA_Street, getA_Zip, getAccountNo, getAD_OrgTrx_ID, getC_Activity, getC_Activity_ID, getC_BankAccount, getC_BankAccount_ID, getC_BP_BankAccount, getC_BP_BankAccount_ID, getC_BPartner, getC_BPartner_ID, getC_Campaign, getC_Campaign_ID, getC_CashBook, getC_CashBook_ID, getC_Charge, getC_Charge_ID, getC_ConversionType, getC_ConversionType_ID, getC_Currency, getC_Currency_ID, getC_Invoice, getC_Invoice_ID, getC_Order, getC_Order_ID, getC_Payment, getC_Payment_ID, getC_PaymentBatch, getC_PaymentBatch_ID, getC_PaymentProcessor, getC_PaymentProcessor_ID, getC_PaymentTransaction_ID, getC_PaymentTransaction_UU, getC_POSTenderType, getC_POSTenderType_ID, getC_Project, getC_Project_ID, getCheckNo, getCreditCardExpMM, getCreditCardExpYY, getCreditCardNumber, getCreditCardType, getCreditCardVV, getCustomerAddressID, getCustomerPaymentProfileID, getCustomerProfileID, getDateTrx, getDescription, getIBAN, getMicr, getOrig_TrxID, getPayAmt, getPONum, getR_AuthCode, getR_AvsAddr, getR_AvsZip, getR_Info, getR_PnRef, getR_RespMsg, getR_Result, getR_VoidMsg, getRef_PaymentTransaction, getRef_PaymentTransaction_ID, getRoutingNo, getSwiftCode, getTaxAmt, getTenderType, getTrxType, getUser1, getUser1_ID, getUser2, getUser2_ID, getVoiceAuthCode, getVoidIt, initPO, isApproved, isDelayedCapture, isOnline, isProcessed, isR_CVV2Match, isReceipt, isSelfService, isVoided, setA_City, setA_Country, setA_EMail, setA_Ident_DL, setA_Ident_SSN, setA_Name, setA_State, setA_Street, setA_Zip, setAccountNo, setAD_OrgTrx_ID, setC_Activity_ID, setC_BankAccount_ID, setC_BP_BankAccount_ID, setC_BPartner_ID, setC_Campaign_ID, setC_CashBook_ID, setC_Charge_ID, setC_ConversionType_ID, setC_Currency_ID, setC_Invoice_ID, setC_Order_ID, setC_Payment_ID, setC_PaymentBatch_ID, setC_PaymentProcessor_ID, setC_PaymentTransaction_ID, setC_PaymentTransaction_UU, setC_POSTenderType_ID, setC_Project_ID, setCheckNo, setCreditCardExpMM, setCreditCardExpYY, setCreditCardNumber, setCreditCardType, setCreditCardVV, setCustomerAddressID, setCustomerPaymentProfileID, setCustomerProfileID, setDateTrx, setDescription, setIBAN, setIsApproved, setIsDelayedCapture, setIsOnline, setIsReceipt, setIsSelfService, setIsVoided, setMicr, setOrig_TrxID, setPayAmt, setPONum, setProcessed, setR_AuthCode, setR_AvsAddr, setR_AvsZip, setR_CVV2Match, setR_Info, setR_PnRef, setR_RespMsg, setR_Result, setR_VoidMsg, setRef_PaymentTransaction_ID, setRoutingNo, setSwiftCode, setTaxAmt, setTenderType, setTrxType, setUser1_ID, setUser2_ID, setVoiceAuthCode, setVoidIt
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, buildInsertSQL, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, toInsertSQL, unlock, update_Tree, validForeignKeys
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface org.compiere.model.I_C_PaymentTransaction
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
Methods inherited from interface org.compiere.model.I_Persistent
save
Methods inherited from interface org.compiere.model.PaymentInterface
getA_City, getA_Country, getA_EMail, getA_Ident_DL, getA_Ident_SSN, getA_Name, getA_State, getA_Street, getA_Zip, getAccountNo, getC_BankAccount, getC_BankAccount_ID, getC_BP_BankAccount, getC_BP_BankAccount_ID, getC_BPartner, getC_BPartner_ID, getC_ConversionType, getC_ConversionType_ID, getC_Currency, getC_Currency_ID, getC_Invoice, getC_Invoice_ID, getC_Order, getC_Order_ID, getC_PaymentProcessor, getC_PaymentProcessor_ID, getC_POSTenderType, getC_POSTenderType_ID, getCheckNo, getCreditCardExpMM, getCreditCardExpYY, getCreditCardNumber, getCreditCardType, getCreditCardVV, getCustomerAddressID, getCustomerPaymentProfileID, getCustomerProfileID, getDateTrx, getDescription, getMicr, getOrig_TrxID, getPayAmt, getPONum, getR_AuthCode, getR_AvsAddr, getR_AvsZip, getR_Info, getR_PnRef, getR_RespMsg, getR_Result, getR_VoidMsg, getRoutingNo, getTaxAmt, getTenderType, getTrxType, getVoiceAuthCode, isApproved, isDelayedCapture, isOnline, isProcessed, isR_CVV2Match, isReceipt, isSelfService, isVoided, setA_City, setA_Country, setA_EMail, setA_Ident_DL, setA_Ident_SSN, setA_Name, setA_State, setA_Street, setA_Zip, setAccountNo, setC_BankAccount_ID, setC_BP_BankAccount_ID, setC_BPartner_ID, setC_ConversionType_ID, setC_Currency_ID, setC_Invoice_ID, setC_Order_ID, setC_PaymentProcessor_ID, setC_POSTenderType_ID, setCheckNo, setCreditCardExpMM, setCreditCardExpYY, setCreditCardNumber, setCreditCardType, setCreditCardVV, setCustomerAddressID, setCustomerPaymentProfileID, setCustomerProfileID, setDateTrx, setDescription, setIsApproved, setIsDelayedCapture, setIsOnline, setIsReceipt, setIsSelfService, setIsVoided, setMicr, setOrig_TrxID, setPayAmt, setPONum, setProcessed, setR_AuthCode, setR_AvsAddr, setR_AvsZip, setR_CVV2Match, setR_Info, setR_PnRef, setR_RespMsg, setR_Result, setR_VoidMsg, setRoutingNo, setTaxAmt, setTenderType, setTrxType, setVoiceAuthCode
-
Constructor Details
-
MPaymentTransaction
UUID based Constructor- Parameters:
ctx
- ContextC_PaymentTransaction_UU
- UUID keytrxName
- Transaction
-
MPaymentTransaction
- Parameters:
ctx
-C_PaymentTransaction_ID
-trxName
-
-
MPaymentTransaction
- Parameters:
ctx
-rs
-trxName
-
-
-
Method Details
-
beforeSave
protected boolean beforeSave(boolean newRecord) Description copied from class:PO
Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.- Overrides:
beforeSave
in classPO
- Parameters:
newRecord
- true if it is a new record- Returns:
- true if record can be saved
-
setAmount
Set payment amount and currency- Parameters:
C_Currency_ID
-payAmt
-
-
setCreditCard
public boolean setCreditCard(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, int creditCardExpMM, int creditCardExpYY) Set credit card details- Parameters:
TrxType
-creditCardType
-creditCardNumber
-creditCardVV
-creditCardExpMM
-creditCardExpYY
-- Returns:
- true if credit detail is valid
-
setCreditCard
public boolean setCreditCard(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, String creditCardExp) Set credit card details- Parameters:
TrxType
-creditCardType
-creditCardNumber
-creditCardVV
-creditCardExp
-- Returns:
- true if credit card detail is valid
-
setPaymentProcessor
public boolean setPaymentProcessor()Find and set bank account payment processor (C_BankAccount_Processor)- Returns:
- true if success
-
setPaymentProcessor
Find and set bank account payment processor (C_BankAccount_Processor)- Parameters:
tender
-CCType
-C_PaymentProcessor_ID
-- Returns:
- true if success
-
processOnline
public boolean processOnline()Execute online payment processing- Returns:
- true if approved
-
voidOnlineAuthorizationPaymentTransaction
public boolean voidOnlineAuthorizationPaymentTransaction()Void online authorization (TRXTYPE_Authorization) of payment- Returns:
- true if success
-
delayCaptureOnlineAuthorizationPaymentTransaction
public boolean delayCaptureOnlineAuthorizationPaymentTransaction(int C_Invoice_ID) Perform online delay capture (TRXTYPE_DelayedCapture) of authorized (TRXTYPE_Authorization) payment.- Parameters:
C_Invoice_ID
-- Returns:
- true if success
-
getCreditCardName
- Returns:
- credit card type name (master card, visa, etc)
-
getCreditCardName
- Parameters:
CreditCardType
-- Returns:
- name of credit card type
-
setErrorMessage
- Parameters:
errorMessage
-
-
getErrorMessage
- Returns:
- error message
-
createPayment
Create payment using details from this record- Parameters:
trxName
-- Returns:
- MPayment
-
startProcess
Process Online Payment. CallprocessOnline()
and save changes make to this record.- Specified by:
startProcess
in interfaceProcessCall
- Parameters:
ctx
- Contextpi
- Process Infotrx
- transaction- Returns:
- true if success
-
setProcessUI
Description copied from interface:ProcessCall
Set process UI interface- Specified by:
setProcessUI
in interfaceProcessCall
-
getPO
Description copied from interface:PaymentInterface
Get Persistent Object- Specified by:
getPO
in interfacePaymentInterface
- Returns:
- PO
-
copyFrom
public static MPaymentTransaction copyFrom(MPaymentTransaction from, Timestamp dateTrx, String trxType, String orig_TrxID, String trxName) Create new payment transaction from existing payment transaction record- Parameters:
from
- source payment transaction to copy fromdateTrx
-trxType
-orig_TrxID
-trxName
-- Returns:
- MPaymentTransaction created
-
getAuthorizationPaymentTransactionIDs
public static int[] getAuthorizationPaymentTransactionIDs(int C_Order_ID, int C_Invoice_ID, String trxName) Get authorized credit card payment transactions that are pending delay capture- Parameters:
C_Order_ID
-C_Invoice_ID
-trxName
-- Returns:
- array of C_PaymentTransaction_ID
-
getAuthorizationPaymentTransactionIDs
public static int[] getAuthorizationPaymentTransactionIDs(int[] orderIDList, int C_Invoice_ID, String trxName) Get authorized credit card payment transactions that are pending delay capture- Parameters:
orderIDList
-C_Invoice_ID
-trxName
-- Returns:
- array of C_PaymentTransaction_ID
-
toString
String Representation- Overrides:
toString
in classX_C_PaymentTransaction
- Returns:
- info
-