mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-22 01:22:16 +00:00
- Pay and subscribe from generated Subscription Request
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Services;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Str;
|
||||
use Laravel\Cashier\Exceptions\IncompletePayment;
|
||||
use Laravel\Cashier\Exceptions\PaymentActionRequired;
|
||||
@@ -13,6 +14,7 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
||||
class StripeService
|
||||
{
|
||||
|
||||
/**
|
||||
* Stripe Service constructor.
|
||||
*/
|
||||
@@ -241,10 +243,20 @@ class StripeService
|
||||
*/
|
||||
public function getPlan($id)
|
||||
{
|
||||
$plan = $this->stripe->plans()->find($id);
|
||||
$product = $this->stripe->products()->find($plan['product']);
|
||||
if (Cache::has("plan-$id")) {
|
||||
return Cache::get("plan-$id");
|
||||
}
|
||||
|
||||
return compact('plan', 'product');
|
||||
return Cache::rememberForever("plan-$id", function () use ($id) {
|
||||
|
||||
$plan = $this->stripe->plans()->find($id);
|
||||
$product = $this->stripe->products()->find($plan['product']);
|
||||
|
||||
return [
|
||||
'plan' => $plan,
|
||||
'product' => $product,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user