PHP code example of jsdecena / omnipay-chargebee

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

    

jsdecena / omnipay-chargebee example snippets


$gateway = Omnipay::create('Chargebee');

$gateway->authorize(['site_name' => '<YOUR-SITE-NAME>', 'site_api_key' => '<YOUR-API-KEY>']);

$payment = $gateway->purchase([
    'subscriber_id' => '16BR23Sxald0PM3m',
    'subscription_items' => [
        [
            'billing_cycles' => 12,
            'free_quantity' => 0,
            'item_price_id' => 'cbdemo_advanced-USD-monthly',
            'quantity' => 1
        ]
    ]
]);

$gateway->authorize(['site_name' => '<YOUR-SITE-NAME>', 'site_api_key' => '<YOUR-API-KEY>']);
$payment = $gateway->getSubscribers();

$gateway->authorize(['site_name' => '<YOUR-SITE-NAME>', 'site_api_key' => '<YOUR-API-KEY>']);
$payment = $gateway->getSubscribers('[email protected]');