PHP code example of settle / settle-sdk-php

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

    

settle / settle-sdk-php example snippets


$settle_client = new SettleApiClient(
    SETTLE_MERCHANT_ID,
    SETTLE_USER_ID,
    SETTLE_PUBLIC_KEY,
    SETTLE_PRIVATE_KEY,
    SETTLE_IN_SANDBOX
);

$merchant_api = new MerchantApi($settle_client);

$merchant_api->api_keys->...;
$merchant_api->balance->...;
$merchant_api->payment_requests->...;
$merchant_api->payment_send->...;
$merchant_api->pos->...;
$merchant_api->profile->...;
$merchant_api->settlements->...;
$merchant_api->short_links->...;
$merchant_api->status_codes->...;

$merchant_api->api_keys->list();
$merchant_api->api_keys->get($api_key_id);
$merchant_api->api_keys->create($api_key_data);
$merchant_api->api_keys->update($api_key_id, $api_key_data);
$merchant_api->api_keys->delete($api_key_id);

$merchant_api->payment_requests->capture($payment_request_id,$currency,$amount)
$merchant_api->payment_requests->refund($payment_request_id, $currency, $amount);
$merchant_api->payment_requests->getLink($payment_request_id);
$merchant_api->payment_requests->getDeepLink($payment_request_id);

// the following will return 
$is_valid = $settle_client->isValidCallback($callbackUrl, $body, $headers, $method);

// the following method will grab the data Settle sent in the current request
$settle_data = $settle_client->getCallbackData();  

$short_link = 'https://settle.eu/s/gSpEb/pos123/';
$deep_link = $settle_client->getDeepLink($short_link);

proxy_set_header Authorization $http_authorization;
proxy_pass_header  Authorization;