You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by carsonrotisserie <mv...@hotmail.com> on 2011/02/28 23:53:07 UTC

Re: Clearing credit card data after capture

Just to give an update, I solved this problem by enhancing the method
PaymentGatewayServices.processAuthResult to replace the credit card number
after the authorization is complete.  

String number = (String)creditCard.get("cardNumber");
String lastFourDigits = number.substring(number.length() - 4,
number.length());
String firstDigits = number.substring(0, number.length() - 4);
firstDigits = Pattern.compile(".").matcher(firstDigits).replaceAll("x");
creditCard.set("cardNumber", firstDigits + lastFourDigits); 
creditCard.store();

I also had to modify the capture and refund methods in the specific
processor code to use the request token instead of the credit card number.

I really do wish ofbiz would build this as a configurable option into the
system as I have worked with some of the biggest online ecommerce retailers
and in my experience storing credit card numbers is not the best practice.


-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/Clearing-credit-card-data-after-capture-tp203987p3328916.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Re: Clearing credit card data after capture

Posted by David E Jones <de...@me.com>.
On Feb 28, 2011, at 2:53 PM, carsonrotisserie wrote:

> Just to give an update, I solved this problem by enhancing the method
> PaymentGatewayServices.processAuthResult to replace the credit card number
> after the authorization is complete.  
> 
> String number = (String)creditCard.get("cardNumber");
> String lastFourDigits = number.substring(number.length() - 4,
> number.length());
> String firstDigits = number.substring(0, number.length() - 4);
> firstDigits = Pattern.compile(".").matcher(firstDigits).replaceAll("x");
> creditCard.set("cardNumber", firstDigits + lastFourDigits); 
> creditCard.store();
> 
> I also had to modify the capture and refund methods in the specific
> processor code to use the request token instead of the credit card number.
> 
> I really do wish ofbiz would build this as a configurable option into the
> system as I have worked with some of the biggest online ecommerce retailers
> and in my experience storing credit card numbers is not the best practice.
> 

Submit a patch and chances are it will happen...

-David