PHP code example of nrshoukhin / forte-php-sdk

1. Go to this page and download the library: Download nrshoukhin/forte-php-sdk 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/ */

    

nrshoukhin / forte-php-sdk example snippets


Shoukhin\Forte\ForteServiceProvider::class,

'Forte' => Shoukhin\Forte\Facades\Forte::class,

return [
    'access_id' => 'provide_forte_access_id',

    'secret_id' => 'provide_forte_secret_id',

    'mode'  =>  'provide_mode', //live or sandbox
    
    'org_id' => 'provide_the_forte_organization_id',

    'loc_id' => 'provide_the_forte_location_id'
];


houkhin\Forte\Api\Authentication;
use Shoukhin\Forte\Api\Customer;

$access_id = "provide your Forte access ID";
$secret_id = "provide your Forte secret ID";
$authentication = new Authentication( $access_id, $secret_id );

$authentication->set_config(
        array(
            "mode"   => "sandbox", //sandbox or live
            "org_id" => "provide the organization ID",
            "loc_id" => "provide the location ID"
        )
);

$forte = new Customer($authentication);
$customer = $forte->getCustomerOfOrganization();
echo "<pre>";
var_dump( $customer );



namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Shoukhin\Forte\Facades\Forte;

class ForteController extends Controller
{
    public function getAllCustomers(){
        $data = Forte::Customer()->getCustomerOfOrganization();
        echo "<pre>";
        var_dump( $data );
        return;
    }
}
shell
composer 
shell
php artisan vendor:publish --provider="Shoukhin\Forte\ForteServiceProvider"