PHP code example of splitit-apimatic / splitit-apimatic-sdk

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

    

splitit-apimatic / splitit-apimatic-sdk example snippets


use SplititWebApiV4Lib\Environment;
use SplititWebApiV4Lib\Authentication\OAuth2CredentialsBuilder;
use SplititWebApiV4Lib\Models\OAuthScopeOAuth2Enum;
use SplititWebApiV4Lib\Authentication\ApiKeyCredentialsBuilder;
use SplititWebApiV4Lib\SplititWebApiV4ClientBuilder;

$client = SplititWebApiV4ClientBuilder::init()
    ->oAuth2Credentials(
        OAuth2CredentialsBuilder::init(
            'OAuthClientId',
            'OAuthClientSecret'
        )
            ->oAuthScopes(
                [
                    OAuthScopeOAuth2Enum::API_V4
                ]
            )
    )
    ->apiKeyCredentials(
        ApiKeyCredentialsBuilder::init(
            'X-Splitit-Api-Key'
        )
    )
    ->environment(Environment::SANDBOX)
    ->build();