Classes, interfaces and traits

Env

Class Env

Helper for handling changing variables in different environments

Known environment variables:

  • string iam_service_url the Url to the IAM Service
  • string payment_service_url the Url to the Payment Service
  • string locale language code, use only 2 letters like 'en'
« More »

Filter

A filter holds information for filtering data via the API.

Example:

$filter = new Filter('created', '2018-10-23', '>=');

If you want to filter for NULL values, you can pass the string 'NULL' as value.

« More »

Query

A query represents a set of query parameters for a GET request

You should use it to pass query and filter parameters to the Client's get* methods.

For example:

$myQuery = new Query();
$myQuery->set('foo', 'bar');
$myQuery->setPageSize(10);
$myQuery->addFilter(new Filter('field', 'value'));
« More »

Widget

Booking widget embedding utility

For integrating the booking process into a partner platform, a widget is available. Widgets are referenced by Widget-Hash.

You need to embed the Widget /assets/js/widgetapi.js into your hostpage and use the NextEventWidgetAPI to interact with the widget.

Embed Widget

<?php
use NextEvent\PHPSDK\Client;

$appUrl = 'https://myapp.nextevent.com';
$credentials = [...];
$widgetHash = 's67fa757df4a76s5';

$client = new Client($appUrl, $credentials, $widgetHash);

// get Widget
$widget = $client->getWidget();

// embed Widget
echo $widget->generateEmbedCode($event_id);

NextEventWidgetAPI

The NextEventWidgetAPI is a JavaSrcipt script, which you can use to register Message Handlers. Therefore the script has to be included into the hostpage.

Use NextEventWidgetAPI for retrieving the order_id and send it to your server. Use NextEventWidgetAPI to show your own payment step on current_step message

<script src="/assets/js/widgetapi.js"></script>

When the script is included the NextEventWidgetAPI is available by window .NextEventWidgetAPI

function custom_handler(data) {
// do something with the data
}

// handler can be added
window.NextEventWidgetAPI.addMessageHandler('current_step', custom_handler);
// and removed
window.NextEventWidgetAPI.removeMessageHandler('current_step', custom_handler);

Widget Messages

current_step

This message is send on changing routes. step current step a path

example data:

{
step: '/event/42'
}

{
step: '/payment'
}

{
step: '/checkout'
}

basket_update

This message is send when the basket is updated order_id id from current basket

example data:

{
order_id: 5005
}
« More »

Classes, interfaces and traits

LogContextInterface

Interface LogContextInterface

General Interface used to provide function to convert implementor class to an array, which can be used for the log context.

« More »

Logger

Class Logger

This is only the Wrapper for a PSR Logger and not the actual Logger. Implements some convenience functions for better logging.

« More »