PHP code example of webmenedzser / uvb-connector

1. Go to this page and download the library: Download webmenedzser/uvb-connector 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/ */

    

webmenedzser / uvb-connector example snippets



  


  use webmenedzser\UVBConnector\UVBConnector;

  $email = '[email protected]';
  $publicApiKey = 'aaaa';
  $privateApiKey = 'bbbb';

  $connector = new UVBConnector(
    $email, 
    $publicApiKey, 
    $privateApiKey
  );

 
  use webmenedzser\UVBConnector\UVBConnector;

  $email = '[email protected]';
  $publicApiKey = 'aaaa';
  $privateApiKey = 'bbbb';
  $threshold = 0.5;

  $connector = new UVBConnector(
    $email, 
    $publicApiKey, 
    $privateApiKey
  );
  
  // Set a threshold for the request
  $connector->threshold = $threshold;

  // Get reputation by hash
  $response = $connector->get();


  use webmenedzser\UVBConnector\UVBConnector;

  $email = '[email protected]';
  $publicApiKey = 'aaaa';
  $privateApiKey = 'bbbb';
  // 1 if good, -1 if bad;
  $outcome = 1;
  $orderId = '#98143';
  $phoneNumber = '+36209238883';
  $countryCode = 'HU';
  $postalCode = '8640';
  $addressLine = 'Szigligeti utca 10.';

  $connector = new UVBConnector(
    $email, 
    $publicApiKey, 
    $privateApiKey
  );

  // Submit order outcome to API
  $response = $connector->post(
    $outcome, 
    $orderId, 
    $phoneNumber, 
    $countryCode, 
    $postalCode, 
    $addressLine
  );

 
  use webmenedzser\UVBConnector\UVBConnector;

  $email = '[email protected]';
  $publicApiKey = 'aaaa';
  $privateApiKey = 'bbbb';
  $production = false;
  $threshold = 0.5;

  $connector = new UVBConnector(
    $email, 
    $publicApiKey, 
    $privateApiKey,
    $production
  );
  
  // Set a threshold for the request
  $connector->threshold = $threshold;

  // Get reputation by hash
  $response = $connector->get();