PHP code example of sellgate / php-sdk

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

    

sellgate / php-sdk example snippets




Sellgate\Sellgate;

$sellgate = new Sellgate();

$checkoutData = [
    "title" => "Premium Subscription",
    "description" => "1-year access to all premium features",
    "currency" => "USD",
    "price" => "99.99",
    "crypto" => [
        [
            "network" => "ETH",
            "coin" => "ETH",
            "address" => "0xB1DA646D1cD015d205a99198e809724D5C78109d"
        ]
    ],
    "webhook" => "https://example.com/webhook",
    "return" => "https://example.com/thank-you"
];

$checkoutResult = $sellgate->createCheckout($checkoutData);
print_r($checkoutResult);

$addressData = [
    "crypto" => [
        "network" => "ETH",
        "coin" => "ETH",
        "address" => "0xB1DA646D1cD015d205a99198e809724D5C78109d"
    ],
    "webhook" => "https://example.com/webhook"
];

$addressResult = $sellgate->createAddress($addressData);
print_r($addressResult);
bash
composer