Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/TourCMS.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class TourCMS {
const PATH_API_AGENT_PROFILE_GET = "/api/agent/profile/get.xml";
const PATH_API_AGENT_PROFILE_UPDATE = "/api/agent/profile/update.xml";
const PATH_API_TOURS_SEARCH_CRITERIA_GET = "/api/tours/search_criteria/get.xml";
const PATH_API_BOOKING_WEBHOOK_TRIGGER = "/api/booking/webhook/trigger.xml";

// HTTP VERBS CONST
const HTTP_VERB_POST = 'POST';
Expand Down Expand Up @@ -650,6 +651,16 @@ public function send_booking_email($booking_data, $channel){
return($this->request('/c/booking/email/send.xml', $channel, "POST", $booking_data));
}

public function trigger_booking_webhook($booking, $event, $channel)
{

$booking_data = new SimpleXMLElement('<booking />');
$booking_data->addChild('booking_id', $booking);
$booking_data->addChild('event', $event);

return($this->request(self::PATH_API_BOOKING_WEBHOOK_TRIGGER, $channel, self::HTTP_VERB_POST, $booking_data));
}

public function redeem_voucher($voucher_data, $channel = 0) {
return($this->request('/c/voucher/redeem.xml', $channel, 'POST', $voucher_data));
}
Expand Down