Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $api_key = '4e49de80-1670-4606-84f8-2f1d33a38670';
- $data = array(
- 'title' => 'Test',
- 'split_header' => '',
- 'split_payments' => array(
- array(
- 'fixed_cut' => '100',
- 'variable_cut' => '',
- 'stack_order' => '0'
- ),
- array(
- 'fixed_cut' => '100',
- 'variable_cut' => '',
- 'stack_order' => '1'
- )
- )
- );
- $parameter = http_build_query($data);
- $parameter = preg_replace('/%5B[0-9]+%5D/simU', '%5B%5D', $parameter);
- $process = curl_init();
- curl_setopt($process, CURLOPT_HEADER, 0);
- curl_setopt($process, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($process, CURLOPT_TIMEOUT, 10);
- curl_setopt($process, CURLOPT_USERPWD, $api_key . ':');
- curl_setopt($process, CURLOPT_URL, 'https://billplz-staging.herokuapp.com/api/v4/collections');
- curl_setopt($process, CURLOPT_POSTFIELDS, $parameter);
- $body = curl_exec($process);
- echo '<pre>'.print_r(json_decode($body, true), true).'</pre>';
Advertisement
Add Comment
Please, Sign In to add comment