<?php require_once dirname(__DIR__) . '/vendor/autoload.php'; // set $api_token and $api_secret include 'auth.php'; try { // we need to store HTTP response headers and responses to comply with API caching policy $storage_config = array('connection' => 'mongodb://127.0.0.1:27017', 'database' => 'shorefox', 'collection' => 'api'); $trip = new \Shorefox\Client\Client($api_token, $api_secret, $storage_config, true); // payment key or any other config variables $config_all = $trip->getConfig()->getAll(); // booking config without guests // @see https://api.shorefox.com/doc/public/bookings/successful_tour_booking.html $stripe_token = 'tok_3hrjWpCOlBD27Z'; $booking_config = array('booking' => array('adult_count' => 1, 'child_count' => 0, 'time' => '11:00am', 'date' => '2014-03-31', 'guest_name' => 'Justus Corkery', 'guest_email' => '*****@*****.**', 'guest_country' => 'US', 'guest_phone_country_code' => '+1', 'guest_phone_number' => '437-901-8950', 'payment_token' => $stripe_token, 'newsletter_subscribe' => true, 'tour_id' => 1)); $booking = $trip->getBooking()->create($booking_config); var_dump($booking); } catch (\Exception $e) { echo "{$e->getMessage()}, {$e->getCode()}\n"; }