Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The package's installation is done using composer. Simply add these lines to you
```json
{
"require": {
"processout/processout-php": "^7.3.0"
"processout/processout-php": "^7.4.0"
}
}
```
Expand Down
3 changes: 2 additions & 1 deletion init.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
include_once(dirname(__FILE__) . "/src/AlternativeMerchantCertificate.php");
include_once(dirname(__FILE__) . "/src/Balances.php");
include_once(dirname(__FILE__) . "/src/Balance.php");
include_once(dirname(__FILE__) . "/src/BalancesCustomerAction.php");
include_once(dirname(__FILE__) . "/src/Card.php");
include_once(dirname(__FILE__) . "/src/CardInformation.php");
include_once(dirname(__FILE__) . "/src/Phone.php");
Expand Down Expand Up @@ -76,11 +77,11 @@
include_once(dirname(__FILE__) . "/src/TransactionOperation.php");
include_once(dirname(__FILE__) . "/src/Webhook.php");
include_once(dirname(__FILE__) . "/src/WebhookEndpoint.php");
include_once(dirname(__FILE__) . "/src/CardCreateRequest.php");
include_once(dirname(__FILE__) . "/src/Device.php");
include_once(dirname(__FILE__) . "/src/CardContact.php");
include_once(dirname(__FILE__) . "/src/CardShipping.php");
include_once(dirname(__FILE__) . "/src/CardUpdateRequest.php");
include_once(dirname(__FILE__) . "/src/CardCreateRequest.php");
include_once(dirname(__FILE__) . "/src/ErrorCodes.php");
include_once(dirname(__FILE__) . "/src/CategoryErrorCodes.php");
include_once(dirname(__FILE__) . "/src/ExternalThreeDS.php");
Expand Down
6 changes: 4 additions & 2 deletions src/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,10 @@ public function find($activityId, $options = array())

// Handling for field activity
$body = $response->getBody();
$body = $body['activity'];
$returnValues['find'] = $this->fillWithData($body);
if (isset($body['activity'])) {
$body = $body['activity'];
$returnValues['find'] = $this->fillWithData($body);
}

return array_values($returnValues)[0];
}
Expand Down
18 changes: 12 additions & 6 deletions src/Addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,10 @@ public function create($options = array())

// Handling for field addon
$body = $response->getBody();
$body = $body['addon'];
$returnValues['create'] = $this->fillWithData($body);
if (isset($body['addon'])) {
$body = $body['addon'];
$returnValues['create'] = $this->fillWithData($body);
}

return array_values($returnValues)[0];
}
Expand Down Expand Up @@ -614,8 +616,10 @@ public function find($subscriptionId, $addonId, $options = array())

// Handling for field addon
$body = $response->getBody();
$body = $body['addon'];
$returnValues['find'] = $this->fillWithData($body);
if (isset($body['addon'])) {
$body = $body['addon'];
$returnValues['find'] = $this->fillWithData($body);
}

return array_values($returnValues)[0];
}
Expand Down Expand Up @@ -651,8 +655,10 @@ public function save($options = array())

// Handling for field addon
$body = $response->getBody();
$body = $body['addon'];
$returnValues['save'] = $this->fillWithData($body);
if (isset($body['addon'])) {
$body = $body['addon'];
$returnValues['save'] = $this->fillWithData($body);
}

return array_values($returnValues)[0];
}
Expand Down
8 changes: 5 additions & 3 deletions src/AlternativeMerchantCertificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ public function save($options = array())

// Handling for field alternative_merchant_certificate
$body = $response->getBody();
$body = $body['alternative_merchant_certificate'];
$alternativeMerchantCertificate = new AlternativeMerchantCertificate($this->client);
$returnValues['alternativeMerchantCertificate'] = $alternativeMerchantCertificate->fillWithData($body);
if (isset($body['alternative_merchant_certificate'])) {
$body = $body['alternative_merchant_certificate'];
$alternativeMerchantCertificate = new AlternativeMerchantCertificate($this->client);
$returnValues['alternativeMerchantCertificate'] = $alternativeMerchantCertificate->fillWithData($body);
}


return array_values($returnValues)[0];
Expand Down
8 changes: 5 additions & 3 deletions src/ApplePayAlternativeMerchantCertificates.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@ public function fetch($options = array())

// Handling for field applepay_certificates
$body = $response->getBody();
$body = $body['applepay_certificates'];
$applePayAlternativeMerchantCertificates = new ApplePayAlternativeMerchantCertificates($this->client);
$returnValues['applePayAlternativeMerchantCertificates'] = $applePayAlternativeMerchantCertificates->fillWithData($body);
if (isset($body['applepay_certificates'])) {
$body = $body['applepay_certificates'];
$applePayAlternativeMerchantCertificates = new ApplePayAlternativeMerchantCertificates($this->client);
$returnValues['applePayAlternativeMerchantCertificates'] = $applePayAlternativeMerchantCertificates->fillWithData($body);
}


return array_values($returnValues)[0];
Expand Down
86 changes: 83 additions & 3 deletions src/Balances.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ class Balances implements \JsonSerializable
*/
protected $vouchers;

/**
* Available balance of the customer
* @var object
*/
protected $availableBalance;

/**
* Customer action to be performed, such as redirecting to a URL
* @var object
*/
protected $customerAction;

