#!/usr/bin/php "supercredit.com.au", 'cert' => file_get_contents($cert_file), 'key' => file_get_contents($key_file), 'cabundle'=> file_get_contents($chain_file), ); // Set up the cURL request object. $ch = curl_init( $request_uri ); curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ); curl_setopt( $ch, CURLOPT_USERPWD, $username . ':' . $password ); curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); // Set up a POST request with the payload. curl_setopt( $ch, CURLOPT_POST, true ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); // Make the call, and then terminate the cURL caller object. $curl_response = curl_exec( $ch ); curl_close( $ch ); // Decode and validate output. $response = json_decode( $curl_response ); if( empty( $response ) ) { echo "The cURL call did not return valid JSON:\n"; die( $response ); } elseif ( !$response->status ) { echo "The cURL call returned valid JSON, but reported errors:\n"; die( $response->errors[0] . "\n" ); } // Print and exit. die( print_r( $response ) ); } ?>