first upload all files
This commit is contained in:
35
Modules/Payment/Responses/StripeResponse.php
Normal file
35
Modules/Payment/Responses/StripeResponse.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Payment\Responses;
|
||||
|
||||
use Stripe\PaymentIntent;
|
||||
use Modules\Order\Entities\Order;
|
||||
use Modules\Payment\GatewayResponse;
|
||||
use Modules\Payment\HasTransactionReference;
|
||||
|
||||
class StripeResponse extends GatewayResponse implements HasTransactionReference
|
||||
{
|
||||
private $order;
|
||||
private $intent;
|
||||
|
||||
public function __construct(Order $order, PaymentIntent $intent)
|
||||
{
|
||||
$this->order = $order;
|
||||
$this->intent = $intent;
|
||||
}
|
||||
|
||||
public function getOrderId()
|
||||
{
|
||||
return $this->order->id;
|
||||
}
|
||||
|
||||
public function getTransactionReference()
|
||||
{
|
||||
return $this->intent->id;
|
||||
}
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
return parent::toArray() + ['clientSecret' => $this->intent->client_secret];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user