%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/vendor/laravel/cashier/src/Http/Controllers/ |
Upload File : |
<?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', '/')),
]);
}
}