¨4.0.1¨
This commit is contained in:
@@ -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')));
|
||||
|
||||
Reference in New Issue
Block a user