/**
  * Get the currency for the billable entity.
  *
  * @return string
  */
 protected function getCurrency()
 {
     return $this->billable->getCurrency();
 }
 /**
  * Determine if the user is in a "subscribed" state but has no card on file.
  *
  * @param  \Laravel\Cashier\Contracts\Billable  $billable
  * @return bool
  */
 protected function userIsSubscribedWithoutACard($billable)
 {
     return $billable && $billable->subscribed() && !$billable->onTrial() && is_null($billable->getLastFourCardDigits());
 }
 /**
  * Get the total for the line item.
  *
  * @return float
  */
 public function total()
 {
     return $this->billable->formatCurrency($this->amount);
 }
Example #4
0
 /**
  * Get the discount amount for the invoice.
  *
  * @return float|null
  */
 public function amountOff()
 {
     if (isset($this->discount->coupon->amount_off)) {
         return $this->billable->formatCurrency($this->discount->coupon->amount_off);
     }
 }