Bookings plugins let you insert additional steps into the booking process. They are most commonly used to collect additional information from the person making the booking.
Standard Booking Flow
Without plugins enabled the booking process is the same for all events and users.
- Find the event you'd like to book
- Select tickets and enter your name and email address (other options appear here depending on configuration)
- Either "Book now" (for free events) or be redirected to a payment provider (cash payment options also exist)
- Receive a confirmation message and email
Pre-Payment Plugin
You can add an additional step to the booking process in between selecting tickets and booking.
This plugin form is used to collect additional information from the person making the booking. Examples include address, the names of attendees, vehicle registration details, dietary requirements or company information.
The Plugin Form
The name of your plugin form needs to be set as the
Events that have plugins cause the booking workflow to branch before taking payment:
The plugin form can contain as many fields and pages as you need. It must include a submit button and a "Workflow - Complete Task" action field on the final page.
Once the plugin form has been completed the booker is taken to the normal book/pay form. The success message set in the "Workflow - Complete Task" action field can be displayed on the payment page, although we normally delete the default message and leave it blank.
Remember that Bookings includes a one hour timeout that starts when someone presses the "Book" button of an event and is cancelled when they reach the payment page (when a separate timeout starts). Adding a plugin form doesn't increase this timeout.
Plugin Data in the Event Manifest
If you want your plugin data to be available and downloadable from the Event Manifest you should also include a database save action field with it's label set as as the business key of the booking. This blueprint (ZIP) [4KB] will get you started.
Booking Management Form
Once a user has made their booking they can track it via the User Requests template. If a
This button links to your booking management form via a user task in the workflow:
Your management form could use the same form as the pre-payment plugin - this would let users update the information they supplied. Alternatively you could build a read-only version of the form if details shouldn't be updated. You can display values from the original booking by including form fields with the same names as those in the original form.
The form must include a submit button and complete task action which will return to the Booking Overview.
Event Management Form
This plugin is used by event organisers. It enables the "View additional information" button on the first page of the Occurrence Management form. The button will appear if there's a value for
goss.BookAndPay.v1.api.getOccurrenceBookersDetails End Point
Note that this End Point is part of the 1.6.7 release
This End Point returns information about the people booked onto an event, including the data entered into your plugin form.
You must list the variables you want to return. These will be the names of the fields on your plugin form. Using the example plugin form above:
{
"variableList": ["form_NAME", "form_REGISTRATION", "form_MAKE", "form_MODEL"],
"occurrenceBk": "3320-9294-9451-6007"
}
Returns:
"result": {
"count": 2,
"list": [{
"startUserId": "anonymous",
"startTime": "2020-09-22T10:19:20Z",
"id": "25916372",
"businessKey": "8562-7889-1514-4958",
"processDefinitionName": "Booking v1",
"processVariables": {
"form_REGISTRATION": "FG34FGH",
"form_MAKE": "Nissan",
"form_MODEL": "Micra",
"form_NAME": "George"
},
"endTime": null,
"processDefinitionId": "bookingv1:99:25915523"
}, {
"startUserId": "anonymous",
"startTime": "2020-09-22T10:18:43Z",
"id": "25916177",
"businessKey": "0405-3793-1256-6724",
"processDefinitionName": "Booking v1",
"processVariables": {
"form_REGISTRATION": "DE12DEF",
"form_MAKE": "Mini",
"form_MODEL": "Cooper",
"form_NAME": "Tom"
},
"endTime": null,
"processDefinitionId": "bookingv1:99:25915523"
}]
}
Where:
- startUserId - the user who made the booking (anonymous of not logged in)
- startTime - the time the booking was made
- businessKey - the business key of the booking
- processDefinitionName/Id - the name and ID of the booking process
- processVariables - the variables requested (ie the data captured in the plugin form)
Example Form
This example displays the information captured by the plugin form in a table.
The form design includes an HTML template field (to display the data), a submit button (labelled "Close") and a complete task action to return you to the Occurrence Management form.
The template field calls the
And displays the result using a Handlebars template:
<table style="width:100%">
<tr>
<th>Name</th>
<th>Make</th>
<th>Model</th>
<th>Registration</th>
</tr>
{{#each list}}
<tr>
<td>{{processVariables.form_NAME}}</td>
<td>{{processVariables.form_MAKE}}</td>
<td>{{processVariables.form_MODEL}}</td>
<td>{{processVariables.form_REGISTRATION}}</td>
</tr>
{{/each}}
</table>
Post Payment Workflows
It's possible to start another workflow process once a booking has been made.
In the plugin configuration, enter the process identifier of the workflow you want to start, for example
The
- form_DATA
- form_EMAIL
- form_NAME
- form_TEL
See the Bookings section of Core Product Data Storage for more information.
The business key of the booking is always passed to the new workflow as the value of the
If your plugin has a pre-payment form (described above) you can include any values from that in exactly the same way.
In this example two fields from the booking form were passed to the new workflow:
"postPaymentWorkflow": "timsexampleprocess",
"postPaymentWorkflowVars": ["form_NAME", "form_EMAIL"],
Which resulted in:
Configuration
The details of each plugin are held as objects in the plugins array in the Bookings Configuration End Point.
config.plugins.push({
"name": "Tim's plugin form",
"code": "TGH",
"prePaymentForm": "TIMSPLUGINFORM",
"postPaymentWorkflow": "",
"postPaymentWorkflowVars": ["form_NAME", "form_EMAIL"],
"bookingManagementForm": "MANAGETIMSPLUGIN",
"eventManagementForm": "VIEWTIMSPLUGINDATA"
});
Property | Type | Description |
---|---|---|
name | String | The name of the plugin. This text will be displayed to the event organiser in a drop-down field as they schedule occurrences |
code | String | The value of this property is not important, but it must be unique for each plugin |
prePaymentForm | String | The name of the form that should be presented to the user prior to payment |
postPaymentWorkflow | String | The name of the workflow that should be started once payment has been taken |
postPaymentWorkflowVars | Array | An array of variables that will be passed from the booking workflow to the postPaymentWorkflow |
bookingManagementForm | String | The name of the form that should be presented to a user from the booking overview page |
eventManagementForm | String | The name of the form that should be presented to an event administrator from the event overview page |