IDEMPIERE-60 - Bizidium must not save credit card number
This commit is contained in:
parent
a5adac4806
commit
3607328a7b
|
@ -534,6 +534,9 @@ public final class MPayment extends X_C_Payment
|
|||
|
||||
if (approved)
|
||||
{
|
||||
setCreditCardNumber(PaymentUtil.encrpytCreditCard(getCreditCardNumber()));
|
||||
setCreditCardVV(PaymentUtil.encrpytCvv(getCreditCardVV()));
|
||||
|
||||
setDateTrx(new Timestamp(System.currentTimeMillis()));
|
||||
setDateAcct(new Timestamp(System.currentTimeMillis()));
|
||||
setProcessed(true); // prevent editing of payment details once approved
|
||||
|
@ -731,6 +734,23 @@ public final class MPayment extends X_C_Payment
|
|||
}
|
||||
}
|
||||
|
||||
if (isProcessed())
|
||||
{
|
||||
if (getCreditCardNumber() != null)
|
||||
{
|
||||
String encrpytedCCNo = PaymentUtil.encrpytCreditCard(getCreditCardNumber());
|
||||
if (!encrpytedCCNo.equals(getCreditCardNumber()))
|
||||
setCreditCardNumber(encrpytedCCNo);
|
||||
}
|
||||
|
||||
if (getCreditCardVV() != null)
|
||||
{
|
||||
String encrpytedCvv = PaymentUtil.encrpytCvv(getCreditCardVV());
|
||||
if (!encrpytedCvv.equals(getCreditCardVV()))
|
||||
setCreditCardVV(encrpytedCvv);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} // beforeSave
|
||||
|
||||
|
@ -2852,13 +2872,6 @@ public final class MPayment extends X_C_Payment
|
|||
}
|
||||
}
|
||||
|
||||
// clear out the cc data when a Void happens since at that point we won't need the card information any longer
|
||||
if (getTenderType().equals(TENDERTYPE_CreditCard))
|
||||
{
|
||||
setCreditCardNumber(PaymentUtil.encrpytCreditCard(getCreditCardNumber()));
|
||||
setCreditCardVV(PaymentUtil.encrpytCvv(getCreditCardVV()));
|
||||
}
|
||||
|
||||
if (getC_Invoice_ID() != 0)
|
||||
{
|
||||
MInvoice inv = new MInvoice(getCtx(), getC_Invoice_ID(), get_TrxName());
|
||||
|
|
|
@ -75,7 +75,12 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
|
|||
protected boolean beforeSave(boolean newRecord)
|
||||
{
|
||||
if (getCreditCardVV() != null)
|
||||
setCreditCardVV(PaymentUtil.encrpytCvv(getCreditCardVV()));
|
||||
{
|
||||
String encrpytedCvv = PaymentUtil.encrpytCvv(getCreditCardVV());
|
||||
if (!encrpytedCvv.equals(getCreditCardVV()))
|
||||
setCreditCardVV(encrpytedCvv);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -227,6 +232,8 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
|
|||
// } else {
|
||||
// Process if validation succeeds
|
||||
approved = pp.processCC();
|
||||
setCreditCardNumber(PaymentUtil.encrpytCreditCard(getCreditCardNumber()));
|
||||
setCreditCardVV(PaymentUtil.encrpytCvv(getCreditCardVV()));
|
||||
setIsApproved(approved);
|
||||
|
||||
if(getTrxType().equals(TRXTYPE_Void) || getTrxType().equals(TRXTYPE_CreditPayment))
|
||||
|
@ -319,8 +326,6 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
|
|||
m_mPaymentTransaction.setIsDelayedCapture(false);
|
||||
boolean ok = m_mPaymentTransaction.processOnline(get_TrxName());
|
||||
m_mPaymentTransaction.setRef_PaymentTransaction_ID(getC_PaymentTransaction_ID());
|
||||
// m_mPaymentTransaction.setCreditCardNumber(PaymentUtil.encrpytCreditCard(getCreditCardNumber()));
|
||||
// m_mPaymentTransaction.setCreditCardVV(PaymentUtil.encrpytCvv(getCreditCardVV()));
|
||||
m_mPaymentTransaction.saveEx();
|
||||
|
||||
if (trx != null)
|
||||
|
@ -334,9 +339,6 @@ public class MPaymentTransaction extends X_C_PaymentTransaction implements Proce
|
|||
setIsVoided(true);
|
||||
setR_VoidMsg(m_mPaymentTransaction.getR_VoidMsg());
|
||||
setRef_PaymentTransaction_ID(m_mPaymentTransaction.getC_PaymentTransaction_ID());
|
||||
|
||||
// setCreditCardNumber(PaymentUtil.encrpytCreditCard(getCreditCardNumber()));
|
||||
// setCreditCardVV(PaymentUtil.encrpytCvv(getCreditCardVV()));
|
||||
}
|
||||
else
|
||||
setErrorMessage(m_mPaymentTransaction.getErrorMessage());
|
||||
|
|
Loading…
Reference in New Issue