Skip to content

Commit aac22d1

Browse files
authored
Merge pull request #10 from Plasma-Platform/feature/QUASAR-3154-google-apple-pay
Added google/apple pay for subscriptions.
2 parents 30b79f5 + 79f39c6 commit aac22d1

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

src/API2Client/Entities/Subscription.php

+22
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ class Subscription
133133
*/
134134
private $affiliate_name;
135135

136+
/**
137+
* @var array
138+
*/
139+
protected $paymentOptions;
140+
136141
/**
137142
* @return string
138143
*/
@@ -578,6 +583,22 @@ public function setCustomerLocalTime($customer_local_time)
578583
return $this;
579584
}
580585

586+
/**
587+
* @return array
588+
*/
589+
public function getPaymentOptions()
590+
{
591+
return $this->paymentOptions;
592+
}
593+
594+
/**
595+
* @param array $paymentOptions
596+
*/
597+
public function setPaymentOptions($paymentOptions)
598+
{
599+
$this->paymentOptions = $paymentOptions;
600+
}
601+
581602

582603
/**
583604
* @return array
@@ -607,6 +628,7 @@ public function toArray ()
607628
'customer_ip_address' => $this->getCustomerIpAddress(),
608629
'customer_local_time' => $this->getCustomerLocalTime(),
609630
'affiliate_name' => $this->getAffiliateName(),
631+
'payment_options' => $this->getPaymentOptions(),
610632
);
611633
}
612634
}

src/API2Client/Entities/SubscriptionResult.php

+39
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class SubscriptionResult
2424
*/
2525
private $messages = array();
2626

27+
private $payment_reference;
28+
29+
private $client_secret;
30+
2731
/**
2832
* @return mixed
2933
*/
@@ -89,4 +93,39 @@ public function setStatus($status)
8993
$this->status = $status;
9094
return $this;
9195
}
96+
97+
/**
98+
* @return mixed
99+
*/
100+
public function getPaymentReference()
101+
{
102+
return $this->payment_reference;
103+
}
104+
105+
/**
106+
* @param mixed $payment_reference
107+
*/
108+
public function setPaymentReference($payment_reference)
109+
{
110+
$this->payment_reference = $payment_reference;
111+
return $this;
112+
}
113+
114+
/**
115+
* @return mixed
116+
*/
117+
public function getClientSecret()
118+
{
119+
return $this->client_secret;
120+
}
121+
122+
/**
123+
* @param mixed $client_secret
124+
*/
125+
public function setClientSecret($client_secret)
126+
{
127+
$this->client_secret = $client_secret;
128+
return $this;
129+
}
130+
92131
}

src/API2Client/Setters/SubscriptionResult.php

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public function create ($data)
1818
$created = new SubscriptionResult ();
1919

2020
$created->setRedirectUrl ($this->getValue ('redirect_url', $data, ''));
21+
$created->setPaymentReference ($this->getValue ('payment_reference', $data, ''));
22+
$created->setClientSecret ($this->getValue ('client_secret', $data, ''));
2123
$created->setStatus ($this->getValue ('status', $data, false));
2224

2325
$dataSubscription = $this->getValue ('subscription', $data, array ());

0 commit comments

Comments
 (0)