Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JSON stuff
- $data = " Credentials: {
- Username: \"EmotiveTest\",
- Password: \"hfh0293h20hHHHFh409\",
- },
- Customer: {
- Reference: \"SESSIONID\"
- },
- Parameters: {
- Term: \"60\",
- Deposit: \"10\",
- DepositType: \"Percentage\",
- AnnualMileage: \"10000\"
- },
- VehicleRequests: [
- {
- Id: \"1234\",
- Dealer: \"Associated Dealer Key\",
- Vehicle: {
- CashPrice: \"10000\",
- CurrentMileage: \"100\",
- RegistrationDate: \"2013-09-01\",
- IsNew: \"false\",
- Identifier: \"54321\",
- IdentifierType: \"CapShortCode\",
- Type: \"Car\",
- StockId: \"12345\",
- ImageUrl: \"http://notworking.com/1234.jpg\",
- DealerVehicleUrl: \"http://notworking.com/1234/\",
- }
- }
- ]";
- $data_string = json_encode($data);
- $ch = curl_init('https://services.codeweavers.net/public/v2/JsonFinance/Calculate');
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($data_string))
- );
- $result = curl_exec($ch);
- echo display_array($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement