DRAFT - Not implemented
Billing
The Billing module provides a framework for implementing one-off charges and recurring payment plans.
Setup
You'll need to have completed the basic Esc/Shopify setup before following these steps.
Create the Plan class:
<?php
// app/Plan.php
use Esc\Shopify\Models\Plan as PlanBase;
class Plan extends PlanBase {
protected $table = 'plans';
public function shops() {
return $this->hasMany(\App\Shop::class, 'plan_id');
}
}
Add the billing interface, trait, and relationships to your Shop class:
// app/Shop.php
use Esc\Shopify\Models\Shop as ShopBase;
use Esc\Shopify\Billing\ShopifyBillingInterface;
use Esc\Shopify\Billing\ShopifyBillingTrait
class Shop extends ShopBase implements ShopifyBillingInterface {
use ShopifyBillingTrait;
protected $table = 'shops';
public function plan() {
return $this->belongsTo(
}
}