From 8b7480bc6d6327849050d740a866e50dec973001 Mon Sep 17 00:00:00 2001 From: jcournut Date: Thu, 3 Jun 2021 15:53:27 +0200 Subject: [PATCH 1/3] Add order ref and id in API call metadata --- Event/PayPlugPaymentEvent.php | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/Event/PayPlugPaymentEvent.php b/Event/PayPlugPaymentEvent.php index 50d9735..da320ed 100755 --- a/Event/PayPlugPaymentEvent.php +++ b/Event/PayPlugPaymentEvent.php @@ -315,6 +315,16 @@ class PayPlugPaymentEvent extends ActionEvent 'type' => 'string', 'required' => false, 'access' => 'customerId' + ], + 'transaction_id' => [ + 'type' => 'string', + 'required' => false, + 'access' => 'orderId' + ], + 'transaction_ref' => [ + 'type' => 'string', + 'required' => false, + 'access' => 'orderRef' ] ] ], @@ -385,6 +395,16 @@ class PayPlugPaymentEvent extends ActionEvent */ protected $customerId; + /** + * @var string + */ + protected $orderId; + + /** + * @var string + */ + protected $orderRef; + /** * @var string */ @@ -561,6 +581,8 @@ public function buildFromOrder(Order $order) if (null !== $customer = $order->getCustomer()) { $this->setCustomerId($customer->getId()) + ->setOrderId($order->getId()) + ->setOrderRef($order->getRef()) ->setBillingEmail($customer->getEmail()) ->setShippingEmail($customer->getEmail()); } @@ -985,6 +1007,42 @@ public function setCustomerId(string $customerId): PayPlugPaymentEvent return $this; } + /** + * @return string + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * @param string $orderId + * @return PayPlugPaymentEvent + */ + public function setOrderId(string $orderId): PayPlugPaymentEvent + { + $this->orderId = $orderId; + return $this; + } + + /** + * @return string + */ + public function getOrderRef() + { + return $this->orderRef; + } + + /** + * @param string $orderRef + * @return PayPlugPaymentEvent + */ + public function setOrderRef(string $orderRef): PayPlugPaymentEvent + { + $this->orderRef = $orderRef; + return $this; + } + /** * @return string */ From 762bfdaab0e13b6679d529e32b70ea0d2540f409 Mon Sep 17 00:00:00 2001 From: jcournut Date: Thu, 3 Jun 2021 15:54:48 +0200 Subject: [PATCH 2/3] Change version --- Config/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/module.xml b/Config/module.xml index 9b639e5..867c70b 100755 --- a/Config/module.xml +++ b/Config/module.xml @@ -17,7 +17,7 @@ en_US fr_FR - 1.0.6 + 1.0.7 Vincent Lopes-Vicente From a2216c7d24b656b6d988bf64333c510a962580bc Mon Sep 17 00:00:00 2001 From: jcournut Date: Thu, 3 Jun 2021 16:04:19 +0200 Subject: [PATCH 3/3] Change customerId and orderId type from string to integer --- Event/PayPlugPaymentEvent.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Event/PayPlugPaymentEvent.php b/Event/PayPlugPaymentEvent.php index da320ed..cece02e 100755 --- a/Event/PayPlugPaymentEvent.php +++ b/Event/PayPlugPaymentEvent.php @@ -312,12 +312,12 @@ class PayPlugPaymentEvent extends ActionEvent 'type' => 'nested', 'parameters' => [ 'customer_id' => [ - 'type' => 'string', + 'type' => 'integer', 'required' => false, 'access' => 'customerId' ], 'transaction_id' => [ - 'type' => 'string', + 'type' => 'integer', 'required' => false, 'access' => 'orderId' ], @@ -391,12 +391,12 @@ class PayPlugPaymentEvent extends ActionEvent protected $currency; /** - * @var string + * @var integer */ protected $customerId; /** - * @var string + * @var integer */ protected $orderId; @@ -990,7 +990,7 @@ public function setCurrency(string $currency): PayPlugPaymentEvent } /** - * @return string + * @return int */ public function getCustomerId() { @@ -998,17 +998,17 @@ public function getCustomerId() } /** - * @param string $customerId + * @param int $customerId * @return PayPlugPaymentEvent */ - public function setCustomerId(string $customerId): PayPlugPaymentEvent + public function setCustomerId(int $customerId): PayPlugPaymentEvent { $this->customerId = $customerId; return $this; } /** - * @return string + * @return int */ public function getOrderId() { @@ -1016,10 +1016,10 @@ public function getOrderId() } /** - * @param string $orderId + * @param int $orderId * @return PayPlugPaymentEvent */ - public function setOrderId(string $orderId): PayPlugPaymentEvent + public function setOrderId(int $orderId): PayPlugPaymentEvent { $this->orderId = $orderId; return $this;