I'm building an IOS shopping mobile application using flutter and firebase real-time database, where the cashier scans the user's loyalty card QR code using the mobile application after each payment to earn/collect points and then redeem them in any future payments.
How can I do the part related to collecting/earning points? for example for each 100USD, the user will get 100 points which equal to 1USD