PHP code example of propaysystems / payment-platform-api-interface

1. Go to this page and download the library: Download propaysystems/payment-platform-api-interface 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/ */

    

propaysystems / payment-platform-api-interface example snippets


$client = PaymentPlatformAPI::getInstance() //Singleton
         ->sandbox() //Use sandbox environment
         ->url('https://example.com') //Set host only if you have a custom host
         ->setVersion('v1')
         ->setCredentials('username', 'password');
         or
        ->setToken('132465789132465789');

//Get all contacts
$response = $client->contacts($filters = [], $

return [
    'url' => env('PAYMENT_PLATFORM_API_URL', ''),
    'version' => env('PAYMENT_PLATFORM_API_VERSION', 'v1'),
    'username' => env('PAYMENT_PLATFORM_API_USERNAME', 'secret'),
    'password' => env('PAYMENT_PLATFORM_API_PASSWORD', 'password'),
];


$this->app->bind(PaymentPlatformAPI::class, function() {
    return PaymentPlatformAPI::getInstance()
        ->url(config('custom.payment-platform-api.url'))
        ->setVersion(config('custom.payment-platform-api.version'))
        ->setCredentials(
            config('custom.payment-platform-api.username'), 
            config('custom.payment-platform-api.password')
        );
});


$client = app(PaymentPlatformAPI::class);