Photo booth selection first example 2

Top  Previous  Next

This example shows how to set up the MDB Payment utility to pay for a print from the photo booth's sharing screen using a credit card reader in selection first/always idle mode. The photo booth app in this example is DSLR Remote Pro.

 
In this example the photo booth takes the photos and displays the sharing screen with options to share the photos for free or to pay per print.

 
Prerequisites

 

To use the MDB Payment utility you need to be running DSLR Remote Pro v3.16 or later.

 

First check that the credit card reader is running in MDB level 1 for authorization first/idle mode. If the Nayax VPOS Touch is not set to MDB level 1 you may need to contact Nayax support to request them to set it to MDB level 1.

 

Create a simple photo booth event in DSLR Remote Pro with printing and emails selected for the sharing options. After creating the event edit the settings to change the output from "Print and save JPEG copy" to "JPEG copy only" so that it creates a JPEG copy of the print layout but doesn't print it. Then click on "Print settings..." in the "Output Settings" dialog and enable payment mode. When the user taps on the print touchscreen action in the sharing the screen the photo booth will display the share_print_payment.jpg screen and wait for a "Payment accepted" touchscreen action before printing the photos.

In DSLR Remote Pro's "Photobooth Settings" dialog set "Start options" to "Touchscreen" so that it can accept commands from the MDB Payment Utility.

 

Run DSLR Remote Pro in photo booth mode and run the MDB Payment utility. The MDB Payment utility screen should look something like this:
 

connected3

 

Step 1: Add an event to enable the card reader

 

Enabling the card reader when the ready.jpg screen is displayed will display "Please select a product" and the product selection animation on the card reader's screen.

 

Click on the "Settings..." button to display the settings dialog:
 

settings_selection_first

 

Check that "Selection first/Always idle mode" is selected and the "Mode:" dropdown list is set to "DSLR Remote Pro".

Then click on the "Add action..." button to add an action:

 

add action selection first

 

Give the action a suitable name e.g. "Enable reader" and then set the trigger conditions in the section below. What we want to do is enable the card reader when the photo booth is displaying the ready.jpg screen if the card reader is disabled.

 

The "Pattern" trigger condition is set to a pattern that matches the photo booth screen e.g. ready.jpg. If "Use regular expression" is not selected the pattern string will match any part of the photo booth screen path. In the screenshot above the screen path is shown as: "C:\Users\chris\Documents\PhotoboothImages\copies2\ready.jpg" which can be matched by setting the pattern to "ready.jpg". More complex pattern matches can be defined by selecting "Use regular expression" and entering a regular expression such as .*ready\.jpg for the pattern.

 

We only need to enable the card reader if it is disabled (i.e. the state is INIT) and so we set the reader state in the trigger conditions to INIT.

 

Next we need to specify the action to take when the trigger conditions are met. In this case all we need to do is enable the card reader.

 

The "Add action" dialog should look something like this:

 

add action selection first ex2 step 1

 

Click OK to save the action and the settings dialog should look something like this:

 

settings selection first ex2

 

 

Step 2: Request payment when print payment screen is displayed

 

When the users taps on the print touchscreen action in the sharing screen the print payment screen is displayed and we need to request payment from the card reader. To do this click on "Add action..." in the settings dialog and name the action "Request payment". In the trigger conditions section set the pattern to share_print_payment and the reader state to IDLE.

 
In the actions to perform section set the "Request payment, amount:" to the amount, e.g. for $1 set this to 100, and set the required product number. The product number can be set to anything and is recorded in the logs that can be accessed via the Nayax web dashboard. This can be useful if you have different options at different prices and want to keep a record of which is selected.

Note: the amount is in cents for USD or Euros and pence for GBP. This is because the scale factor is 1 and the decimal places is 2 in the MDB status shown in the main screen.

 

The "Add action" dialog should look something like this:

 

add action selection first ex2 request payment

 

When the payment has been requested the status changes to VEND. If the payment is authorized the status will change to RESULT but if it fails it will change to IDLE.

 

Step 3: Payment Authorized

 

Define a new action named "Payment authorized" that is triggered when the photo booth is displaying the print payment screen and the reader state is RESULT. In the actions to perform section set the photo booth command to "Payment accepted".

 

The "Add action" dialog should look something like this:

 

add action selection first ex2 payment authorized

 

Note: defining an action that is triggered by the RESULT state automatically sends a confirmation message to the reader which will display a "Thank you" screen and then switch to the IDLE state.

 

Step 4: Payment Failed

 

If the payment is not authorized, times out or is cancelled by the user the state changes to IDLE with the status TransactionFailed. When this happens we want to cancel the printing and return to the sharing screen.
Define a new action named "Payment failed" that is triggered when the photo booth is displaying the print payment screen, the reader state is IDLE and the transaction fails. In the actions to perform section set the photo booth command to "Print ".

 

The "Add action" dialog should look something like this:

 

add action selection first ex2 payment failed

 

The settings screen should show all four actions and look something like this:

 

settings2 selection first ex2

 

Check it works

 

Click "OK" in the settings screen to return to the main screen.  Then start the photo booth and check that the card reader is enabled and is displaying the product selection screen. Tap the start button on the photo booth to start the shooting sequence and tap the print button when the sharing screen is displayed. Check that the card reader requests payment from the user when the print payment screen is displayed. Then scan a credit card (or the Nayax technician mode card) to pay for the print. When the payment is authorized the photo booth should print the photos and return to the sharing screen.

 

The main screen should look something like this:

 

status selection first ex2

 

Refinements

 

The user can cancel the payment by tapping the cancel button in the print payment screen on the photo booth. This will display the share_print_payment_cancelled.jpg screen for a few seconds and then return to the sharing screen, but the card reader will still be showing the payment screen. To cancel the payment on the card reader we need to add an action that is triggered when the share_print_payment_cancelled.jpg screen is displayed and the card reader is in the VEND state. This action should send a cancel command to the card reader. The action would look something like this:

 

add action selection first ex2 user cancel

 

The actions used in this example can be loaded by clicking on the "Load..." button and loading the MDB_selection_first_ex2.xml settings file.