PHP code example of tijmen-wierenga / laravel-chargebee

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

    

tijmen-wierenga / laravel-chargebee example snippets


    // Define your callback URI's here
    'redirect' => [
        'success' => 'http://chargebee.app/success',
        'cancelled' => null,
    ],
 php
['providers'] => [
    TijmenWierenga\LaravelChargebee\ChargebeeServiceProvider::class
]
 bash
php artisan chargebee:install
 php
$url = $user->subscription($planId)->withAddon($addonId)->getCheckoutUrl($embed);
 php
return redirect($url);
 php
return view('subscribe')->with(compact($url));
 php
$user->subscription()->registerFromHostedPage($request->id);
 php
$user->subscription($plan)->create($creditcardToken);
 php
$user->subscription($plan)
    ->withAddon($addon)
    ->create($creditcardToken)
 php
$user->subscription($plan)
    ->coupon($coupon)
    ->create($creditcardToken)
 php
$subscription->cancel();