Skip to content

Commit

Permalink
Added google/apple pay for subscriptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-tm committed Oct 6, 2021
1 parent 248d3fe commit 79f39c6
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/API2Client/Entities/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ class Subscription
*/
private $affiliate_name;

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

/**
* @return string
*/
Expand Down Expand Up @@ -578,6 +583,22 @@ public function setCustomerLocalTime($customer_local_time)
return $this;
}

/**
* @return array
*/
public function getPaymentOptions()
{
return $this->paymentOptions;
}

/**
* @param array $paymentOptions
*/
public function setPaymentOptions($paymentOptions)
{
$this->paymentOptions = $paymentOptions;
}


/**
* @return array
Expand Down Expand Up @@ -607,6 +628,7 @@ public function toArray ()
'customer_ip_address' => $this->getCustomerIpAddress(),
'customer_local_time' => $this->getCustomerLocalTime(),
'affiliate_name' => $this->getAffiliateName(),
'payment_options' => $this->getPaymentOptions(),
);
}
}
39 changes: 39 additions & 0 deletions src/API2Client/Entities/SubscriptionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class SubscriptionResult
*/
private $messages = array();

private $payment_reference;

private $client_secret;

/**
* @return mixed
*/
Expand Down Expand Up @@ -89,4 +93,39 @@ public function setStatus($status)
$this->status = $status;
return $this;
}

/**
* @return mixed
*/
public function getPaymentReference()
{
return $this->payment_reference;
}

/**
* @param mixed $payment_reference
*/
public function setPaymentReference($payment_reference)
{
$this->payment_reference = $payment_reference;
return $this;
}

/**
* @return mixed
*/
public function getClientSecret()
{
return $this->client_secret;
}

/**
* @param mixed $client_secret
*/
public function setClientSecret($client_secret)
{
$this->client_secret = $client_secret;
return $this;
}

}
2 changes: 2 additions & 0 deletions src/API2Client/Setters/SubscriptionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public function create ($data)
$created = new SubscriptionResult ();

$created->setRedirectUrl ($this->getValue ('redirect_url', $data, ''));
$created->setPaymentReference ($this->getValue ('payment_reference', $data, ''));
$created->setClientSecret ($this->getValue ('client_secret', $data, ''));
$created->setStatus ($this->getValue ('status', $data, false));

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

0 comments on commit 79f39c6

Please sign in to comment.