SambaCard, need AddFund button on CashScreen

Hello, after trying to put SambaCard in action. I decided to stop using Cash and CreditCard payment. I want it this way:

Order > Scan SambaCard > Print Bill > Add Fund > Settle > SambaCard Payment

The resean I want to do it this way because I want to I know how much money a customer spent at my place. Then I can upgrade their card from Standard to Silver or Gold.

Anyone know how to do it? Thank you.

1 Like

You don’t need to do payment with SambaCard credit funds to check how much they spent.
You can use Customer accounts for that with a custom field, and still pay with cash.

Change the Customer entity type to have a ‘CardNr’ as primary field, and add a Custom Field ‘TotalSpent’ as well.

Setup rules/actions to update the TotalSpent custom field when a payment is made:

Action: AC UpdateTotalSpent

Rule: RU Add payment to customer TotalSpent

Are you using V4? For V3, there’s a little issue with the rule’s custom constraint which you have to be careful about. After you save the rule, you cannot edit it again or the first constraint will disappear, and you have to put it back in again every time.

When a ticket is opened, you select a customer (swiping the card to select the customer through CardNr), and when a cash payment is made, the amount will be automatically added to the customer’s TotalSpent field.

You could also do the same setup with SambaCard Customer Card entity instead of Customer entity.

To upgrade the customer status (standard, silver, gold), you add another action to the same rule which updates another Custom field of Customer entity (like ‘CustomerStatus’). Add a constraint to the action to check if the TotalSpent amount is bigger than a certain amount and smaller than the amount for the next status.
Another approach would be to use entity states for this.


Thank you very much for you reply pipo, I’ll try your advice around and post the result up later. BTW, I’m using V4.

I’d love to hear more advices from everyone if by any chance you have other ideas. Thanks.

For the loyalty level, you can do it like this:

Add another custom field to your Customer entity:

Then create another action to update this field:

clone this action and call it “AC update loyalty level 2”
(you’re going to need this action 2 times in the same rule, so you need another instance of the same action)

Then add the actions to the previous rule with a constraint to check if the TotalSpent has reached a certain amount:

rule custom constraint:
PaymentTypeName - equals - Cash
{ENTITY NAME:Customer} - Is Not Null

AC update TotalSpent:
Amount: [=TN(’{ENTITY DATA:Customer:TotalSpent}’) + [:ProcessedAmount]]

AC update loyalty-level:
constraint: [={ENTITY DATA:Customer:TotalSpent} + [:ProcessedAmount]]>=500
level: silver

AC update loyalty-level:
constraint: [={ENTITY DATA:Customer:TotalSpent} + [:ProcessedAmount]]>=2000
level: gold


Oh my, you are my hero, I’m getting in to say I’ve been sucessfully put TotalSpent check into action.

For information, if people are using SambaCard as I’m now, they need to Create 2 more Accounts>Transactions Types… let’s say, SambaCard Cash Payment and SambaCard Credit Card Payment. To make pipo first post works.

I’m checking your second reply now pipo, thanks so much.

Also, thinking about this method’s weakness is the TotalSpent for each customer won’t be showed on Accounts Balance.

Thank you, everything goes smoothly.

Do you mean to show the TotalSpent values of customer in the Accounts screen, or in the {ENTITY BALANCE:Customer} tag for printing?
For printing on tickets you can use {ENTITY DATA:Customer:TotalSpent} and {ENTITY DATA:Customer:Loyalty-level}.
If you want to see totals spent by customers in the Accounts screen, it will require a few more steps. Keep in mind that the customer accounts are not used as credit accounts here, that’s why you don’t see them in the Accounts screen.

1 Like

Pipo Hello, I need some tips on how to add funds to the card magnetic.

I will detail how I want it to be my configuration.
have a bar that doubles as night club the weekend, need to control the sale of Drunk as follows

1- The customer pays the entry worth $ 20 with right to 2 drinks

2- The official of the box makes the delivery of a magnetic card already with two drinks included for the customer

3- The client dirije to the bar balcony and delivers the magnetic card to the bar civil servant and then asks the 2 drinks desired

4- The bar civil servant passes the magnetic card to the system and the system displays the 2 card drinks and then make payment of 2 drinks, leaving the card without more drinks available

  1. The civil servant returns the card to the customer

6- if the customer wishes more drinks will have to go to the civil servant box again and make the delivery of money to reload the card with more drinks

7- The official of the box receives the money and add value in drinks and returns to the client

  1. The client receives the card and will go again to the bar and civil servant receives the drinks added to the card


@Gidy you don’t really add funds physically to the card itself. Card only contains an account number and you add funds to that account. When you scan card it does not read an amount. It reads account number and process that account balance. I mean we can fully operate it without using a mag card but to be able to access account number easily we prefer to use magnetic cards, barcode or qr tags.

You can start from here