1. Go to this page and download the library: Download asorasoft/bill 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/ */
public function createOrUpdateCustomer()
{
Customer::updateOrCreate([
'customer_id' => $customer_id,
'name' => 'Name',
'phone' => '019000000',
'email' => '[email protected]'
]);
}
public function getCustomerAndPlans()
{
$get_customer_and_plans = Subscription::getCustomerAndPlans($customer_id);
return json_encode($get_customer_and_plans);
}
public function subscribe()
{
Subscription::subscribe($customer_id, $plan_id);
}