![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mcoil.corals.io/vendor/laravel/cashier/src/Http/Controllers/ |
<?php namespace Laravel\Cashier\Http\Controllers; use Illuminate\Routing\Controller; use Illuminate\Support\Arr; use Laravel\Cashier\Cashier; use Laravel\Cashier\Http\Middleware\VerifyRedirectUrl; use Laravel\Cashier\Payment; class PaymentController extends Controller { /** * Create a new PaymentController instance. * * @return void */ public function __construct() { $this->middleware(VerifyRedirectUrl::class); } /** * Display the form to gather additional payment verification for the given payment. * * @param string $id * @return \Illuminate\Contracts\View\View */ public function show($id) { $payment = new Payment(Cashier::stripe()->paymentIntents->retrieve( $id, ['expand' => ['payment_method']]) ); $paymentIntent = Arr::only($payment->asStripePaymentIntent()->toArray(), [ 'id', 'status', 'payment_method_types', 'client_secret', 'payment_method', ]); $paymentIntent['payment_method'] = Arr::only($paymentIntent['payment_method'] ?? [], 'id'); return view('cashier::payment', [ 'stripeKey' => config('cashier.key'), 'amount' => $payment->amount(), 'payment' => $payment, 'paymentIntent' => array_filter($paymentIntent), 'paymentMethod' => (string) request('source_type', optional($payment->payment_method)->type), 'errorMessage' => request('redirect_status') === 'failed' ? 'Something went wrong when trying to confirm the payment. Please try again.' : '', 'customer' => $payment->customer(), 'redirect' => url(request('redirect', '/')), ]); } }