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.33.0"
"processout/processout-php": "^7.0.0"
}
}
```
Expand Down
1 change: 0 additions & 1 deletion init.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,5 @@
include_once(dirname(__FILE__) . "/src/NativeAPMTransactionDetailsGateway.php");
include_once(dirname(__FILE__) . "/src/NativeAPMTransactionDetailsInvoice.php");
include_once(dirname(__FILE__) . "/src/NativeAPMTransactionDetails.php");
include_once(dirname(__FILE__) . "/src/InvoicesProcessNativePaymentResponse.php");

include_once(dirname(__FILE__) . "/src/GatewayRequest.php");
96 changes: 96 additions & 0 deletions src/CardShipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ class CardShipping implements \JsonSerializable
*/
protected $phone;

/**
* First name of the card shipping
* @var string
*/
protected $firstName;

/**
* Last name of the card shipping
* @var string
*/
protected $lastName;

/**
* Email of the card shipping
* @var string
*/
protected $email;

/**
* CardShipping constructor
* @param ProcessOut\ProcessOut $client
Expand Down Expand Up @@ -232,6 +250,72 @@ public function setPhone($value)
return $this;
}

/**
* Get FirstName
* First name of the card shipping
* @return string
*/
public function getFirstName()
{
return $this->firstName;
}

/**
* Set FirstName
* First name of the card shipping
* @param string $value
* @return $this
*/
public function setFirstName($value)
{
$this->firstName = $value;
return $this;
}

/**
* Get LastName
* Last name of the card shipping
* @return string
*/
public function getLastName()
{
return $this->lastName;
}

/**
* Set LastName
* Last name of the card shipping
* @param string $value
* @return $this
*/
public function setLastName($value)
{
$this->lastName = $value;
return $this;
}

/**
* Get Email
* Email of the card shipping
* @return string
*/
public function getEmail()
{
return $this->email;
}

/**
* Set Email
* Email of the card shipping
* @param string $value
* @return $this
*/
public function setEmail($value)
{
$this->email = $value;
return $this;
}


/**
* Fills the current object with the new values pulled from the data
Expand Down Expand Up @@ -261,6 +345,15 @@ public function fillWithData($data)
if(! empty($data['phone']))
$this->setPhone($data['phone']);

if(! empty($data['first_name']))
$this->setFirstName($data['first_name']);

if(! empty($data['last_name']))
$this->setLastName($data['last_name']);

if(! empty($data['email']))
$this->setEmail($data['email']);

return $this;
}

Expand All @@ -277,6 +370,9 @@ public function jsonSerialize() {
"country_code" => $this->getCountryCode(),
"zip" => $this->getZip(),
"phone" => $this->getPhone(),
"first_name" => $this->getFirstName(),
"last_name" => $this->getLastName(),
"email" => $this->getEmail(),
);
}

Expand Down
72 changes: 3 additions & 69 deletions src/CardUpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,7 @@ class CardUpdateRequest implements \JsonSerializable
protected $client;

/**
* Card update type. Possible values: "new-cvc2" or "other"
* @var string
*/
protected $updateType;

/**
* Card update reason.
* @var string
*/
protected $updateReason;

/**
* Customer preferred scheme, such as carte bancaire vs visa
* Customer preferred scheme, such as carte bancaire vs visa. Can be set to none to clear the previous value
* @var string
*/
protected $preferredScheme;
Expand All @@ -47,53 +35,9 @@ public function __construct(ProcessOut $client, $prefill = array())
}


/**
* Get UpdateType
* Card update type. Possible values: "new-cvc2" or "other"
* @return string
*/
public function getUpdateType()
{
return $this->updateType;
}

/**
* Set UpdateType
* Card update type. Possible values: "new-cvc2" or "other"
* @param string $value
* @return $this
*/
public function setUpdateType($value)
{
$this->updateType = $value;
return $this;
}

/**
* Get UpdateReason
* Card update reason.
* @return string
*/
public function getUpdateReason()
{
return $this->updateReason;
}

/**
* Set UpdateReason
* Card update reason.
* @param string $value
* @return $this
*/
public function setUpdateReason($value)
{
$this->updateReason = $value;
return $this;
}

/**
* Get PreferredScheme
* Customer preferred scheme, such as carte bancaire vs visa
* Customer preferred scheme, such as carte bancaire vs visa. Can be set to none to clear the previous value
* @return string
*/
public function getPreferredScheme()
Expand All @@ -103,7 +47,7 @@ public function getPreferredScheme()

/**
* Set PreferredScheme
* Customer preferred scheme, such as carte bancaire vs visa
* Customer preferred scheme, such as carte bancaire vs visa. Can be set to none to clear the previous value
* @param string $value
* @return $this
*/
Expand All @@ -121,12 +65,6 @@ public function setPreferredScheme($value)
*/
public function fillWithData($data)
{
if(! empty($data['update_type']))
$this->setUpdateType($data['update_type']);

if(! empty($data['update_reason']))
$this->setUpdateReason($data['update_reason']);

if(! empty($data['preferred_scheme']))
$this->setPreferredScheme($data['preferred_scheme']);

Expand All @@ -139,8 +77,6 @@ public function fillWithData($data)
*/
public function jsonSerialize() {
return array(
"update_type" => $this->getUpdateType(),
"update_reason" => $this->getUpdateReason(),
"preferred_scheme" => $this->getPreferredScheme(),
);
}
Expand All @@ -160,8 +96,6 @@ public function update($cardId, $options = array())
$path = "/cards/" . urlencode($cardId) . "";

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

Expand Down
Loading