Toggle menu

Bookings Configuration End Point

The core Bookings configuration is managed via a single getConfig end point.

The BookAndPay.getConfig end point holds all of the configuration for Bookings. It is the only component that should be edited during the installation process. Its namespace follows the standard GOSS configuration structure: config.environment.application.getConfig.

For example, a Bookings configuration end point set up in a development environment will have the namespace config.dev.BookAndPay.getConfig.

The end point contains the following properties.

Email Links

These links are used in the confirmation email (see Email and Message Template Configuration) and allow the booker to manage their booking.

PropertyTypeDescription
anonymousUpdateUrlString, optionalRequired if bookingOverviewLiveFormId is not set. The URL of an unsecured forms service article displaying the USERBOOKINGOVERVIEWV1 form
bookingOverviewLiveFormIdInteger, optionalRequired if anonymousUpdateUrl is not set. The live form ID of the published USERBOOKINGOVERVIEWV1 form
userRequestsUrlString, requiredThe full URL of a User Requests article that the bookers can access, set up to display the Bookingv1 workflow process

Core Settings

PropertyTypeDescription
anonymousIdInteger, requiredThe ID of the site's public/anonymous user. This is needed if you would like users to be able to make bookings without logging in
BookingFormDelayISO-8601 duration string, requiredThis setting is used to end the booking workflow if a booking is never made.

The booking workflow process uses two forms, chained together as two workflow tasks. The first form lets a user select tickets and enter their contact details. It is this form that is subject to the timeout set here. As soon as a user presses the "Book" button and moves to the payment form, the PaymentFormDelay comes into play instead. (Note that any plugin forms added between the booking and payment stages are also subject to this timeout)
bookingTextObject, requiredOne or more named objects holding text overrides for the booking forms. The name of each set of overrides will appear in the drop-down on the form used to create event occurrences. See Booking Text Overrides for the full list of options and the "Default" set of overrides
cashPaymentGroupString, optionalThe name of the website user group who will see the "Cash Payment" button on the payment forms. This should be a group of staff users, not members of the public
copyInstanceBoolean, requiredtrue: Event instances can be copied via a task in the Self Service template (generally only used with Contribute Event)

false: Event instances cannot be copied and the task will not appear
ctmApplicationString, requiredThe name of the Comms Template Application. If you have followed the standard installation this will be "Book and Pay"
discountsEnabledBoolean, requiredWhether or not the discount functionality will be enabled. If false the "apply discount" field will be hidden on the payment forms
discountsUserString, requiredSet an empty string to disable. The name of an iCM user. This user needn't have any privileges or content roots. The user is only used by the discount management form if it is published on the site rather than as an iCM shortcut
enableBasketBoolean, optionalIf you have Multiple Payments installed, set this as true to show the "enable basket" option when scheduling events
basketArticleIDInteger, required if enableBasket is trueThe article ID of the payment basket. See Using the Payment Basket for more information about setting up this article
basketProcessDefinitionString, optionalThe process definition that should be started, representing the booking while it is in the payment basket. Leave this as an empty string to use the default "order_bookings_item" process
enableConfirmEmailBoolean, requiredDefault: true. Turns the "confirm email" field on or off on the booking form
eventLocationBoolean, requiredtrue: An option to use the event's default address, set in its article extra tab, will appear in the "location" drop-down when creating event instances

false: Only articles using the Location template will appear in the list
eventTemplateInteger, requiredThe ID of the Event template definition
finishInstanceGracePeriodISO-8601 duration string, requiredThe time after an occurrence's end time that it will be automatically marked as "complete" (ie if the event organiser doesn't do this manually via the "Manage single occurrence" form)
formatDateTimeObject, optionalUsed in the "Take booking" and "Manage occurrences" forms to set the date and time formats.  If not set dates will appear as dddd D MMMM YYYY and times as HH:mm.
Example:
{
    longDate: "dddd D MMMM YYYY",
    shortDate: "DD/MM/YYYY",
    time: "HH:mm"
}
fromAddressString, optionalThe "from" address the emails generated by Bookings should appear to come from. This should always be an address allowed to send from your domain
fromNameString, optionalThe name emails will appear to come from
includeCalendarFileBoolean, requiredDefault: true. Set as false to disable the calendar files that get attached to the booking confirmation email
includePackagesBoolean, requiredtrue: Tickets and packages (ie the full Bookings functionality) will be enabled.

