Skip to content

Commit 248d3fe

Browse files
committed
Added google/apple pay.
1 parent 2c4fc18 commit 248d3fe

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

src/API2Client/Entities/Order.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ class Order
6464
*/
6565
protected $trackingInfo;
6666

67+
/**
68+
* @var array
69+
*/
70+
protected $paymentOptions;
71+
6772
/**
6873
* @param float $amount
6974
*/
@@ -240,6 +245,7 @@ public function toArray ()
240245
'paymentInfo' => $this->getPaymentWithGift (),
241246
'trackingInfo' => $this->getTrackingInfo ()->toArray (),
242247
'discountInfoList' => array (),
248+
'payment_options' => $this->getPaymentOptions(),
243249
);
244250

245251
$data['productInfoList'] = array ();
@@ -264,4 +270,22 @@ public function toArray ()
264270

265271
return $data;
266272
}
273+
274+
/**
275+
* @return array
276+
*/
277+
public function getPaymentOptions()
278+
{
279+
return $this->paymentOptions;
280+
}
281+
282+
/**
283+
* @param array $paymentOptions
284+
*/
285+
public function setPaymentOptions($paymentOptions)
286+
{
287+
$this->paymentOptions = $paymentOptions;
288+
}
289+
290+
267291
}

src/API2Client/Entities/OrderCreated.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ class OrderCreated
4343
*/
4444
protected $status;
4545

46+
protected $paymentReference;
47+
48+
protected $paymentToken;
49+
4650
/**
4751
* @param string $customerId
4852
*/
@@ -138,4 +142,49 @@ public function getOrderId ()
138142
{
139143
return $this->orderId;
140144
}
145+
146+
/**
147+
* @return mixed
148+
*/
149+
public function getPaymentReference()
150+
{
151+
return $this->paymentReference;
152+
}
153+
154+
/**
155+
* @param mixed $paymentReference
156+
*/
157+
public function setPaymentReference($paymentReference)
158+
{
159+
$this->paymentReference = $paymentReference;
160+
}
161+
162+
/**
163+
* @return mixed
164+
*/
165+
public function getPaymentToken()
166+
{
167+
return $this->paymentToken;
168+
}
169+
170+
/**
171+
* @param mixed $paymentToken
172+
*/
173+
public function setPaymentToken($paymentToken)
174+
{
175+
$this->paymentToken = $paymentToken;
176+
}
177+
178+
public function toArray() {
179+
return array(
180+
'customerId' => $this->getCustomerId(),
181+
'orderId' => $this->getOrderId (),
182+
'paymentLink' => $this->getPaymentLink (),
183+
'paymentForm' => $this->getPaymentForm (),
184+
'redirectUrl' => $this->getPaymentRedirectUrl (),
185+
'status' => $this->getStatus (),
186+
'payment_reference' => $this->getPaymentReference(),
187+
'payment_token' => $this->getPaymentToken(),
188+
);
189+
}
141190
}

src/API2Client/Setters/OrderCreatedFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public function create ($data)
2929
$orderCreated->setPaymentForm ($this->getValue ('paymentForm', $data, ''));
3030
$orderCreated->setPaymentRedirectUrl ($this->getValue ('redirectUrl', $data, ''));
3131
$orderCreated->setStatus ($this->getValue ('status', $data, ''));
32+
$orderCreated->setPaymentReference($this->getValue ('payment_reference', $data, ''));
33+
$orderCreated->setPaymentToken($this->getValue ('payment_token', $data, ''));
3234

3335
return $orderCreated;
3436
}

0 commit comments

Comments
 (0)