diff --git a/src/API2Client/Entities/Order.php b/src/API2Client/Entities/Order.php index 4efed5c..11d8df0 100644 --- a/src/API2Client/Entities/Order.php +++ b/src/API2Client/Entities/Order.php @@ -64,6 +64,11 @@ class Order */ protected $trackingInfo; + /** + * @var array + */ + protected $paymentOptions; + /** * @param float $amount */ @@ -240,6 +245,7 @@ public function toArray () 'paymentInfo' => $this->getPaymentWithGift (), 'trackingInfo' => $this->getTrackingInfo ()->toArray (), 'discountInfoList' => array (), + 'payment_options' => $this->getPaymentOptions(), ); $data['productInfoList'] = array (); @@ -264,4 +270,22 @@ public function toArray () return $data; } + + /** + * @return array + */ + public function getPaymentOptions() + { + return $this->paymentOptions; + } + + /** + * @param array $paymentOptions + */ + public function setPaymentOptions($paymentOptions) + { + $this->paymentOptions = $paymentOptions; + } + + } \ No newline at end of file diff --git a/src/API2Client/Entities/OrderCreated.php b/src/API2Client/Entities/OrderCreated.php index e95ef1c..fc4048e 100644 --- a/src/API2Client/Entities/OrderCreated.php +++ b/src/API2Client/Entities/OrderCreated.php @@ -43,6 +43,10 @@ class OrderCreated */ protected $status; + protected $paymentReference; + + protected $paymentToken; + /** * @param string $customerId */ @@ -138,4 +142,49 @@ public function getOrderId () { return $this->orderId; } + + /** + * @return mixed + */ + public function getPaymentReference() + { + return $this->paymentReference; + } + + /** + * @param mixed $paymentReference + */ + public function setPaymentReference($paymentReference) + { + $this->paymentReference = $paymentReference; + } + + /** + * @return mixed + */ + public function getPaymentToken() + { + return $this->paymentToken; + } + + /** + * @param mixed $paymentToken + */ + public function setPaymentToken($paymentToken) + { + $this->paymentToken = $paymentToken; + } + + public function toArray() { + return array( + 'customerId' => $this->getCustomerId(), + 'orderId' => $this->getOrderId (), + 'paymentLink' => $this->getPaymentLink (), + 'paymentForm' => $this->getPaymentForm (), + 'redirectUrl' => $this->getPaymentRedirectUrl (), + 'status' => $this->getStatus (), + 'payment_reference' => $this->getPaymentReference(), + 'payment_token' => $this->getPaymentToken(), + ); + } } \ No newline at end of file diff --git a/src/API2Client/Setters/OrderCreatedFactory.php b/src/API2Client/Setters/OrderCreatedFactory.php index 140f6de..c0e1c06 100644 --- a/src/API2Client/Setters/OrderCreatedFactory.php +++ b/src/API2Client/Setters/OrderCreatedFactory.php @@ -29,6 +29,8 @@ public function create ($data) $orderCreated->setPaymentForm ($this->getValue ('paymentForm', $data, '')); $orderCreated->setPaymentRedirectUrl ($this->getValue ('redirectUrl', $data, '')); $orderCreated->setStatus ($this->getValue ('status', $data, '')); + $orderCreated->setPaymentReference($this->getValue ('payment_reference', $data, '')); + $orderCreated->setPaymentToken($this->getValue ('payment_token', $data, '')); return $orderCreated; }