¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -6,6 +6,7 @@ use Stripe\PaymentIntent;
use Illuminate\Http\Request;
use Modules\Order\Entities\Order;
use Modules\Payment\GatewayInterface;
use Stripe\Exception\ApiErrorException;
use Modules\Payment\Responses\StripeResponse;
class Stripe implements GatewayInterface
@@ -13,6 +14,7 @@ class Stripe implements GatewayInterface
public $label;
public $description;
public function __construct()
{
$this->label = setting('stripe_label');
@@ -21,6 +23,10 @@ class Stripe implements GatewayInterface
\Stripe\Stripe::setApiKey(setting('stripe_secret_key'));
}
/**
* @throws ApiErrorException
*/
public function purchase(Order $order, Request $request)
{
$intent = PaymentIntent::create([
@@ -31,6 +37,7 @@ class Stripe implements GatewayInterface
return new StripeResponse($order, $intent);
}
public function complete(Order $order)
{
return new StripeResponse($order, new PaymentIntent(request('paymentIntent')));