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": "^6.31.0"
"processout/processout-php": "^6.32.0"
}
}
```
Expand Down
1 change: 1 addition & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
include_once(dirname(__FILE__) . "/src/Product.php");
include_once(dirname(__FILE__) . "/src/Project.php");
include_once(dirname(__FILE__) . "/src/ProjectSFTPSettings.php");
include_once(dirname(__FILE__) . "/src/ProjectSFTPSettingsPublic.php");
include_once(dirname(__FILE__) . "/src/Refund.php");
include_once(dirname(__FILE__) . "/src/Subscription.php");
include_once(dirname(__FILE__) . "/src/Transaction.php");
Expand Down
18 changes: 17 additions & 1 deletion src/CardCreateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,23 @@ public function create($options = array())
$path = "/cards";

$data = array(

"device" => $this->getDevice(),
"name" => $this->getName(),
"number" => $this->getNumber(),
"exp_day" => $this->getExpDay(),
"exp_month" => $this->getExpMonth(),
"exp_year" => $this->getExpYear(),
"cvc2" => $this->getCvc2(),
"preferred_scheme" => $this->getPreferredScheme(),
"metadata" => $this->getMetadata(),
"token_type" => $this->getTokenType(),
"eci" => $this->getEci(),
"cryptogram" => $this->getCryptogram(),
"applepay_response" => $this->getApplepayResponse(),
"applepay_mid" => $this->getApplepayMid(),
"payment_token" => $this->getPaymentToken(),
"contact" => $this->getContact(),
"shipping" => $this->getShipping()
);

$response = $request->post($path, $data, $options);
Expand Down
4 changes: 3 additions & 1 deletion src/CardUpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public function update($cardId, $options = array())
$path = "/cards/" . urlencode($cardId) . "";

$data = array(

"update_type" => $this->getUpdateType(),
"update_reason" => $this->getUpdateReason(),
"preferred_scheme" => $this->getPreferredScheme()
);

$response = $request->put($path, $data, $options);
Expand Down
2 changes: 1 addition & 1 deletion src/Networking/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function prepare($options, $len = null)
$headers = array(
'API-Version: 1.4.0.0',
'Content-Type: application/json',
'User-Agent: ProcessOut PHP-Bindings/6.31.0'
'User-Agent: ProcessOut PHP-Bindings/6.32.0'
);
if (! empty($options['idempotencyKey']))
$headers[] = 'Idempotency-Key: ' . $options['idempotencyKey'];
Expand Down
9 changes: 9 additions & 0 deletions src/ProcessOut.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,15 @@ public function newProjectSFTPSettings($prefill = array()) {
return new ProjectSFTPSettings($this, $prefill);
}

/**
* Create a new ProjectSFTPSettingsPublic instance
* @param array|null $prefill array used to prefill the object
* @return ProjectSFTPSettingsPublic
*/
public function newProjectSFTPSettingsPublic($prefill = array()) {
return new ProjectSFTPSettingsPublic($this, $prefill);
}

/**
* Create a new Refund instance
* @param array|null $prefill array used to prefill the object
Expand Down
6 changes: 3 additions & 3 deletions src/ProjectSFTPSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ProjectSFTPSettings implements \JsonSerializable
protected $client;

/**
* SFTP server endpoint, port is required.
* SFTP server endpoint, port is required
* @var string
*/
protected $endpoint;
Expand Down Expand Up @@ -55,7 +55,7 @@ public function __construct(ProcessOut $client, $prefill = array())

/**
* Get Endpoint
* SFTP server endpoint, port is required.
* SFTP server endpoint, port is required
* @return string
*/
public function getEndpoint()
Expand All @@ -65,7 +65,7 @@ public function getEndpoint()

/**
* Set Endpoint
* SFTP server endpoint, port is required.
* SFTP server endpoint, port is required
* @param string $value
* @return $this
*/
Expand Down
178 changes: 178 additions & 0 deletions src/ProjectSFTPSettingsPublic.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<?php

// The content of this file was automatically generated

namespace ProcessOut;

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

class ProjectSFTPSettingsPublic implements \JsonSerializable
{

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

/**
* Whether the SFTP settings are enabled
* @var boolean
*/
protected $enabled;

/**
* SFTP server endpoint with port
* @var string
*/
protected $endpoint;

/**
* SFTP server username
* @var string
*/
protected $username;

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

$this->fillWithData($prefill);
}


/**
* Get Enabled
* Whether the SFTP settings are enabled
* @return bool
*/
public function getEnabled()
{
return $this->enabled;
}

/**
* Set Enabled
* Whether the SFTP settings are enabled
* @param bool $value
* @return $this
*/
public function setEnabled($value)
{
$this->enabled = $value;
return $this;
}

/**
* Get Endpoint
* SFTP server endpoint with port
* @return string
*/
public function getEndpoint()
{
return $this->endpoint;
}

/**
* Set Endpoint
* SFTP server endpoint with port
* @param string $value
* @return $this
*/
public function setEndpoint($value)
{
$this->endpoint = $value;
return $this;
}

/**
* Get Username
* SFTP server username
* @return string
*/
public function getUsername()
{
return $this->username;
}

/**
* Set Username
* SFTP server username
* @param string $value
* @return $this
*/
public function setUsername($value)
{
$this->username = $value;
return $this;
}


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

if(! empty($data['endpoint']))
$this->setEndpoint($data['endpoint']);

if(! empty($data['username']))
$this->setUsername($data['username']);

return $this;
}

/**
* Implements the JsonSerializable interface
* @return object
*/
public function jsonSerialize() {
return array(
"enabled" => $this->getEnabled(),
"endpoint" => $this->getEndpoint(),
"username" => $this->getUsername(),
);
}


/**
* Fetch the SFTP settings for the project.
* @param string $id
* @param array $options
* @return $this
*/
public function fetchSftpSettings($id, $options = array())
{
$this->fillWithData($options);

$request = new Request($this->client);
$path = "/projects/" . urlencode($id) . "/sftp-settings";

$data = array(

);

$response = $request->get($path, $data, $options);
$returnValues = array();


// Handling for field sftp_settings
$body = $response->getBody();
$body = $body['sftp_settings'];
$returnValues['fetchSftpSettings'] = $this->fillWithData($body);

return array_values($returnValues)[0];
}

}