This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The below requires two bits of setup in Postman: | |
* | |
* 1. An environment variable named `TRIP_COM_API_CLIENT_SECRET` set to your client secret for the API | |
* 2. A request parameter named `signature` set to the value `{{_SIGNATURE}}` - this will be set by this script | |
*/ | |
// Mostly copy-pastad from Stack Overflow since Postman doesn't seem to offer an out-of-the-box | |
// library for URL query param parsing, go figure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GuzzleHttp\Client; | |
use GuzzleHttp\Exception\ConnectException; | |
use GuzzleHttp\Exception\RequestException; | |
use GuzzleHttp\Handler\CurlHandler; | |
use GuzzleHttp\HandlerStack; | |
use GuzzleHttp\Psr7\Request as Psr7Request; | |
use GuzzleHttp\Psr7\Response as Psr7Response; | |
use Psr\Log\LoggerInterface; | |
const MAX_RETRIES = 2; |