¨4.0.1¨
This commit is contained in:
@@ -13,7 +13,7 @@ class AuthorizenetResponse extends GatewayResponse implements HasTransactionRefe
|
||||
private $clientResponse;
|
||||
|
||||
|
||||
public function __construct(Order $order,object $clientResponse)
|
||||
public function __construct(Order $order, object $clientResponse)
|
||||
{
|
||||
$this->order = $order;
|
||||
$this->clientResponse = $clientResponse;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace Modules\Payment\Responses;
|
||||
|
||||
use Modules\Order\Entities\Order;
|
||||
use Modules\Payment\Gateways\MercadoPago;
|
||||
use Modules\Payment\ShouldRedirect;
|
||||
use Modules\Payment\GatewayResponse;
|
||||
use Modules\Payment\HasTransactionReference;
|
||||
@@ -13,29 +12,34 @@ class FlutterwaveResponse extends GatewayResponse implements ShouldRedirect, Has
|
||||
private $order;
|
||||
private $clientResponse;
|
||||
|
||||
|
||||
public function __construct(Order $order, array|object $clientResponse)
|
||||
{
|
||||
$this->order = $order;
|
||||
$this->clientResponse = $clientResponse;
|
||||
}
|
||||
|
||||
|
||||
public function getOrderId()
|
||||
{
|
||||
return $this->order->id;
|
||||
}
|
||||
|
||||
|
||||
public function getRedirectUrl()
|
||||
{
|
||||
return $this->clientResponse['redirect_url'];
|
||||
}
|
||||
|
||||
|
||||
public function getTransactionReference()
|
||||
{
|
||||
return $this->clientResponse['tx_ref'];
|
||||
}
|
||||
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
return (array) $this->clientResponse;
|
||||
return (array)$this->clientResponse;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,22 +12,26 @@ class InstamojoResponse extends GatewayResponse implements ShouldRedirect, HasTr
|
||||
private $order;
|
||||
private $clientResponse;
|
||||
|
||||
|
||||
public function __construct(Order $order, array $clientResponse)
|
||||
{
|
||||
$this->order = $order;
|
||||
$this->clientResponse = $clientResponse;
|
||||
}
|
||||
|
||||
|
||||
public function getOrderId()
|
||||
{
|
||||
return $this->order->id;
|
||||
}
|
||||
|
||||
|
||||
public function getRedirectUrl()
|
||||
{
|
||||
return $this->clientResponse['redirectUrl'];
|
||||
return $this->clientResponse['longurl'];
|
||||
}
|
||||
|
||||
|
||||
public function getTransactionReference()
|
||||
{
|
||||
return $this->clientResponse['payment_id'];
|
||||
|
||||
@@ -12,27 +12,32 @@ class MercadoPagoResponse extends GatewayResponse implements ShouldRedirect, Has
|
||||
private $order;
|
||||
private $clientResponse;
|
||||
|
||||
|
||||
public function __construct(Order $order, object $clientResponse)
|
||||
{
|
||||
$this->order = $order;
|
||||
$this->clientResponse = $clientResponse;
|
||||
}
|
||||
|
||||
|
||||
public function getOrderId()
|
||||
{
|
||||
return $this->order->id;
|
||||
}
|
||||
|
||||
|
||||
public function getRedirectUrl()
|
||||
{
|
||||
return $this->clientResponse->back_urls->success;
|
||||
}
|
||||
|
||||
|
||||
public function getTransactionReference()
|
||||
{
|
||||
return $this->clientResponse->external_reference;
|
||||
}
|
||||
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -9,11 +9,13 @@ class NullResponse extends GatewayResponse
|
||||
{
|
||||
private $order;
|
||||
|
||||
|
||||
public function __construct(Order $order)
|
||||
{
|
||||
$this->order = $order;
|
||||
}
|
||||
|
||||
|
||||
public function getOrderId()
|
||||
{
|
||||
return $this->order->id;
|
||||
|
||||
@@ -12,22 +12,26 @@ class PayPalResponse extends GatewayResponse implements HasTransactionReference
|
||||
private $order;
|
||||
private $httpResponse;
|
||||
|
||||
|
||||
public function __construct(Order $order, HttpResponse $httpResponse)
|
||||
{
|
||||
$this->order = $order;
|
||||
$this->httpResponse = $httpResponse;
|
||||
}
|
||||
|
||||
|
||||
public function getOrderId()
|
||||
{
|
||||
return $this->order->id;
|
||||
}
|
||||
|
||||
|
||||
public function getTransactionReference()
|
||||
{
|
||||
return $this->httpResponse->result->purchase_units[0]->payments->captures[0]->id;
|
||||
}
|
||||
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
return parent::toArray() + ['resourceId' => $this->httpResponse->result->id];
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace Modules\Payment\Responses;
|
||||
|
||||
use Modules\Order\Entities\Order;
|
||||
use Modules\Payment\ShouldRedirect;
|
||||
use Modules\Payment\GatewayResponse;
|
||||
use Modules\Payment\HasTransactionReference;
|
||||
|
||||
@@ -11,21 +10,25 @@ class PaystackResponse extends GatewayResponse implements HasTransactionReferenc
|
||||
{
|
||||
private $order;
|
||||
|
||||
|
||||
public function __construct(Order $order)
|
||||
{
|
||||
$this->order = $order;
|
||||
}
|
||||
|
||||
|
||||
public function getOrderId()
|
||||
{
|
||||
return $this->order->id;
|
||||
}
|
||||
|
||||
|
||||
public function getTransactionReference()
|
||||
{
|
||||
return request('reference');
|
||||
}
|
||||
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -10,21 +10,25 @@ class RazorpayResponse extends GatewayResponse implements HasTransactionReferenc
|
||||
{
|
||||
private $razorpayOrder;
|
||||
|
||||
|
||||
public function __construct(RazorpayOrder $razorpayOrder)
|
||||
{
|
||||
$this->razorpayOrder = $razorpayOrder;
|
||||
}
|
||||
|
||||
|
||||
public function getOrderId()
|
||||
{
|
||||
return $this->razorpayOrder->receipt;
|
||||
}
|
||||
|
||||
|
||||
public function getTransactionReference()
|
||||
{
|
||||
return $this->razorpayOrder->razorpay_payment_id;
|
||||
}
|
||||
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
return $this->razorpayOrder->toArray();
|
||||
|
||||
@@ -12,22 +12,26 @@ 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