Class Env
Helper for handling changing variables in different environments
Known environment variables:
string iam_service_url
the Url to the IAM Servicestring payment_service_url
the Url to the Payment Servicestring locale
language code, use only 2 letters like 'en'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.
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'));
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.
<?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);
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);
This message is send on changing routes.
step
current step a path
example data:
{
step: '/event/42'
}
{
step: '/payment'
}
{
step: '/checkout'
}
This message is send when the basket is updated
order_id
id from current basket
example data:
{
order_id: 5005
}