Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennelandais committed Jun 3, 2019
2 parents e9f6331 + a2aa0ae commit a60f622
Show file tree
Hide file tree
Showing 45 changed files with 1,390 additions and 489 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Version 2.2.0
- Update payment product collection

# Version 2.1.0
- Add payment token lookup method

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"payment method"
],
"homepage" : "https://hipay.com/product-enterprise/",
"version" : "2.1.0",
"version" : "2.2.0",
"license" : "Apache-2.0",
"authors" : [{
"name" : "HiPay",
Expand Down
221 changes: 158 additions & 63 deletions lib/HiPay/Fullservice/Data/PaymentProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 Licence
*
*/

namespace HiPay\Fullservice\Data;


/**
* Payment product object
*
*
* @package HiPay\Fullservice
* @author Kassim Belghait <[email protected]>
* @copyright Copyright (c) 2016 - HiPay
Expand All @@ -28,120 +29,214 @@
*/
class PaymentProduct
{

public function __construct($productCode,$brandName,$category,$can3ds = false,$canRefund = false,$canRecurring = false ,$comment = '',$basketRequired = false){

$this->_productCode = $productCode;
$this->_brandName = $brandName;
$this->_category = $category;
$this->_can3ds = $can3ds;
$this->_canRefund = $canRefund;
$this->_canRecurring = $canRecurring;
$this->_comment = $comment;
$this->_basketRequired = $basketRequired;


/**
* PaymentProduct constructor.
*
* @param $paymentProductData
*/
public function __construct($paymentProductData)
{

foreach ($paymentProductData as $key => $data) {
if (property_exists($this, $key)) {
$this->{$key} = $data;
}
}
}


/**
* @var string $productCode Product code (cd,mastercard,visa etc ...)
*/
private $productCode;

/**
* @var string $_productCode Product code (cd,mastercard,visa etc ...)
* @var string $brandName Human readable value
*/
private $_productCode;
private $brandName;

/**
* @var string $_brandName Human readable value
* @var $category Brand's category
*/
private $_brandName;
private $category;

/**
* @var bool $_can3ds If can process 3ds payment
* @var string $comment A short brand description
*/
private $_can3ds = false;
private $comment = '';

/**
*
* @var bool $_canRefund Payment product accept refunds
* @var bool $can3ds If can process 3ds payment
*/
private $_canRefund = false;
private $can3ds = false;

/**
*
* @var bool $_canRecurring Payment product accept refunds
* @var bool $canRecurring Payment product accept refunds
*/
private $_canRecurring = false;
private $canRecurring = false;

/**
*
* @var $_category Brand's category
* @var bool $canManualCapture Payment product accept manual capture
*/
private $_category;
private $canManualCapture = false;

/**
* @var string $_comment A short brand description
* @var bool $canManualCapturePartially Payment product accept partial manual capture
*/
private $_comment = '';
private $canManualCapturePartially = false;

/**
* @var bool $canRefund Payment product accept refunds
*/
private $canRefund = false;

/**
* @var bool $canRefundPartially ayment product accept partial refunds
*/
private $canRefundPartially = false;

/**
* @var boolean Cart items is required for the payment method
*/
private $_basketRequired = false;
private $basketRequired = false;

/**
* @var array $currencies currencies accepted by the payment method, no restriction if empty
*/
private $currencies = array();

/**
* @var array $countries countries accepted by the payment method, no restriction if empty
*/
private $countries = array();

/**
* @var array $checkoutFieldsMandatory mandatory information to provide when requesting a new transaction
*/
private $checkoutFieldsMandatory = array();

/**
* @var array $additionalFields information about payment method specific fields, no specific fields if empty
*/
private $additionalFields = array();

/**
* @return string
*/
public function getProductCode() {
return $this->_productCode;
}
public function getProductCode()
{
return $this->productCode;
}

/**
* @return string
*/
public function getBrandName() {
return $this->_brandName;
}
public function getBrandName()
{
return $this->brandName;
}

/**
* @return bool
*/
public function getCan3ds() {
return $this->_can3ds;
}
public function getCan3ds()
{
return (bool)$this->can3ds;
}

/**
* @return bool
*/
public function getCanRefund() {
return $this->_canRefund;
}
public function getCanRefund()
{
return (bool)$this->canRefund;
}

/**
* @return bool|Payment
* @return bool
*/
public function getCanRecurring() {
return $this->_canRecurring;
}
public function getCanRecurring()
{
return (bool)$this->canRecurring;
}

/**
* @return string
*/
public function getComment() {
return $this->_comment;
}
public function getComment()
{
return $this->comment;
}

/**
* @return Brand
* @return string
*/
public function getCategory() {
return $this->_category;
}
public function getCategory()
{
return $this->category;
}

/**
* @return bool
*/
public function getBasketRequired()
{
return $this->_basketRequired;
return (bool)$this->basketRequired;
}

/**
* @return bool
*/
public function getCanManualCapture()
{
return (bool)$this->canManualCapture;
}

/**
* @return bool
*/
public function getCanManualCapturePartially()
{
return (bool)$this->canManualCapturePartially;
}

}
/**
* @return bool
*/
public function getCanRefundPartially()
{
return (bool)$this->canRefundPartially;
}

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

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

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

/**
* @return array
*/
public function getAdditionalFields()
{
return $this->additionalFields;
}
}
Loading

0 comments on commit a60f622

Please sign in to comment.