1. Go to this page and download the library: Download bcismariu/laravel-payments 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/ */
bcismariu / laravel-payments example snippets
use Bcismariu\Laravel\Payments\Billable;
class User
{
use Billable;
// Import the Credit Card info into your User object:
$user->setCreditCard(new Card([
'brand' => 'visa',
'number' => '0000000000000000',
'exp_month' => '02',
'exp_year' => '2017',
'cvc_check' => '123',
]));
// Register the subscription and charge a certain amount:
$subscription = $user->subscribe('plan-name', 5);
// Check if the user has subscribed to a given plan
$user->subscribed('plan-name');