From 7c370b1cadd9824880b03604ac61c64ff06d1c02 Mon Sep 17 00:00:00 2001 From: paymentwall-dev Date: Fri, 17 Jan 2014 21:10:03 +0200 Subject: [PATCH] Update Intval Comparison operator trialProduct --- lib/Paymentwall/Pingback.php | 8 +++++--- lib/Paymentwall/Product.php | 8 +++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Paymentwall/Pingback.php b/lib/Paymentwall/Pingback.php index 6498eca..dd90b7a 100755 --- a/lib/Paymentwall/Pingback.php +++ b/lib/Paymentwall/Pingback.php @@ -67,6 +67,8 @@ public function validate($skipIpWhitelistCheck = false) */ public function isSignatureValid() { + $signatureParamsToSign = array(); + if (self::getApiType() == self::API_VC) { $signatureParams = array('uid', 'currency', 'type', 'ref'); @@ -177,7 +179,7 @@ public function getType() if (!empty($this->parameters['type'])) { if (in_array($this->parameters['type'], $pingbackTypes)) { - return $this->parameters['type']; + return intval($this->parameters['type']); } } } @@ -288,7 +290,7 @@ public function getPingbackUniqueId() */ public function isDeliverable() { - return ($this->getType() == self::PINGBACK_TYPE_REGULAR || $this->getType() == self::PINGBACK_TYPE_GOODWILL); + return ($this->getType() === self::PINGBACK_TYPE_REGULAR || $this->getType() === self::PINGBACK_TYPE_GOODWILL); } /** @@ -298,7 +300,7 @@ public function isDeliverable() */ public function isCancelable() { - return $this->getType() == self::PINGBACK_TYPE_NEGATIVE; + return $this->getType() === self::PINGBACK_TYPE_NEGATIVE; } /** diff --git a/lib/Paymentwall/Product.php b/lib/Paymentwall/Product.php index e3fdb55..e61bfdd 100755 --- a/lib/Paymentwall/Product.php +++ b/lib/Paymentwall/Product.php @@ -36,10 +36,8 @@ public function __construct($productId, $amount = 0.0, $currencyCode = null, $na $this->productType = $productType; $this->periodLength = $periodLength; $this->periodType = $periodType; - $this->reccuring = $recurring; - if ($productType == Paymentwall_Product::TYPE_SUBSCRIPTION && $recurring) { - $this->trialProduct = $trialProduct; - } + $this->recurring = $recurring; + $this->trialProduct = ($productType == Paymentwall_Product::TYPE_SUBSCRIPTION && $recurring) ? $trialProduct : null; } /** @@ -103,7 +101,7 @@ public function getPeriodLength() */ public function isRecurring() { - return $this->reccuring; + return $this->recurring; } /**