Create CheckoutSessions.php

This commit is contained in:
2022-09-29 14:51:51 +02:00
committed by GitHub
parent d03a95b552
commit 87fc416b44

View File

@@ -0,0 +1,33 @@
<?php
namespace Bitinflow\Accounts\Traits\BitinflowPaymentsWallet;
use App\Models\User;
class CheckoutSessions
{
public function __construct(protected User $user)
{
//
}
public function createCheckoutSession(array $payload)
{
return $this->user->asPaymentsUser('POST', 'checkout-sessions', $payload);
}
public function getCheckoutSession(string $id)
{
return $this->user->asPaymentsUser('GET', sprintf('checkout-sessions/%s', $id));
}
public function checkoutCheckoutSession(string $id)
{
return $this->user->asPaymentsUser('PUT', sprintf('checkout-sessions/%s/checkout', $id));
}
public function revokeCheckoutSession(string $id)
{
return $this->user->asPaymentsUser('PUT', sprintf('checkout-sessions/%s/revoke', $id));
}
}