X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/restate/vendor/laravel/cashier/src
home
/
gfecatvj
/
sites
/
restate
/
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: Payment.php
<?php namespace Laravel\Cashier; use Laravel\Cashier\Exceptions\PaymentActionRequired; use Laravel\Cashier\Exceptions\PaymentFailure; use Stripe\PaymentIntent as StripePaymentIntent; class Payment { /** * The Stripe PaymentIntent instance. * * @var \Stripe\PaymentIntent */ protected $paymentIntent; /** * Create a new Payment instance. * * @param \Stripe\PaymentIntent $paymentIntent * @return void */ public function __construct(StripePaymentIntent $paymentIntent) { $this->paymentIntent = $paymentIntent; } /** * Get the total amount that will be paid. * * @return string */ public function amount() { return Cashier::formatAmount($this->rawAmount(), $this->paymentIntent->currency); } /** * Get the raw total amount that will be paid. * * @return int */ public function rawAmount() { return $this->paymentIntent->amount; } /** * The Stripe PaymentIntent client secret. * * @return string */ public function clientSecret() { return $this->paymentIntent->client_secret; } /** * Determine if the payment needs a valid payment method. * * @return bool */ public function requiresPaymentMethod() { return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_PAYMENT_METHOD; } /** * Determine if the payment needs an extra action like 3D Secure. * * @return bool */ public function requiresAction() { return $this->paymentIntent->status === StripePaymentIntent::STATUS_REQUIRES_ACTION; } /** * Determine if the payment was cancelled. * * @return bool */ public function isCancelled() { return $this->paymentIntent->status === StripePaymentIntent::STATUS_CANCELED; } /** * Determine if the payment was successful. * * @return bool */ public function isSucceeded() { return $this->paymentIntent->status === StripePaymentIntent::STATUS_SUCCEEDED; } /** * Validate if the payment intent was successful and throw an exception if not. * * @return void * * @throws \Laravel\Cashier\Exceptions\PaymentActionRequired * @throws \Laravel\Cashier\Exceptions\PaymentFailure */ public function validate() { if ($this->requiresPaymentMethod()) { throw PaymentFailure::invalidPaymentMethod($this); } elseif ($this->requiresAction()) { throw PaymentActionRequired::incomplete($this); } } /** * The Stripe PaymentIntent instance. * * @return \Stripe\PaymentIntent */ public function asStripePaymentIntent() { return $this->paymentIntent; } /** * Dynamically get values from the Stripe PaymentIntent. * * @param string $key * @return mixed */ public function __get($key) { return $this->paymentIntent->{$key}; } }
Upload File
Create Folder