芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/vendor/laravel/cashier/src/Cashier.php
id : $stripeId; $model = static::$customerModel; $builder = in_array(SoftDeletes::class, class_uses_recursive($model)) ? $model::withTrashed() : new $model; return $stripeId ? $builder->where('stripe_id', $stripeId)->first() : null; } /** * Get the Stripe SDK client. * * @param array $options * @return \Stripe\StripeClient */ public static function stripe(array $options = []) { return new StripeClient(array_merge([ 'api_key' => $options['api_key'] ?? config('cashier.secret'), 'stripe_version' => static::STRIPE_VERSION, 'api_base' => static::$apiBaseUrl, ], $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 * @param array $options * @return string */ public static function formatAmount($amount, $currency = null, $locale = null, array $options = []) { if (static::$formatCurrencyUsing) { return call_user_func(static::$formatCurrencyUsing, $amount, $currency, $locale, $options); } $money = new Money($amount, new Currency(strtoupper($currency ?? config('cashier.currency')))); $locale = $locale ?? config('cashier.currency_locale'); $numberFormatter = new NumberFormatter($locale, NumberFormatter::CURRENCY); if (isset($options['min_fraction_digits'])) { $numberFormatter->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, $options['min_fraction_digits']); } $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; } /** * Configure Cashier to maintain incomplete subscriptions as active. * * @return static */ public static function keepIncompleteSubscriptionsActive() { static::$deactivateIncomplete = false; return new static; } /** * Configure Cashier to automatically calculate taxes using Stripe Tax. * * @return static */ public static function calculateTaxes() { static::$calculatesTaxes = true; return new static; } /** * Set the customer model class name. * * @param string $customerModel * @return void */ public static function useCustomerModel($customerModel) { static::$customerModel = $customerModel; } /** * Set the subscription model class name. * * @param string $subscriptionModel * @return void */ public static function useSubscriptionModel($subscriptionModel) { static::$subscriptionModel = $subscriptionModel; } /** * Set the subscription item model class name. * * @param string $subscriptionItemModel * @return void */ public static function useSubscriptionItemModel($subscriptionItemModel) { static::$subscriptionItemModel = $subscriptionItemModel; } }