Toggle menu

Writing Bookings Plugins

Management Forms

Plugin data can be seen and, optionally, updated by bookers and event organisers.

These two features are optional and require slightly more advanced knowledge of how the platform works to implement.

Booking Management Form

Once a user has made their booking, they can track it via the User Requests template - see Self Service and User Requests Integration.

If you want to let users see or update the extra information they submitted via your plugin, you'll need to do the following.

Enter the name of a form as the value of the bookingManagementForm in your plugin's configuration, the Booking Details view will then output a "View additional details" button:

Booking Management Form

This button will link to your form.

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 could use a completely different form, and display values from the original form 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 Details view.

Event Management Form

This form is used by event organisers. It enables the "View additional information" button on the first page of the Occurrence Management form when you are Managing Individual Occurrences. The button will appear if there's a value for eventManagementForm in your plugin's configuration. It is designed to display the information captured by the pre-payment plugin.

Occurrence Management Additional Info

Occurrence Details End Point

To retrieve plugin data, your form will need to call the goss.BookAndPay.v1.api.getOccurrenceBookersDetails end point.

This end point returns information about the people booked onto an event, including the data entered into your plugin form. The end point has the following parameters:

getOccurrenceBookersDetails Parameters

You must list the variables you want to return. For example:

{
 "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.

Event Management Form

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.

Event Management Design

The template field calls the getOccurrenceBookersDetails End Point via the Manipulation Function. Note the use of helper.getSiteVariable('PROCESSBUSINESSKEY'); to get the business key of the event we are managing:

Call End Point

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>

Last modified on 17 October 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon