PHP code example of amattu2 / carfax-wrapper

1. Go to this page and download the library: Download amattu2/carfax-wrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

amattu2 / carfax-wrapper example snippets




// see examples/..

$wrapper = new CARFAX\FTP();

/**
 * Class Constructor
 *
 * @param string $username CARFAX FTP username
 * @param string $password CARFAX FTP password
 * @param ?string $partner_name CARFAX Partner Name
 * @param ?string $type Data Report Type ("HIST" or "PROD")
 * @param ?DateTime $date Data Report Date
 * @throws None
 * @author Alec M.
 */
public function __construct(string $username, string $password, string $partner_name = "", string $type = "PROD", \DateTime $date = null);

$success = $wrapper->write([
  /* See class HEADER_FIELDS for a list of fields that are REQUIRED */
]);

$successes = $wrapper->writeAll(
  [
    [
      /* Repair order record */
    ],
    [
      /* Repair order record */
    ],

    // ...
  ]
);

$wrapper->upload();

$isCleaned = $wrapper->cleanUp();

$numRecords = $wrapper->getTotalRecords();

CARFAX\ServiceHistory::setLocationId("exampleLOC");

CARFAX\ServiceHistory::setProductDataId("exampleProductDataId");

$data = CARFAX\ServiceHistory::get("1G1GCCBX3JX001788");

CARFAX\QuickVIN::setLocationId("exampleLOC");

CARFAX\QuickVIN::setProductDataId("exampleProductDataId");

$xml = CARFAX\QuickVIN::decode("HELLO", "VA");