Skip to content

Commit

Permalink
Merge pull request #9 from Plasma-Platform/feature/QUASAR-3154-google…
Browse files Browse the repository at this point in the history
…-apple-pay

Added google/apple pay.
  • Loading branch information
ch-tm authored Sep 28, 2021
2 parents 2c4fc18 + 248d3fe commit 30b79f5
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/API2Client/Entities/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class Order
*/
protected $trackingInfo;

/**
* @var array
*/
protected $paymentOptions;

/**
* @param float $amount
*/
Expand Down Expand Up @@ -240,6 +245,7 @@ public function toArray ()
'paymentInfo' => $this->getPaymentWithGift (),
'trackingInfo' => $this->getTrackingInfo ()->toArray (),
'discountInfoList' => array (),
'payment_options' => $this->getPaymentOptions(),
);

$data['productInfoList'] = array ();
Expand All @@ -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;
}


}
49 changes: 49 additions & 0 deletions src/API2Client/Entities/OrderCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class OrderCreated
*/
protected $status;

protected $paymentReference;

protected $paymentToken;

/**
* @param string $customerId
*/
Expand Down Expand Up @@ -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(),
);
}
}
2 changes: 2 additions & 0 deletions src/API2Client/Setters/OrderCreatedFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 30b79f5

Please sign in to comment.