Author Topic: Custom Module, Credit Card processing using Samba  (Read 49263 times)

aloupos

  • Newbie
  • *
  • Posts: 25
Custom Module, Credit Card processing using Samba
« on: January 29, 2012, 10:10:06 am »
I've been using sambapos for the last 4 months in my restaurant in NYC.  It's incredibly stable, and pretty much does everything I need, except credit card processing.  In the US, most POS systems are integrated with merchant CC gateways, which makes transactions seamless and reduces errors. 

I posted a while back on this topic, and I know Emre you thought this was not something you were interested in implementing for the immediate future.  However, I'd like to take a stab at it myself, and of course donate the source code to the community. 

1.  Given the current architecture (2.xx), it seems best that I write in a new C# solution, so I don't need to worry about upgrades in the future.  The dev team can then consider if they want to integrate or not.  Any thoughts on this?

2.  If you agree with #1, I have an issue I hope you can help me solve.  I'd like the settlement screen (ticket payment)  to drive the transaction, so when a cashier presses the Credit button it will open a screen to capture the card details.  Is there a way (maybe through messaging server) I could get an event when that happens?  Ideally, that event would contain a reference to the ticket number and the amount the cashier typed before pressing credit. 

Many thanks in advance for your response and your awesome software!
Anthony

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Custom Module, Credit Card processing using Samba
« Reply #1 on: January 29, 2012, 11:59:12 am »
Hey Anthony we missed you a lot ! Maybe you misunderstood me because I only wanted to state it is not something used in Turkey so I don't have much experience about the merchant integration and the PCI Compliance. If you can help us implementing a proper solution of course I'll appreciate it and help you with the SambaPOS integration.

OK. nevermind.. If it will be useful I can inject a dummy cc processor library on cc payment process and you'll have an idea about the integration. If you want you can also directly implement processing in that library. What do you think about it?

Footnote: You forgot sending installation photos :)

aloupos

  • Newbie
  • *
  • Posts: 25
Re: Custom Module, Credit Card processing using Samba
« Reply #2 on: January 29, 2012, 01:32:52 pm »
Emre -- likewise!  I was just thinking this morning that what you and your team have built is very very cool.  Not just the software, but really the community around it.   You've really brought together a community of people with interest in business, finance and hospitality from all over the world, working together to make something that's already great even better! 

The custom install I talked about earlier never happened.  I planned to fit a touch screen (without the case) into the bar directly, but I went through 3 touch screens and none of them worked.  I ended up buying a standard touch screen instead, easier but not as cool!  You can check out photos of the restaurant, and the custom bar, if you want at glowthai.com

Your idea about the dummy cc processor library is perfect.  If you do that, I'll write the integration to paynet systems, a merchant gateway in the US.  They use a standard API which could be leveraged across a number of payment gateways.  In this case I'm even happier that I can contribute something useful to you guys. 

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Custom Module, Credit Card processing using Samba
« Reply #3 on: January 29, 2012, 03:48:26 pm »
Awesome! I'll try to implement something tomorrow.
Thank you for the nice words. I believe we'll make lots of awesome things together.
When I first heard that custom bar project really excited me, I'm sorry to hear you had to cancel that. I hope you'll find another solution.
I visited the FB page.. Really cool atmosphere and dishes looks delicious. I also saw SambaPOS screen there. Very nice :)

aloupos

  • Newbie
  • *
  • Posts: 25
Re: Custom Module, Credit Card processing using Samba
« Reply #4 on: January 30, 2012, 09:58:44 am »
Cool, can't wait to get the update so I can start. 

On the bar, I may be getting some old touch screens from a friend.  You've motivated me to revisit the custom POS integration.  So many cool projects, so little time. 

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Custom Module, Credit Card processing using Samba
« Reply #5 on: January 30, 2012, 12:08:49 pm »
Anthony...
You can fetch latest state from googlecode repo and my sample implementation is ready to compile. You'll find CreditCardModule library in project. It will support multiple processors so when needed we'll be able to implement additional processors easily. John have something similar about integrating POS devices.

When this library loads we'll see an additional field on Local Settings screen for choosing and configuring default credit card processor.

I've implemented two sample dummy processors. Simple processor will demonstrate processor configuration, saving configuration values and basic interaction with operator. External processor demonstrates implementing custom UI. You can try adding a third processor by duplicating one of them.

I'll be waiting your questions..

aloupos

  • Newbie
  • *
  • Posts: 25
Re: Custom Module, Credit Card processing using Samba
« Reply #6 on: January 31, 2012, 12:19:30 pm »
Emre, Thanks for the speedy update.  I downloaded the source and started playing around with it last night.  As you expected, I have a few questions.  I'll fill you in on some background for cc processing in restaurants in the US first. 

Compared to Europe and Asia, we're still old school when it comes to processing credit cards.  Here's how it works in most restaurants in the US. 

[AUTH]First we run what's called a pre-auth, which basically asks the credit card company if the card holder has enough credit for the amount + a 20% gratuity.  We do this because the customer will manually write in the tip amount later.

[SIGN]Second, a receipt is printed that contains the tendered amount with a blank space for a tip and of course a signature.

