question

mjohnsonsa avatar image
mjohnsonsa asked Frank Faustino Deactivated edited

Upload transaction ID to MySQL database...

New to clover and need some guidance. Our use case is we are doing a drive through Christmas light display. Cars will line up and we will have an employee going to each car in line with a Clover Flex and running their credit card for admission to drive thru the lights. We need a way to validate their purchase when they get to entrance to redeem the receipt from their transaction. Here is the desired workflow, is it possible? what is the easiest way to do it using the least amount of customization?:

1. Employee #1 goes to driver side window, gets credit card from driver, opens Register app on clover, selects general admission product, runs the credit card, prints out receipt with QR or Barcode and gives it to driver.

2. I presume the QR or Barcode that prints on the receipt is the transaction ID. If this is the case, the next step is that this ID gets uploaded to our MySQL database that is hosted online upon transaction success.

3. When car reaches the front of the line to enter the drive thru display, another employee (Employee #2) will scan the QR or Barcode on the receipt the driver hands them using our "Check-In" app (not on a clover device, just a mobile web app on a cell phone or android tablet Employee #2 carries) which queries the MySQL database online and validates that receipt code is A) valid and exists in the database, and B) has not yet been used. Once it determines it is valid, it returns success, Employee #2 marks it as redeemed so it cannot be used again, and lets the car enter the gate.

I am pretty sure that #1 is possible using the Register app already on the Clover device (no custom programming or POS app necessary) and step #3 is all done using a web app we already created. So really this question is how do I do step #2 on the Clover Flex. Is this already possible using the integrated Register app on the clover without any custom programming? or if it does require customization which integration method (and sample code if it exist) would be the best place to start for us? any guidance is appreciated.

Thanks,
Matt

Clover FlexWebhooksDeveloper Pay API
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mjohnsonsa avatar image mjohnsonsa commented ·
Can anyone help with this? Clover does not have a support number for developers...

Matt
0 Likes 0 ·
Frank Faustino avatar image
Frank Faustino Deactivated answered Frank Faustino Deactivated edited
@mjohnsonsa,

If you have the setting enabled, Clover prints a barcode with each payment receipt. You can use the payment receipt as proof of payment. To scan a barcode with the Flex, press and hold the left button (barcode trigger), aim at the barcode on the payment receipt and if the payment is valid a screen with payment details should pop up. This is all built into Clover already and no extra programming is required.

If you'd like to implement extra functionality, (i.e., uploading the payment ID to a MySQL db), you can look at this example implementation ( https://github.com/clover/clover-android-sdk/blob/e9fb3b7a687e46b1a27ff2e35ff520b5d87324da/clover-android-sdk-examples/src/main/java/com/clover/android/sdk/examples/BarcodeScannerTestActivity.java) but in addition to scanning the barcode you'll also have to convert the barcode result from base 64 to base 32 but know that the resulting payment ID is only a partial ID, as discussed in length in previous threads:

  1. https://community.clover.com/questions/12319/receipt-barcode-value.html
  2. https://community.clover.com/questions/16393/receipt-barcode-value-safebase64tobase32.html
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dan avatar image
Dan answered mjohnsonsa commented
So you need an app which generates a QR from a successful transaction, and uploads it to your backend. You can do that, there are broadcast events which occur when interactions happen with Clover's services, specifically it sounds like the ACTION_PAYMENT_PROCESSED broadcast is what you need.

So after a successful payment, you make a code and upload it to your server, then print a custom receipt with the QR. Custom print jobs are also something Clover can do, there are several questions on the forum about this.
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mjohnsonsa avatar image mjohnsonsa commented ·

So is there a way to do this with the 'Register App' or do I have to make a whole app from scratch just to add the ability to send the transaction details up to the server?

0 Likes 0 ·

Welcome to the
Clover Developer Community