PHP code example of foreup / php-sdk

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

    

foreup / php-sdk example snippets




use ForeUP\PHPSDK\Client as ForeUPClient;

$client = new ForeUPClient($email, $password, $base_uri);


$token = $client->getToken();

$token->data->type // token
$token->data->id //   "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJmb3JldXBzb2Z0d2FyZS5jb20iLCJhdWQiOiJmb3JldXBzb2Z0d2FyZS5jb20iLCJpYXQiOjE0NzQ5MjI5MzgsImV4cCI6MTQ3NzUxNDkzOCwibGV2ZWwiOjAsImNpZCI6MCwiZW1wbG95ZWUiOmZhbHNlLCJ1aWQiOjY0ODI3Mjh9.go-Bf_6X8qByMu9JblewsmQt1dsqOu_70z6IlYYaZgGbsvjf9uQI0-RFSEivALntv0HF6-6WN9T5FxLpGyxcNA",


$client->customer()->create($customer, $courseId, $token);


$customer = [
    'type' => 'customer',
    'attributes' => [
        'username' => 'username',
        'company_name' => 'company_name',
        'taxable' => true,
        'discount' => 0,
        'opt_out_email' => false,
        'opt_out_text' => false,
        'date_created' => '2021-12-11T06:07:00-0700',
        'contact_info' => [
            'first_name' => 'first_name',
            'last_name' => 'last_name',
            'phone_number' => '801',
            'cell_phone_number' => '123 123 123',
            'email' => '[email protected]',
            'birthday' => '2017-01-09T06:07:00-0700',
            'address_1' => 'test 342',
            'address_2' => 'test 342',
            'city' => 'Lindon',
            'state' => 'UT',
            'zip' => '121234',
            'country' => 'USA',
            'handicap_account_number' => '123',
            'handicap_score' => '12',
            'comments' => 'Best customer ever!!'
        ]
    ]
];


phpunit vendor/foreup/

composer