[FORCE]This receipt is then returned to the cashier, who enters the tip information and runs the actual charge, called a Force.

[CLOSE]This ticket is completed, the cashier can re-purpose the table if in ala-carte mode. 

Q1.  Given the above, I need temporarily persist some credit card information, along with the state of the transaction.  I think it makes sense to attach this information to the ticket model.   How would you recommend I do that?

Q2.  The TIP that the customer gives should also be attached to the ticket.  I can just create a non-taxable item called Tip and add it to the ticket, but it seems like a bit of a hack.  Is there a good way to add the tip to the ticket?

Q3.  We'll likely need an additional management screen to perform voids of transactions.  This probably shouldn't be done through a ticket, as the ticket may have been closed by the time a mistake is discovered.  Also, it's a theft risk if cashiers can just void charges.  Where/How do you recommend I add that? 

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Custom Module, Credit Card processing using Samba
« Reply #7 on: January 31, 2012, 01:37:00 pm »
A I've said earlier my experience about it is limited so I'll ask a question. Even keeping cc numbers in memory is risky. Shouldn't merchant store pre-authorized credit card numbers remotely? I think the process should be :
Pre authorization -> merchant returns a unique authorization number -> we complete process with that authorization number (not with the credit card number)...

Even I'm wrong with my assumption I think there is no need to persist credit card numbers anywhere. We can store card details in memory as a dictionary with a unique key until we need them for completing process. How it sounds?
« Last Edit: January 31, 2012, 01:38:32 pm by emre »

aloupos

  • Newbie
  • *
  • Posts: 25
Re: Custom Module, Credit Card processing using Samba
« Reply #8 on: January 31, 2012, 01:44:47 pm »
That would certainly make a lot of sense, but the merchants I'm familiar with don't work that way.  Based on the following, it looks like we need to temporarily persist the credit card details: 

"FORCE – Indicates a closure of a previously PREAUTH (pre-authorized) transaction. A
FORCE requires all data fields submitted with the original pre-authorization plus the
additional variable named APPROVNUMBER. The value of this field is the original
transaction Approval Number returned as the value of Approv_Num." -- from the merchant API guide.

I agree that we don't need to persist anything in the database.  Is the best way to create a global dictionary with the ticket number and cc details? 

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Custom Module, Credit Card processing using Samba
« Reply #9 on: January 31, 2012, 02:20:08 pm »
Yes keeping it in a dictionary will be fine. So we'll need a CardDetails class for keeping required values in memory and add it in a dictionary keyed with ticket number. We can use SecureString class for storing Card numbers in memory for additional security.

CreditCardProcessingData contains Ticket property for passing actual ticket data. If we talk for External credit card implementation you can store it in a private variable and instead of calling "PaymentProcessed" event you can call _ticket.PublishEvent(EventTopicNames.PaymentSubmitted); for closing ticket without completing the payment. So on first click to credit card button you'll pre-auth it, print receipt and close ticket. On second click to credit card button you'll check dictionary and if you can find preauth data with ticket number you'll force payment and remove preauth data.

Of course that will mean we should complete cc processing from the terminal we started the process. If we enable CC processing for a single computer it will be fine. For voiding payments we should store processed payment data elsewhere... SambaPOS permits payments with multiple credit cards so... hmm... If you think it will work as I described I can improve my implementation, tomorrow.
« Last Edit: January 31, 2012, 02:22:02 pm by emre »

aloupos

  • Newbie
  • *
  • Posts: 25
Re: Custom Module, Credit Card processing using Samba
« Reply #10 on: January 31, 2012, 03:40:24 pm »
We're on the same page in terms of workflow and where to store the cc details.  The swiped card data can be pretty large, and I'd rather not parse it if I don't have to, but a SecureString should be fine. 

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Custom Module, Credit Card processing using Samba
« Reply #11 on: January 31, 2012, 09:26:56 pm »
Since this is API based, maybe looking at payment addons used with oscommerce web based shopping cart may help with integration with different merchants.

SambaPOS - POS'n the World, one Terminal at a time.

jenem

  • Full Member
  • ***
  • Posts: 154
Re: Custom Module, Credit Card processing using Samba
« Reply #12 on: February 01, 2012, 02:03:06 am »
In the UK we use chip and pin devices {my brother is a cash only business).
Also all the card numbers except the last four are replace by *

ie on receipt,  card number **** **** **** 1234

Edgar


JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Custom Module, Credit Card processing using Samba
« Reply #13 on: February 01, 2012, 02:20:41 am »
I'm investigating a system to connect the EFTPOS terminal to SamaPOS. SambaPOS will send the total to the EFTPOS terminal, then swipe the card and enter pin or sign. Confirmation is sent back to SambaPOS and the EFT receipt can then be added into the POS receipt. The system also supports Merchant Gateways and multiple EFTPOS terminals.

This is an Australian product, if you don't want the Merchant Gateways then it should work worldwide with most EFTPOS terminals.
SambaPOS - POS'n the World, one Terminal at a time.

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Custom Module, Credit Card processing using Samba
« Reply #14 on: February 01, 2012, 08:19:10 am »
Anthony I improved External Processor as we talked and submitted latest sources. I'll be happy if you can have a look and let me know your questions / suggestions..