false: Tickets and packages will be disabled. Set false if Bookings is only being used to schedule events with no booking options
locationTemplateInteger, requiredThe ID of the Location template definition
maintenanceMessageString, requiredIf Bookings is put into maintenance mode (using iCM system maintenance), this message will appear on all of the forms. This value can be an i18n token on multilingual sites
newInstanceArticleIDInteger, required if using ContributeA form service article ID that has the "Create new occurrence" form related to it. When creating events via Contribute the "Event default prices" form will redirect to the create occurrence form once it's submitted
offlineRefNumberBoolean, requiredIf payments made offline require a reference number to be recorded at the time of booking. This setting can be overridden in the occurrence scheduling form. We recommend this is always set to true
offlineTypesArray, required if cashPaymentGroup is setAn array of offline payment types. If more than one value is included, the payment details form will include a drop-down field with these values in it. "Card" is always an option, allowing staff members to take "cardholder not present" payments
organiserEmailString, required if includeCalendarFile is trueThis will appear in the iCal appointment emailed to bookers
organiserNameString, required if includeCalendarFile is trueThis will appear in the iCal appointment emailed to bookers
PaymentFormDelayISO-8601 duration string, requiredOnce a user has made a booking they are immediately taken to the payment form. If no payment is made, the active booking (ie the process instance) remains active and is visible as a "take payment" task in the Self Service (booking overview) template. Bookings in this state have, effectively, reserved tickets in the name of the user.

When the duration entered here elapses the booking instance will be cancelled, returning the tickets to the available pool to be booked by other users. If payment is made prior to this time elapsing this value has no effect
ticketCostsBoolean, requiredSet as true to allow ticket costs to be edited separately to packages
ticketCostCentresArray, requiredSet an empty array to disable. An array of objects. Each should have an id, code, description and sourceGroup. The description appears in a drop-down when creating advanced tickets
ticketExpenseCodesArray, requiredSet an empty array to disable. An array of objects. Each should have an id, code and description. The description appears in a drop-down when creating advanced tickets. Use an empty array to disable
ticketVatCodesArray, requiredSet an empty array to disable. An array of objects. Each should have an id, rate, and description. The description appears in a drop-down when creating advanced tickets
timezoneString, requiredSets the timezone in the "Take booking" and "Take payment" forms. These forms use the moment-timezone.js library.
Default:  "Europe/London"
pluginsArray of ObjectsEach JSON object represents one plugin. See the final section of Writing Bookings Plugins for more information

Payment Provider Configuration

A single payment provider can be configured per Bookings installation, set in the paymentProvider property. The current supported providers are:

  • Adelante Smart Pay (Multi-Item)
  • Capita Paye.net (Pay360)
  • Capita SCP (Pay360)
  • Capita SCP Multi Item (Pay360)
  • Civica
  • Civica eStore
  • PayPal
  • GOV.UK Pay
  • Secure Trading Payments
  • WorldPay
PropertyTypeDescription
paymentProviderStringThe name of the payment provider that Bookings will link to. The names are defined in the PaymentProviders object at the top of the configuration. The value entered here determines which payment provider is activated on the TAKEPAYMENT form.

For example, to enable the PayPal provider, enter: 

config.paymentProvider = PaymentProviders.PAYPAL;
enablePaymentReconciliationBooleanOnly supported by the Civica, Worldpay and Capita SCP Multi-Item payment fields. If true, reconciliation will be enabled. Additional setup and configuration is also required, see below
paymentReferenceStringAn additional reference number that can be saved with the payment
providerSettingsJSON ObjectThe settings for each payment provider are stored as a JSON Object. These are retrieved by the TAKEPAYMENT form and will typically include security keys, IDs and request URLs

Payment Reconciliation

The Civica, Worldpay and Capita SCP Multi-Item payment field types support payment reconciliation. Sites that use these providers follow the same booking and payment steps as other payment providers, but in the background additional calls are made to the payment provider portal to confirm the success of the payment, releasing the tickets if the payment is not successful.

These payment providers require the following additional configuration:

  1. Configuration end points
    • Civica - config.[environment].BookAndPay.getConfig add the URL of the Query Payments API to the baseUrl property
      config.civicaSettings.settings = [{
          settingsId: "1",
          baseUrl: "https://www.civicaepay.co.uk/MyOrganisationXMLTest",
          callingApplicationId: "GOSSTest"
      }]

      The IP address of the iCM site needs to be whitelisted with Civica before the payment API can be used. 
    • World Pay - If payment reconciliation is not already set up, a configuration end point needs to be created at config.[environment].Worldpay.getConfig with the following:
      function(params, credentials) {
          return {
              credentials: [{
                  username: "example",
                  password: "example"
              }],
              defaults: {
                  username: "example"
              }
          };
      }
    • Capita SCP Multi-Item - If payment reconciliation is not already set up, a configuration end point needs to be created at config.[environment].CapitaSCP.getConfig with the following:
      function(params, credentials) {
          return {
              keys: [{
                  id: 456,
                  secret: "my==secret"
              }],
              defaults: {
                  key: 456
              }
          };
      }
  2. All website users who need to pay for bookings must be added to a user group called PAYMENT RECONCILIATION for the reconciliation workflow to start
  3. A Data Retention Policy should be set up for the Payment Reconciliation process. The schedule cannot be set up until the first process has started (because the DRM looks for existing histories)
Last modified on November 13, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon