PHP code example of biohzrdmx / paddlin-php

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

    

biohzrdmx / paddlin-php example snippets


use Paddlin\Client;
use GuzzleHttp\Client as HttpClient;
use GuzzleHttp\Psr7\HttpFactory;

$http_factory = new HttpFactory();
$http_client = new HttpClient();
$client = new Client($http_client, $http_factory, 'YOUR_API_KEY', true);

$products = $client->products->list();

$product = $client->products->get('pro_01gsz4t5hdjse780zja8vvr7jg');

$payload = [
    "name" => "AeroEdit Student",
    "tax_category" => "standard",
    "description" => "Essential tools for student pilots to manage flight logs, analyze performance, and plan routes, and ensure compliance. Valid student pilot certificate from the FAA " => true,
            "payment_by_invoice" => false,
            "route_planning" => true,
            "sso" => false
        ],
        "suggested_addons" => [
            "pro_01h1vjes1y163xfj1rh1tkfb65",
            "pro_01gsz97mq9pa4fkyy0wqenepkz"
        ],
        "upgrade_description" => null
    ]
];
$client->products->create($payload);

$payload = [
  "name" => "AeroEdit for learner pilots"
];
$client->products->update('pro_01htz88xpr0mm7b3ta2pjkr7w2', $payload);

$product = $client->products->get('pro_01gsz4t5hdjse780zja8vvr7jg');
$suggested_addons = $product->get('custom_data.features.suggested_addons');

$product = $client->products->get('pro_01gsz4t5hdjse780zja8vvr7jg');
$special_

use Paddlin\Webhook\Webhook;

$webhook = new Webhook($request, 'YOUR_WEBHOOK_SECRET');

if ( $webhook->verify() ) {
    # The webhook is valid
}

$notification = $webhook->getNotification();

switch($notification->event_type) {
    case 'subscription.created':
        # Process subscription.created event
    break;
}