Files
mtdb_movie/common/Billing/Gateways/Paypal/PaypalController.php
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

34 lines
863 B
PHP
Executable File

<?php namespace Common\Billing\Gateways\Paypal;
use Common\Billing\Subscription;
use Common\Core\BaseController;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;
class PaypalController extends BaseController
{
public function __construct(
protected Request $request,
protected Subscription $subscription,
protected Paypal $paypal,
) {
$this->middleware('auth');
}
public function storeSubscriptionDetailsLocally(): Response|JsonResponse
{
$data = $this->validate($this->request, [
'paypal_subscription_id' => 'required|string',
]);
$this->paypal->subscriptions->sync(
$data['paypal_subscription_id'],
Auth::id(),
);
return $this->success();
}
}