diff --git a/.gitignore b/.gitignore
index e22ebed..e45637d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/vendor
composer.lock
-.DS_Store
\ No newline at end of file
+.DS_Store
+/nbproject/private/
\ No newline at end of file
diff --git a/Composer-Setup.exe b/Composer-Setup.exe
new file mode 100644
index 0000000..4d41662
Binary files /dev/null and b/Composer-Setup.exe differ
diff --git a/Lib/AlternativePayments/Error/ExceptionBase.php b/Lib/AlternativePayments/Error/ExceptionBase.php
index aedd54e..28383ee 100644
--- a/Lib/AlternativePayments/Error/ExceptionBase.php
+++ b/Lib/AlternativePayments/Error/ExceptionBase.php
@@ -3,7 +3,7 @@
namespace AlternativePayments\Error;
/**
- * Abstract Error class inherented by all specific error classes
+ * Abstract Error class inherited by all specific error classes
*/
abstract class ExceptionBase extends \Exception
{
diff --git a/Lib/AlternativePayments/Model/Element.php b/Lib/AlternativePayments/Model/Element.php
index b63206f..fb4e2a7 100644
--- a/Lib/AlternativePayments/Model/Element.php
+++ b/Lib/AlternativePayments/Model/Element.php
@@ -3,7 +3,7 @@
namespace AlternativePayments\Model;
/**
- * Abstract Model class inherented by all model classes
+ * Abstract Model class inherited by all model classes
*/
abstract class Element
{
diff --git a/Lib/AlternativePayments/Model/Payment.php b/Lib/AlternativePayments/Model/Payment.php
index b5961a8..4389c43 100644
--- a/Lib/AlternativePayments/Model/Payment.php
+++ b/Lib/AlternativePayments/Model/Payment.php
@@ -39,7 +39,6 @@ class Payment extends Element
* @var string
*/
protected $creditCardNumber;
-
/*
* @var string
*/
@@ -49,7 +48,6 @@ class Payment extends Element
* @var string
*/
protected $expirationYear;
-
/*
* @var string
*/
@@ -59,7 +57,10 @@ class Payment extends Element
* @var string
*/
protected $documentId;
-
+ /*
+ * @var string
+ */
+ protected $creditCardType;
/*
* @var string
*/
@@ -211,7 +212,20 @@ public function setExpirationYear($expirationYear)
{
$this->expirationYear = $expirationYear;
}
-
+ /*
+ * @param string
+ */
+ public function setCreditCardType($creditCardType)
+ {
+ $this->creditCardType = $creditCardType;
+ }
+ /*
+ * @param string
+ */
+ public function getCreditCardType($creditCardType)
+ {
+ return $this->creditCardType;
+ }
/*
* @param string
*/
diff --git a/Lib/AlternativePayments/Model/PhoneVerification.php b/Lib/AlternativePayments/Model/PhoneVerification.php
index 72c2d29..d959cf0 100644
--- a/Lib/AlternativePayments/Model/PhoneVerification.php
+++ b/Lib/AlternativePayments/Model/PhoneVerification.php
@@ -4,44 +4,45 @@
class PhoneVerification extends Element
{
-
/*
* @var string
*/
- protected $pin;
-
+ protected $phone;
+
/*
* @var string
*/
- protected $token;
+ protected $key;
/*
* @return string
*/
- public function getPin()
+ public function getPhone()
{
- return $this->pin;
+ return $this->phone;
}
+
/*
- * @param string
+ * @var string
*/
- public function setPin($pin)
+ public function setPhone($phone)
{
- $this->pin = $pin;
+ $this->phone = $phone;
}
-
+
/*
- * @return string
+ * @var string
*/
- public function getToken()
+ public function getKey()
{
- return $this->token;
+ return $this->key;
}
+
/*
- * @param string
+ * @var string
*/
- public function setToken($token)
+ public function setKey($key)
{
- $this->token = $token;
+ $this->key = $key;
}
}
diff --git a/Lib/AlternativePayments/Model/Plan.php b/Lib/AlternativePayments/Model/Plan.php
index 09d268d..13230ff 100644
--- a/Lib/AlternativePayments/Model/Plan.php
+++ b/Lib/AlternativePayments/Model/Plan.php
@@ -8,7 +8,12 @@ class Plan extends Element
/*
* @var string
*/
- protected $merchantIdentification;
+ protected $name;
+
+ /*
+ * @var string
+ */
+ protected $description;
/*
* @var integer
@@ -19,63 +24,69 @@ class Plan extends Element
* @var string
*/
protected $currency;
-
+
/*
- * @var integer
+ * @var string
*/
- protected $period;
-
+ protected $intervalUnit;
+
/*
* @var integer
*/
- protected $interval;
-
+ protected $intervalCount;
+
/*
* @var integer
*/
- protected $recurTimes;
-
+ protected $billingCycles;
+
/*
- * @var integer
+ * @var string
*/
- protected $trialDays;
-
+ protected $isConversionRateFixed;
+
/*
* @var integer
*/
- protected $discountAmount;
-
+ protected $ipAddress;
+
/*
* @var integer
*/
- protected $discountRecurTimes;
-
+ protected $trialPeriod;
+
/*
- * @var string
+ * @return string
*/
- protected $name;
-
+ public function getName()
+ {
+ return $this->name;
+ }
+
/*
- * @var string
+ * @return string
*/
- protected $description;
-
-
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+
/*
- * @return string
+ * @return integer
*/
- public function getMerchantIdentification()
+ public function getDescription()
{
- return $this->merchantIdentification;
+ return $this->description;
}
+
/*
- * @param string
+ * @return integer
*/
- public function setMerchantIdentification($merchantIdentification)
+ public function setDescription($description)
{
- $this->merchantIdentification = $merchantIdentification;
+ $this->description = $description;
}
-
+
/*
* @return integer
*/
@@ -83,6 +94,7 @@ public function getAmount()
{
return $this->amount;
}
+
/*
* @param integer
*/
@@ -90,140 +102,116 @@ public function setAmount($amount)
{
$this->amount = $amount;
}
-
-
+
/*
- * @return string
+ * @return integer
*/
public function getCurrency()
{
return $this->currency;
}
+
/*
- * @param string
+ * @return integer
*/
public function setCurrency($currency)
{
$this->currency = $currency;
}
-
+
/*
* @return integer
*/
- public function getPeriod()
- {
- return $this->period;
- }
- /*
- * @param integer
- */
- public function setPeriod($period)
+ public function getintervalUnit()
{
- $this->period = $period;
+ return $this->intervalUnit;
}
-
+
/*
* @return integer
*/
- public function getInterval()
+ public function setIntervalUnit($intervalUnit)
{
- return $this->interval;
+ $this->intervalUnit = $intervalUnit;
}
- /*
- * @param integer
- */
- public function setInterval($interval)
- {
- $this->interval = $interval;
- }
-
+
/*
* @return integer
*/
- public function getRecurTimes()
+ public function getIntervalCount($intervalCount)
{
- return $this->recurTimes;
+ return $this->intervalCount;
}
- /*
- * @param integer
- */
- public function setRecurTimes($recurTimes)
- {
- $this->recurTimes = $recurTimes;
- }
-
+
/*
* @return integer
*/
- public function getTrialDays()
- {
- return $this->trialDays;
- }
- /*
- * @param integer
- */
- public function setTrialDays($trialDays)
+ public function setIntervalCount($intervalCount)
{
- $this->trialDays = $trialDays;
+ $this->intervalCount = $intervalCount;
}
-
+
/*
* @return integer
*/
- public function getDiscountAmount()
+ public function getBillingCycle()
{
- return $this->discountAmount;
+ return $this->billingCycles;
}
+
/*
- * @param integer
+ * @return integer
*/
- public function setDiscountAmount($discountAmount)
+ public function setBillingCycle($billingCycle)
{
- $this->discountAmount = $discountAmount;
+ $this->billingCycles = $billingCycle;
}
-
+
/*
* @return integer
*/
- public function getDiscountRecurTimes()
+ public function getIsConversionRateFixed()
{
- return $this->discountRecurTimes;
+ return $this->isConversionRateFixed;
}
+
/*
- * @param integer
+ * @return integer
*/
- public function setDiscountRecurTimes($discountRecurTimes)
+ public function setIsConversionRateFixed($isConversionRateFixed)
{
- $this->discountRecurTimes = $discountRecurTimes;
+ $this->isConversionRateFixed = $isConversionRateFixed;
}
-
+
/*
- * @return string
+ * @return integer
*/
- public function getName()
+ public function getIpAddress($ipAddress)
{
- return $this->name;
+ return $ipAddress->ipAddress;
}
+
/*
- * @param string
+ * @return integer
*/
- public function setName($name)
+ public function setIpAddress($ipAddress)
{
- $this->name = $name;
+ $this->ipAddress = $ipAddress;
}
-
+
/*
- * @return string
+ * @return integer
*/
- public function getDescription()
+ public function getTrialPeriod()
{
- return $this->description;
+ return $this->trialPeriod;
}
+
/*
- * @param string
+ * @return integer
*/
- public function setDescription($description)
+ public function setTrialPeriod($trialPeriod)
{
- $this->description = $description;
+ $this->trialPeriod = $trialPeriod;
}
}
diff --git a/Lib/AlternativePayments/Model/Refund.php b/Lib/AlternativePayments/Model/Refund.php
index 6f356a3..3e6c85f 100644
--- a/Lib/AlternativePayments/Model/Refund.php
+++ b/Lib/AlternativePayments/Model/Refund.php
@@ -42,6 +42,7 @@ public function getAmount()
{
return $this->amount;
}
+
/*
* @param integer
*/
@@ -72,7 +73,10 @@ public function getReason()
{
return $this->reason;
}
-
+
+ /*
+ * @param string
+ */
public function setReason($reason)
{
$this->reason = $reason;
@@ -85,6 +89,7 @@ public function getOriginalTransactionCode()
{
return $this->originalTransactionCode;
}
+
/*
* @param string
*/
@@ -103,7 +108,7 @@ public function getCreated()
/*
* @param string
*/
- public function setCretaed($created)
+ public function setCreated($created)
{
$this->created = $created;
}
@@ -115,6 +120,7 @@ public function getRequestIp()
{
return $this->requestIp;
}
+
/*
* @param string
*/
diff --git a/Lib/AlternativePayments/Model/Subscription.php b/Lib/AlternativePayments/Model/Subscription.php
index 16c414f..ebdb4d5 100644
--- a/Lib/AlternativePayments/Model/Subscription.php
+++ b/Lib/AlternativePayments/Model/Subscription.php
@@ -19,6 +19,11 @@ class Subscription extends Element
* @var string
*/
protected $paymentId;
+
+ /*
+ * @var string
+ */
+ protected $ipAddress;
/*
* @return string
@@ -27,6 +32,7 @@ public function getPlanId()
{
return $this->planId;
}
+
/*
* @param string
*/
@@ -42,6 +48,7 @@ public function getCustomerId()
{
return $this->customerId;
}
+
/*
* @param string
*/
@@ -57,6 +64,7 @@ public function getPaymentId()
{
return $this->paymentId;
}
+
/*
* @param string
*/
@@ -64,4 +72,20 @@ public function setPaymentId($paymentId)
{
$this->paymentId = $paymentId;
}
+
+ /*
+ * @param string
+ */
+ public function getIPAddress()
+ {
+ return $this->ipAddress;
+ }
+
+ /*
+ * @param string
+ */
+ public function setIPAddress($ipAddress)
+ {
+ $this->ipAddress = $ipAddress;
+ }
}
diff --git a/Lib/AlternativePayments/Model/TokenSms.php b/Lib/AlternativePayments/Model/TokenSms.php
new file mode 100644
index 0000000..668d927
--- /dev/null
+++ b/Lib/AlternativePayments/Model/TokenSms.php
@@ -0,0 +1,46 @@
+token;
+ }
+
+ /*
+ * @var string
+ */
+ public function setToken($token)
+ {
+ $this->token = $token;
+ }
+ /*
+ * @var string
+ */
+ public function getPin()
+ {
+ return $this->pin;
+ }
+ /*
+ * @var string
+ */
+ public function setPin($pin)
+ {
+ $this->pin = $pin;
+ }
+}
diff --git a/Lib/AlternativePayments/Model/Transaction.php b/Lib/AlternativePayments/Model/Transaction.php
index 970e0f6..bf5fa5e 100644
--- a/Lib/AlternativePayments/Model/Transaction.php
+++ b/Lib/AlternativePayments/Model/Transaction.php
@@ -9,7 +9,13 @@ class Transaction extends Element
* @var \AlternativePayments\Model\Customer
*/
protected $customer;
-
+
+
+ /*
+ * @var integer
+ */
+ protected $pin;
+
/*
* @var \AlternativePayments\Model\Payment
*/
@@ -40,7 +46,7 @@ class Transaction extends Element
*/
protected $merchantPassThruData;
- /*
+ /*
* @var string
*/
protected $merchantTransactionId;
@@ -125,6 +131,7 @@ public function getAmount()
{
return $this->amount;
}
+
/*
* @param integer
*/
@@ -172,6 +179,7 @@ public function getPhoneVerification()
{
return $this->phoneVerification;
}
+
/*
* @param \AlternativePayments\Model\PhoneVerification
*/
@@ -187,6 +195,7 @@ public function setMerchantPassThruData($merchantPassThruData)
{
$this->merchantPassThruData = $merchantPassThruData;
}
+
/*
* @return string
*/
@@ -195,13 +204,14 @@ public function getMerchantPassThruData()
return $this->merchantPassThruData;
}
- /*
+ /*
* @param string
*/
public function setMerchantTransactionId($merchantTransactionId)
{
$this->merchantTransactionId = $merchantTransactionId;
}
+
/*
* @return string
*/
@@ -229,7 +239,7 @@ public function getDescription()
/*
* @param string
*/
- public function setIpAddress($ipAddress)
+ public function setIPAddress($ipAddress)
{
$this->ipAddress = $ipAddress;
}
@@ -237,7 +247,7 @@ public function setIpAddress($ipAddress)
/*
* @return string
*/
- public function getIpAddress()
+ public function getIPAddress()
{
return $this->ipAddress;
}
@@ -289,6 +299,21 @@ public function setInitialTransactionId($initialTransactionId)
{
$this->initialTransactionId = $initialTransactionId;
}
-
+
+ /*
+ * @param integer
+ */
+ public function getPin()
+ {
+ return $this->pin;
+ }
+
+ /*
+ * @return integer
+ */
+ public function setPin($pin)
+ {
+ $this->pin = $pin;
+ }
}
diff --git a/Lib/AlternativePayments/Model/Void.php b/Lib/AlternativePayments/Model/Void.php
index 2098fa9..165119f 100644
--- a/Lib/AlternativePayments/Model/Void.php
+++ b/Lib/AlternativePayments/Model/Void.php
@@ -48,6 +48,7 @@ public function getCurrency()
{
return $this->currency;
}
+
/*
* @param string
*/
diff --git a/Lib/AlternativePayments/PhoneVerification.php b/Lib/AlternativePayments/PhoneVerification.php
new file mode 100644
index 0000000..c6dcc75
--- /dev/null
+++ b/Lib/AlternativePayments/PhoneVerification.php
@@ -0,0 +1,26 @@
+getAll(self::RESOURCE);
+ }
+
+ public static function get($code)
+ {
+ $service = new Request;
+ return $service->get(self::RESOURCE, $code);
+ }
+
+ public static function post($data)
+ {
+ $service = new Request;
+ return $service->post(self::RESOURCE, $data);
+ }
+}
diff --git a/Lib/AlternativePayments/Request.php b/Lib/AlternativePayments/Request.php
index ed6775d..b90a295 100644
--- a/Lib/AlternativePayments/Request.php
+++ b/Lib/AlternativePayments/Request.php
@@ -8,7 +8,7 @@
use AlternativePayments\Error\InvalidParameterException;
/**
- * Abstract Service class inherented by all services
+ * Abstract Service class inherited by all services
*/
class Request
{
@@ -151,6 +151,7 @@ protected function curlRequest($ctrl, $method, $param)
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_POSTFIELDS, $param);
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
diff --git a/Lib/AlternativePayments/TokenSms.php b/Lib/AlternativePayments/TokenSms.php
new file mode 100644
index 0000000..7567242
--- /dev/null
+++ b/Lib/AlternativePayments/TokenSms.php
@@ -0,0 +1,26 @@
+getAll(self::RESOURCE);
+ }
+
+ public static function get($code)
+ {
+ $service = new Request;
+ return $service->get(self::RESOURCE, $code);
+ }
+
+ public static function post($data)
+ {
+ $service = new Request;
+ return $service->post(self::RESOURCE, $data);
+ }
+}
diff --git a/nbproject/project.properties b/nbproject/project.properties
new file mode 100644
index 0000000..b038207
--- /dev/null
+++ b/nbproject/project.properties
@@ -0,0 +1,7 @@
+include.path=${php.global.include.path}
+php.version=PHP_70
+source.encoding=UTF-8
+src.dir=Lib
+tags.asp=false
+tags.short=false
+web.root=.
diff --git a/nbproject/project.xml b/nbproject/project.xml
new file mode 100644
index 0000000..242710b
--- /dev/null
+++ b/nbproject/project.xml
@@ -0,0 +1,9 @@
+
+