X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/realesbar/vendor/laravel/cashier/src
home
/
gfecatvj
/
sites
/
realesbar
/
vendor
/
laravel
/
cashier
/
src
/
📁
..
📄
Billable.php
(432 B)
📄
Cashier.php
(3.44 KB)
📄
CashierServiceProvider.php
(3.35 KB)
📁
Concerns
📁
Events
📁
Exceptions
📁
Http
📄
Invoice.php
(11.72 KB)
📄
InvoiceLineItem.php
(5.6 KB)
📄
Logger.php
(655 B)
📁
Notifications
📄
Payment.php
(3.03 KB)
📄
PaymentMethod.php
(1.78 KB)
📄
Subscription.php
(27.62 KB)
📄
SubscriptionBuilder.php
(9.53 KB)
📄
SubscriptionItem.php
(5.34 KB)
📄
Tax.php
(2.01 KB)
Editing: Cashier.php
<?php namespace Laravel\Cashier; use Money\Currencies\ISOCurrencies; use Money\Currency; use Money\Formatter\IntlMoneyFormatter; use Money\Money; use NumberFormatter; class Cashier { /** * The Cashier library version. * * @var string */ const VERSION = '12.1.0'; /** * The Stripe API version. * * @var string */ const STRIPE_VERSION = '2020-03-02'; /** * The custom currency formatter. * * @var callable */ protected static $formatCurrencyUsing; /** * Indicates if Cashier migrations will be run. * * @var bool */ public static $runsMigrations = true; /** * Indicates if Cashier routes will be registered. * * @var bool */ public static $registersRoutes = true; /** * Indicates if Cashier will mark past due subscriptions as inactive. * * @var bool */ public static $deactivatePastDue = true; /** * Get the billable entity instance by Stripe ID. * * @param string $stripeId * @return \Laravel\Cashier\Billable|null */ public static function findBillable($stripeId) { if ($stripeId === null) { return; } $model = config('cashier.model'); return (new $model)->where('stripe_id', $stripeId)->first(); } /** * Get the default Stripe API options. * * @param array $options * @return array */ public static function stripeOptions(array $options = []) { return array_merge([ 'api_key' => config('cashier.secret'), 'stripe_version' => static::STRIPE_VERSION, ], $options); } /** * Set the custom currency formatter. * * @param callable $callback * @return void */ public static function formatCurrencyUsing(callable $callback) { static::$formatCurrencyUsing = $callback; } /** * Format the given amount into a displayable currency. * * @param int $amount * @param string|null $currency * @param string|null $locale * @return string */ public static function formatAmount($amount, $currency = null, $locale = null) { if (static::$formatCurrencyUsing) { return call_user_func(static::$formatCurrencyUsing, $amount, $currency); } $money = new Money($amount, new Currency(strtoupper($currency ?? config('cashier.currency')))); $locale = $locale ?? config('cashier.currency_locale'); $numberFormatter = new NumberFormatter($locale, NumberFormatter::CURRENCY); $moneyFormatter = new IntlMoneyFormatter($numberFormatter, new ISOCurrencies()); return $moneyFormatter->format($money); } /** * Configure Cashier to not register its migrations. * * @return static */ public static function ignoreMigrations() { static::$runsMigrations = false; return new static; } /** * Configure Cashier to not register its routes. * * @return static */ public static function ignoreRoutes() { static::$registersRoutes = false; return new static; } /** * Configure Cashier to maintain past due subscriptions as active. * * @return static */ public static function keepPastDueSubscriptionsActive() { static::$deactivatePastDue = false; return new static; } }
Upload File
Create Folder