/**
* Balances constructor
* @param ProcessOut\ProcessOut $client
Expand Down Expand Up @@ -69,6 +81,64 @@ public function setVouchers($value)
return $this;
}

/**
* Get AvailableBalance
* Available balance of the customer
* @return object
*/
public function getAvailableBalance()
{
return $this->availableBalance;
}

/**
* Set AvailableBalance
* Available balance of the customer
* @param object $value
* @return $this
*/
public function setAvailableBalance($value)
{
if (is_object($value))
$this->availableBalance = $value;
else
{
$obj = new Balance($this->client);
$obj->fillWithData($value);
$this->availableBalance = $obj;
}
return $this;
}

/**
* Get CustomerAction
* Customer action to be performed, such as redirecting to a URL
* @return object
*/
public function getCustomerAction()
{
return $this->customerAction;
}

/**
* Set CustomerAction
* Customer action to be performed, such as redirecting to a URL
* @param object $value
* @return $this
*/
public function setCustomerAction($value)
{
if (is_object($value))
$this->customerAction = $value;
else
{
$obj = new BalancesCustomerAction($this->client);
$obj->fillWithData($value);
$this->customerAction = $obj;
}
return $this;
}


/**
* Fills the current object with the new values pulled from the data
Expand All @@ -80,6 +150,12 @@ public function fillWithData($data)
if(! empty($data['vouchers']))
$this->setVouchers($data['vouchers']);

if(! empty($data['available_balance']))
$this->setAvailableBalance($data['available_balance']);

if(! empty($data['customer_action']))
$this->setCustomerAction($data['customer_action']);

return $this;
}

Expand All @@ -90,6 +166,8 @@ public function fillWithData($data)
public function jsonSerialize() {
return array(
"vouchers" => $this->getVouchers(),
"available_balance" => $this->getAvailableBalance(),
"customer_action" => $this->getCustomerAction(),
);
}

Expand Down Expand Up @@ -117,9 +195,11 @@ public function find($tokenId, $options = array())

// Handling for field balances
$body = $response->getBody();
$body = $body['balances'];
$balances = new Balances($this->client);
$returnValues['balances'] = $balances->fillWithData($body);
if (isset($body['balances'])) {
$body = $body['balances'];
$balances = new Balances($this->client);
$returnValues['balances'] = $balances->fillWithData($body);
}


return array_values($returnValues)[0];
Expand Down
117 changes: 117 additions & 0 deletions src/BalancesCustomerAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?php

// The content of this file was automatically generated

namespace ProcessOut;

use ProcessOut\ProcessOut;
use ProcessOut\Networking\Request;

class BalancesCustomerAction implements \JsonSerializable
{

/**
* ProcessOut's client
* @var ProcessOut\ProcessOut
*/
protected $client;

/**
* Customer action type (such as url)
* @var string
*/
protected $type;

/**
* Value of the customer action. If type is an URL, URL to which you should redirect your customer
* @var string
*/
protected $value;

/**
* BalancesCustomerAction constructor
* @param ProcessOut\ProcessOut $client
* @param array|null $prefill
*/
public function __construct(ProcessOut $client, $prefill = array())
{
$this->client = $client;

$this->fillWithData($prefill);
}


/**
* Get Type
* Customer action type (such as url)
* @return string
*/
public function getType()
{
return $this->type;
}

/**
* Set Type
* Customer action type (such as url)
* @param string $value
* @return $this
*/
public function setType($value)
{
$this->type = $value;
return $this;
}

/**
* Get Value
* Value of the customer action. If type is an URL, URL to which you should redirect your customer
* @return string
*/
public function getValue()
{
return $this->value;
}

/**
* Set Value
* Value of the customer action. If type is an URL, URL to which you should redirect your customer
* @param string $value
* @return $this
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}


/**
* Fills the current object with the new values pulled from the data
* @param array $data
* @return BalancesCustomerAction
*/
public function fillWithData($data)
{
if(! empty($data['type']))
$this->setType($data['type']);

if(! empty($data['value']))
$this->setValue($data['value']);

return $this;
}

/**
* Implements the JsonSerializable interface
* @return object
*/
public function jsonSerialize() {
return array(
"type" => $this->getType(),
"value" => $this->getValue(),
);
}


}
6 changes: 4 additions & 2 deletions src/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1177,8 +1177,10 @@ public function find($cardId, $options = array())

// Handling for field card
$body = $response->getBody();
$body = $body['card'];
$returnValues['find'] = $this->fillWithData($body);
if (isset($body['card'])) {
$body = $body['card'];
$returnValues['find'] = $this->fillWithData($body);
}

return array_values($returnValues)[0];
}
Expand Down
6 changes: 4 additions & 2 deletions src/CardCreateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,10 @@ public function create($options = array())

// Handling for field card
$body = $response->getBody();
$body = $body['card'];
$returnValues['create'] = $this->fillWithData($body);
if (isset($body['card'])) {
$body = $body['card'];
$returnValues['create'] = $this->fillWithData($body);
}

return array_values($returnValues)[0];
}
Expand Down
6 changes: 4 additions & 2 deletions src/CardInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,10 @@ public function fetch($iin, $options = array())

// Handling for field card_information
$body = $response->getBody();
$body = $body['card_information'];
$returnValues['fetch'] = $this->fillWithData($body);
if (isset($body['card_information'])) {
$body = $body['card_information'];
$returnValues['fetch'] = $this->fillWithData($body);
}

return array_values($returnValues)[0];
}
Expand Down
Loading