code
stringlengths 15
9.96M
| docstring
stringlengths 1
10.1k
| func_name
stringlengths 1
124
| language
stringclasses 1
value | repo
stringlengths 7
63
| path
stringlengths 6
186
| url
stringlengths 50
236
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public function discount()
{
return $this->formatAmount($this->rawDiscount());
} | Get the total discount amount.
@return string | discount | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function rawDiscount()
{
$total = 0;
foreach ((array) $this->invoice->total_discount_amounts as $discount) {
$total += $discount->amount;
}
return (int) $total;
} | Get the raw total discount amount.
@return int | rawDiscount | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function tax()
{
return $this->formatAmount($this->invoice->tax ?? 0);
} | Get the total tax amount.
@return string | tax | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function hasTax()
{
$lineItems = $this->invoiceItems() + $this->subscriptions();
return Collection::make($lineItems)->contains(function (InvoiceLineItem $item) {
return $item->hasTaxRates();
});
} | Determine if the invoice has tax applied.
@return bool | hasTax | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function taxes()
{
if (! is_null($this->taxes)) {
return $this->taxes;
}
$this->refreshWithExpandedData();
return $this->taxes = Collection::make($this->invoice->total_tax_amounts)
->sortByDesc('inclusive')
->map(function (object $taxAmount) {
return new Tax($taxAmount->amount, $this->invoice->currency, $taxAmount->tax_rate);
})
->all();
} | Get the taxes applied to the invoice.
@return \Laravel\Cashier\Tax[] | taxes | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function isNotTaxExempt()
{
return $this->invoice->customer_tax_exempt === StripeCustomer::TAX_EXEMPT_NONE;
} | Determine if the customer is not exempted from taxes.
@return bool | isNotTaxExempt | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function isTaxExempt()
{
return $this->invoice->customer_tax_exempt === StripeCustomer::TAX_EXEMPT_EXEMPT;
} | Determine if the customer is exempted from taxes.
@return bool | isTaxExempt | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function reverseChargeApplies()
{
return $this->invoice->customer_tax_exempt === StripeCustomer::TAX_EXEMPT_REVERSE;
} | Determine if reverse charge applies to the customer.
@return bool | reverseChargeApplies | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function chargesAutomatically()
{
return $this->invoice->collection_method === StripeInvoice::COLLECTION_METHOD_CHARGE_AUTOMATICALLY;
} | Determine if the invoice will charge the customer automatically.
@return bool | chargesAutomatically | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function sendsInvoice()
{
return $this->invoice->collection_method === StripeInvoice::COLLECTION_METHOD_SEND_INVOICE;
} | Determine if the invoice will send an invoice to the customer.
@return bool | sendsInvoice | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function invoiceItems()
{
return Collection::make($this->invoiceLineItems())->filter(function (InvoiceLineItem $item) {
return $item->type === 'invoiceitem';
})->all();
} | Get all of the "invoice item" line items.
@return \Laravel\Cashier\InvoiceLineItem[] | invoiceItems | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function subscriptions()
{
return Collection::make($this->invoiceLineItems())->filter(function (InvoiceLineItem $item) {
return $item->type === 'subscription';
})->all();
} | Get all of the "subscription" line items.
@return \Laravel\Cashier\InvoiceLineItem[] | subscriptions | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function tab($description, $amount, array $options = [])
{
$item = $this->owner()->tab($description, $amount, array_merge($options, ['invoice' => $this->invoice->id]));
$this->refresh();
return $item;
} | Add an invoice item to this invoice.
@param string $description
@param int $amount
@param array $options
@return \Stripe\InvoiceItem | tab | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function tabPrice($price, $quantity = 1, array $options = [])
{
$item = $this->owner()->tabPrice($price, $quantity, array_merge($options, ['invoice' => $this->invoice->id]));
$this->refresh();
return $item;
} | Add an invoice item for a specific Price ID to this invoice.
@param string $price
@param int $quantity
@param array $options
@return \Stripe\InvoiceItem | tabPrice | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function refresh()
{
$this->invoice = $this->invoice->refresh();
return $this;
} | Refresh the invoice.
@return $this | refresh | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
protected function refreshWithExpandedData()
{
if ($this->refreshed) {
return;
}
$expand = [
'account_tax_ids',
'discounts',
'lines.data.tax_amounts.tax_rate',
'total_discount_amounts.discount',
'total_tax_amounts.tax_rate',
];
if (isset($this->invoice->id) && $this->invoice->id) {
$this->invoice = $this->owner->stripe()->invoices->retrieve($this->invoice->id, [
'expand' => $expand,
]);
} else {
// If no invoice ID is present then assume this is the customer's upcoming invoice...
$this->invoice = $this->owner->stripe()->invoices->upcoming(array_merge($this->refreshData, [
'customer' => $this->owner->stripe_id,
'expand' => $expand,
]));
}
$this->refreshed = true;
} | Refresh the invoice with expanded objects.
@return void | refreshWithExpandedData | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
protected function formatAmount($amount)
{
return Cashier::formatAmount($amount, $this->invoice->currency);
} | Format the given amount into a displayable currency.
@param int $amount
@return string | formatAmount | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function accountTaxIds()
{
$this->refreshWithExpandedData();
return $this->invoice->account_tax_ids ?? [];
} | Return the Tax Ids of the account.
@return \Stripe\TaxId[] | accountTaxIds | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function customerTaxIds()
{
return $this->invoice->customer_tax_ids ?? [];
} | Return the Tax Ids of the customer.
@return array | customerTaxIds | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function finalize(array $options = [])
{
$this->invoice = $this->invoice->finalizeInvoice($options);
return $this;
} | Finalize the Stripe invoice.
@param array $options
@return $this | finalize | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function pay(array $options = [])
{
$this->invoice = $this->invoice->pay($options);
return $this;
} | Pay the Stripe invoice.
@param array $options
@return $this | pay | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function send(array $options = [])
{
$this->invoice = $this->invoice->sendInvoice($options);
return $this;
} | Send the Stripe invoice to the customer.
@param array $options
@return $this | send | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function void(array $options = [])
{
$this->invoice = $this->invoice->voidInvoice($options);
return $this;
} | Void the Stripe invoice.
@param array $options
@return $this | void | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function markUncollectible(array $options = [])
{
$this->invoice = $this->invoice->markUncollectible($options);
return $this;
} | Mark an invoice as uncollectible.
@param array $options
@return $this | markUncollectible | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function delete(array $options = [])
{
$this->invoice = $this->invoice->delete($options);
return $this;
} | Delete the Stripe invoice.
@param array $options
@return $this | delete | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function isOpen()
{
return $this->invoice->status === StripeInvoice::STATUS_OPEN;
} | Determine if the invoice is open.
@return bool | isOpen | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function isDraft()
{
return $this->invoice->status === StripeInvoice::STATUS_DRAFT;
} | Determine if the invoice is a draft.
@return bool | isDraft | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function isPaid()
{
return $this->invoice->status === StripeInvoice::STATUS_PAID;
} | Determine if the invoice is paid.
@return bool | isPaid | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function isUncollectible()
{
return $this->invoice->status === StripeInvoice::STATUS_UNCOLLECTIBLE;
} | Determine if the invoice is uncollectible.
@return bool | isUncollectible | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function isVoid()
{
return $this->invoice->status === StripeInvoice::STATUS_VOID;
} | Determine if the invoice is void.
@return bool | isVoid | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function view(array $data = [])
{
return View::make('cashier::invoice', array_merge($data, [
'invoice' => $this,
'owner' => $this->owner,
'user' => $this->owner,
]));
} | Get the View instance for the invoice.
@param array $data
@return \Illuminate\Contracts\View\View | view | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function pdf(array $data = [])
{
$options = config('cashier.invoices.options', []);
if ($paper = config('cashier.paper')) {
$options['paper'] = $paper;
}
return app(InvoiceRenderer::class)->render($this, $data, $options);
} | Capture the invoice as a PDF and return the raw bytes.
@param array $data
@return string | pdf | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function download(array $data = [])
{
$filename = $data['product'] ?? Str::slug(config('app.name'));
$filename .= '_'.$this->date()->month.'_'.$this->date()->year;
return $this->downloadAs($filename, $data);
} | Create an invoice download response.
@param array $data
@return \Symfony\Component\HttpFoundation\Response | download | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function downloadAs($filename, array $data = [])
{
return new Response($this->pdf($data), 200, [
'Content-Description' => 'File Transfer',
'Content-Disposition' => 'attachment; filename="'.$filename.'.pdf"',
'Content-Transfer-Encoding' => 'binary',
'Content-Type' => 'application/pdf',
'X-Vapor-Base64-Encode' => 'True',
]);
} | Create an invoice download response with a specific filename.
@param string $filename
@param array $data
@return \Symfony\Component\HttpFoundation\Response | downloadAs | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function owner()
{
return $this->owner;
} | Get the Stripe model instance.
@return \Illuminate\Database\Eloquent\Model | owner | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function asStripeInvoice()
{
return $this->invoice;
} | Get the Stripe invoice instance.
@return \Stripe\Invoice | asStripeInvoice | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function toArray()
{
return $this->asStripeInvoice()->toArray();
} | Get the instance as an array.
@return array | toArray | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function toJson($options = 0)
{
return json_encode($this->jsonSerialize(), $options);
} | Convert the object to its JSON representation.
@param int $options
@return string | toJson | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function jsonSerialize()
{
return $this->toArray();
} | [\ReturnTypeWillChange] | jsonSerialize | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function __get($key)
{
return $this->invoice->{$key};
} | Dynamically get values from the Stripe object.
@param string $key
@return mixed | __get | php | laravel/cashier-stripe | src/Invoice.php | https://github.com/laravel/cashier-stripe/blob/master/src/Invoice.php | MIT |
public function __construct(StripePromotionCode $promotionCode)
{
$this->promotionCode = $promotionCode;
} | Create a new PromotionCode instance.
@param \Stripe\PromotionCode $promotionCode
@return void | __construct | php | laravel/cashier-stripe | src/PromotionCode.php | https://github.com/laravel/cashier-stripe/blob/master/src/PromotionCode.php | MIT |
public function coupon()
{
return new Coupon($this->promotionCode->coupon);
} | Get the coupon that belongs to the promotion code.
@return \Laravel\Cashier\Coupon | coupon | php | laravel/cashier-stripe | src/PromotionCode.php | https://github.com/laravel/cashier-stripe/blob/master/src/PromotionCode.php | MIT |
public function asStripePromotionCode()
{
return $this->promotionCode;
} | Get the Stripe PromotionCode instance.
@return \Stripe\PromotionCode | asStripePromotionCode | php | laravel/cashier-stripe | src/PromotionCode.php | https://github.com/laravel/cashier-stripe/blob/master/src/PromotionCode.php | MIT |
public function toArray()
{
return $this->asStripePromotionCode()->toArray();
} | Get the instance as an array.
@return array | toArray | php | laravel/cashier-stripe | src/PromotionCode.php | https://github.com/laravel/cashier-stripe/blob/master/src/PromotionCode.php | MIT |
public function toJson($options = 0)
{
return json_encode($this->jsonSerialize(), $options);
} | Convert the object to its JSON representation.
@param int $options
@return string | toJson | php | laravel/cashier-stripe | src/PromotionCode.php | https://github.com/laravel/cashier-stripe/blob/master/src/PromotionCode.php | MIT |
public function jsonSerialize()
{
return $this->toArray();
} | [\ReturnTypeWillChange] | jsonSerialize | php | laravel/cashier-stripe | src/PromotionCode.php | https://github.com/laravel/cashier-stripe/blob/master/src/PromotionCode.php | MIT |
public function __get($key)
{
return $this->promotionCode->{$key};
} | Dynamically get values from the Stripe object.
@param string $key
@return mixed | __get | php | laravel/cashier-stripe | src/PromotionCode.php | https://github.com/laravel/cashier-stripe/blob/master/src/PromotionCode.php | MIT |
public function __construct(Invoice $invoice, StripeInvoiceLineItem $item)
{
$this->invoice = $invoice;
$this->item = $item;
} | Create a new invoice line item instance.
@param \Laravel\Cashier\Invoice $invoice
@param \Stripe\InvoiceLineItem $item
@return void | __construct | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function total()
{
return $this->formatAmount($this->item->amount);
} | Get the total for the invoice line item.
@return string | total | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function unitAmountExcludingTax()
{
return $this->formatAmount($this->item->unit_amount_excluding_tax ?? 0);
} | Get the unit amount excluding tax for the invoice line item.
@return string | unitAmountExcludingTax | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function hasBothInclusiveAndExclusiveTax()
{
return $this->inclusiveTaxPercentage() && $this->exclusiveTaxPercentage();
} | Determine if the line item has both inclusive and exclusive tax.
@return bool | hasBothInclusiveAndExclusiveTax | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function inclusiveTaxPercentage()
{
if ($this->invoice->isNotTaxExempt()) {
return $this->calculateTaxPercentageByTaxAmount(true);
}
return $this->calculateTaxPercentageByTaxRate(true);
} | Get the total percentage of the default inclusive tax for the invoice line item.
@return float|int|null | inclusiveTaxPercentage | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function exclusiveTaxPercentage()
{
if ($this->invoice->isNotTaxExempt()) {
return $this->calculateTaxPercentageByTaxAmount(false);
}
return $this->calculateTaxPercentageByTaxRate(false);
} | Get the total percentage of the default exclusive tax for the invoice line item.
@return float|int | exclusiveTaxPercentage | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function hasTaxRates()
{
if ($this->invoice->isNotTaxExempt()) {
return ! empty($this->item->tax_amounts);
}
return ! empty($this->item->tax_rates);
} | Determine if the invoice line item has tax rates.
@return bool | hasTaxRates | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function startDate()
{
if ($this->hasPeriod()) {
return $this->startDateAsCarbon()->toFormattedDateString();
}
} | Get a human readable date for the start date.
@return string|null | startDate | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function endDate()
{
if ($this->hasPeriod()) {
return $this->endDateAsCarbon()->toFormattedDateString();
}
} | Get a human readable date for the end date.
@return string|null | endDate | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function startDateAsCarbon()
{
if ($this->hasPeriod()) {
return Carbon::createFromTimestampUTC($this->item->period->start);
}
} | Get a Carbon instance for the start date.
@return \Carbon\Carbon|null | startDateAsCarbon | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function endDateAsCarbon()
{
if ($this->hasPeriod()) {
return Carbon::createFromTimestampUTC($this->item->period->end);
}
} | Get a Carbon instance for the end date.
@return \Carbon\Carbon|null | endDateAsCarbon | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function hasPeriod()
{
return ! is_null($this->item->period);
} | Determine if the invoice line item has a defined period.
@return bool | hasPeriod | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function periodStartAndEndAreEqual()
{
return $this->hasPeriod() ? $this->item->period->start === $this->item->period->end : false;
} | Determine if the invoice line item has a period with the same start and end date.
@return bool | periodStartAndEndAreEqual | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function isSubscription()
{
return $this->item->type === 'subscription';
} | Determine if the invoice line item is for a subscription.
@return bool | isSubscription | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
protected function formatAmount($amount)
{
return Cashier::formatAmount($amount, $this->item->currency);
} | Format the given amount into a displayable currency.
@param int $amount
@return string | formatAmount | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function invoice()
{
return $this->invoice;
} | Get the Stripe model instance.
@return \Laravel\Cashier\Invoice | invoice | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function asStripeInvoiceLineItem()
{
return $this->item;
} | Get the underlying Stripe invoice line item.
@return \Stripe\InvoiceLineItem | asStripeInvoiceLineItem | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function toArray()
{
return $this->asStripeInvoiceLineItem()->toArray();
} | Get the instance as an array.
@return array | toArray | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function toJson($options = 0)
{
return json_encode($this->jsonSerialize(), $options);
} | Convert the object to its JSON representation.
@param int $options
@return string | toJson | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function jsonSerialize()
{
return $this->toArray();
} | [\ReturnTypeWillChange] | jsonSerialize | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function __get($key)
{
return $this->item->{$key};
} | Dynamically access the Stripe invoice line item instance.
@param string $key
@return mixed | __get | php | laravel/cashier-stripe | src/InvoiceLineItem.php | https://github.com/laravel/cashier-stripe/blob/master/src/InvoiceLineItem.php | MIT |
public function __construct(StripePaymentIntent $paymentIntent)
{
$this->paymentIntent = $paymentIntent;
} | Create a new Payment instance.
@param \Stripe\PaymentIntent $paymentIntent
@return void | __construct | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function amount()
{
return Cashier::formatAmount($this->rawAmount(), $this->paymentIntent->currency);
} | Get the total amount that will be paid.
@return string | amount | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function rawAmount()
{
return $this->paymentIntent->amount;
} | Get the raw total amount that will be paid.
@return int | rawAmount | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function clientSecret()
{
return $this->paymentIntent->client_secret;
} | The Stripe PaymentIntent client secret.
@return string | clientSecret | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function capture(array $options = [])
{
return $this->paymentIntent->capture($options);
} | Capture a payment that is being held for the customer.
@param array $options
@return \Stripe\PaymentIntent | capture | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function requiresPaymentMethod()
{
return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_PAYMENT_METHOD;
} | Determine if the payment needs a valid payment method.
@return bool | requiresPaymentMethod | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function requiresAction()
{
return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_ACTION;
} | Determine if the payment needs an extra action like 3D Secure.
@return bool | requiresAction | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function requiresConfirmation()
{
return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_CONFIRMATION;
} | Determine if the payment needs to be confirmed.
@return bool | requiresConfirmation | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function requiresCapture()
{
return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_CAPTURE;
} | Determine if the payment needs to be captured.
@return bool | requiresCapture | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function cancel(array $options = [])
{
return $this->paymentIntent->cancel($options);
} | Cancel the payment.
@param array $options
@return \Stripe\PaymentIntent | cancel | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function isCanceled()
{
return $this->paymentIntent->status === StripePaymentIntent::STATUS_CANCELED;
} | Determine if the payment was canceled.
@return bool | isCanceled | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function isSucceeded()
{
return $this->paymentIntent->status === StripePaymentIntent::STATUS_SUCCEEDED;
} | Determine if the payment was successful.
@return bool | isSucceeded | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function isProcessing()
{
return $this->paymentIntent->status === StripePaymentIntent::STATUS_PROCESSING;
} | Determine if the payment is processing.
@return bool | isProcessing | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function customer()
{
if ($this->customer) {
return $this->customer;
}
return $this->customer = Cashier::findBillable($this->paymentIntent->customer);
} | Retrieve the related customer for the payment intent if one exists.
@return \Laravel\Cashier\Billable|null | customer | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function asStripePaymentIntent(array $expand = [])
{
if ($expand) {
return $this->customer()->stripe()->paymentIntents->retrieve(
$this->paymentIntent->id, ['expand' => $expand]
);
}
return $this->paymentIntent;
} | The Stripe PaymentIntent instance.
@param array $expand
@return \Stripe\PaymentIntent | asStripePaymentIntent | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function refresh(array $expand = [])
{
$this->paymentIntent = $this->asStripePaymentIntent($expand);
return $this;
} | Refresh the PaymentIntent instance from the Stripe API.
@param array $expand
@return $this | refresh | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function toArray()
{
return $this->asStripePaymentIntent()->toArray();
} | Get the instance as an array.
@return array | toArray | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function toJson($options = 0)
{
return json_encode($this->jsonSerialize(), $options);
} | Convert the object to its JSON representation.
@param int $options
@return string | toJson | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function jsonSerialize()
{
return $this->toArray();
} | [\ReturnTypeWillChange] | jsonSerialize | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function __get($key)
{
return $this->paymentIntent->{$key};
} | Dynamically get values from the Stripe object.
@param string $key
@return mixed | __get | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function __call($method, $parameters)
{
return $this->forwardCallTo($this->paymentIntent, $method, $parameters);
} | Dynamically pass missing methods to the PaymentIntent instance.
@param string $method
@param array $parameters
@return mixed | __call | php | laravel/cashier-stripe | src/Payment.php | https://github.com/laravel/cashier-stripe/blob/master/src/Payment.php | MIT |
public function __construct($amount, $currency, StripeTaxRate $taxRate)
{
$this->amount = $amount;
$this->currency = $currency;
$this->taxRate = $taxRate;
} | Create a new Tax instance.
@param int $amount
@param string $currency
@param \Stripe\TaxRate $taxRate
@return void | __construct | php | laravel/cashier-stripe | src/Tax.php | https://github.com/laravel/cashier-stripe/blob/master/src/Tax.php | MIT |
public function currency()
{
return $this->currency;
} | Get the applied currency.
@return string | currency | php | laravel/cashier-stripe | src/Tax.php | https://github.com/laravel/cashier-stripe/blob/master/src/Tax.php | MIT |
public function amount()
{
return $this->formatAmount($this->amount);
} | Get the total tax that was paid (or will be paid).
@return string | amount | php | laravel/cashier-stripe | src/Tax.php | https://github.com/laravel/cashier-stripe/blob/master/src/Tax.php | MIT |
public function rawAmount()
{
return $this->amount;
} | Get the raw total tax that was paid (or will be paid).
@return int | rawAmount | php | laravel/cashier-stripe | src/Tax.php | https://github.com/laravel/cashier-stripe/blob/master/src/Tax.php | MIT |
protected function formatAmount($amount)
{
return Cashier::formatAmount($amount, $this->currency);
} | Format the given amount into a displayable currency.
@param int $amount
@return string | formatAmount | php | laravel/cashier-stripe | src/Tax.php | https://github.com/laravel/cashier-stripe/blob/master/src/Tax.php | MIT |
public function isInclusive()
{
return $this->taxRate->inclusive;
} | Determine if the tax is inclusive or not.
@return bool | isInclusive | php | laravel/cashier-stripe | src/Tax.php | https://github.com/laravel/cashier-stripe/blob/master/src/Tax.php | MIT |
public function taxRate()
{
return $this->taxRate;
} | @return \Stripe\TaxRate | taxRate | php | laravel/cashier-stripe | src/Tax.php | https://github.com/laravel/cashier-stripe/blob/master/src/Tax.php | MIT |
public function __get($key)
{
return $this->taxRate->{$key};
} | Dynamically get values from the Stripe object.
@param string $key
@return mixed | __get | php | laravel/cashier-stripe | src/Tax.php | https://github.com/laravel/cashier-stripe/blob/master/src/Tax.php | MIT |
public function user()
{
return $this->owner();
} | Get the user that owns the subscription.
@return \Illuminate\Database\Eloquent\Relations\BelongsTo | user | php | laravel/cashier-stripe | src/Subscription.php | https://github.com/laravel/cashier-stripe/blob/master/src/Subscription.php | MIT |
public function owner()
{
$model = Cashier::$customerModel;
return $this->belongsTo($model, (new $model)->getForeignKey());
} | Get the model related to the subscription.
@return \Illuminate\Database\Eloquent\Relations\BelongsTo | owner | php | laravel/cashier-stripe | src/Subscription.php | https://github.com/laravel/cashier-stripe/blob/master/src/Subscription.php | MIT |
public function items()
{
return $this->hasMany(Cashier::$subscriptionItemModel);
} | Get the subscription items related to the subscription.
@return \Illuminate\Database\Eloquent\Relations\HasMany | items | php | laravel/cashier-stripe | src/Subscription.php | https://github.com/laravel/cashier-stripe/blob/master/src/Subscription.php | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.