Using Arduino to detect payment and open lock

Hello,
I would like to use Arduino to detect when a payment has been made on a point of sale (POS) credit card terminal and then operate a servo motor to open a lock. The idea is to build a mini art gallery for my garden (like the mini libraries people have), but it would be stocked with a piece of art for sale. If someone wants to buy the art, they can pay via credit card, which unlocks the door on the mini gallery so that they can take the art home. Here is a scratch to demonstrate the idea: https://scratch.mit.edu/projects/629602026 Does anyone have any clues about what code to use and the circuitry to detect when a payment has been made in order to activate the servo (unlock the door)?
Thank you!

Don't think most would be too keen about venturing to some unknown site to retrive possible whatever bug/virus.

The way you could implement this depends on where it will be, and what you're thinking of.

If this is going to be unattended and outside, like you have in Scratch, good luck. It would likely be almost effortless to destroy whatever locking mechanism you use if there is nobody there to monitor it (Locks only keep honest people out). Also you would need access to a network and power which is harder outside.

If this is going to be inside, it will be much easier. You may be able to use one of the more advanced Arduinos like the Nano 33 IOT to make this work. If I were to do this myself I would do the following:

  • Have a box with a acrylic cabinet style door on the front, that is secured either with a servo locking mechanism or even more secure (maybe) a solenoid locking mechanism (like a bank vault door). As well as some lighting inside the box and whatever else to make it look nice.

  • On part of the box I would place a QR code to a site that could facilitate the payment. The company Stripe comes to mind since they are pretty awesome. This would allow someone to pay for the item at whatever price, and then maybe use a web-hook to get that setup in the cloud.

  • Then the Arduino could check the cloud service every x seconds to see if someone has purchased it, and if so, unlock the door.

If that sounds too complex for you, a much easier route is to pre-program some secret and sort of long and random code that is stored in the Arduino. Have the person scan the QR code and pay, and once they finish the transaction, the site could just show them the secret code. After that, the customer could type the code into the cabinet and it would open it for them and let them take it.

Wow! Your response is really helpful. We really appreciate you taking the time to think about this and share your ideas. Thank you so much! :grinning: :+1: