Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // jSON URL which should be requested
- $json_url = 'https://secure.cashflows.com/gateway/remote';
- $username = '5949138'; // authentication
- $password = 'Ad368w9XYw'; // authentication
- // jSON String for request
- $json_string = [
- 'amount' => 'amount',
- 'currency' => 'currency',
- ];
- // Initializing curl
- $ch = curl_init( $json_url );
- // Configuring curl options
- $options = array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_USERPWD => $username . ':' . $password, // authentication
- CURLOPT_HTTPHEADER => array('Content-type: application/json') ,
- CURLOPT_POSTFIELDS => $json_string,
- );
- // Setting curl options
- curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
- curl_setopt_array( $ch, $options );
- // Getting results
- $result = curl_exec($ch); // Getting jSON result string
- return $result;
Add Comment
Please, Sign In to add comment