From 6d7f19ec78e085ec6dc00e251a73d120f1b11064 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 24 Jan 2019 20:08:00 -0500 Subject: [PATCH 001/105] Updated to a minimum PHP 7.2 compatibility --- src/authnet/AuthnetApiFactory.php | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index 91e045c..f63585f 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -42,7 +42,7 @@ class AuthnetApiFactory const USE_AKAMAI_SERVER = 2; /** - * Validates the Authorize.Net credentials and returns a Request object to be used to make an API call + Validates the Authorize.Net credentials and returns a Request object to be used to make an API call * * @param string $login Authorize.Net API Login ID * @param string $transaction_key Authorize.Net API Transaction Key @@ -52,7 +52,7 @@ class AuthnetApiFactory * @throws \JohnConde\Authnet\AuthnetInvalidCredentialsException * @throws \JohnConde\Authnet\AuthnetInvalidServerException */ - public static function getJsonApiHandler($login, $transaction_key, $server = self::USE_AKAMAI_SERVER) + public static function getJsonApiHandler(string $login, string $transaction_key, $server = self::USE_AKAMAI_SERVER) : object { $login = trim($login); $transaction_key = trim($transaction_key); @@ -81,7 +81,7 @@ public static function getJsonApiHandler($login, $transaction_key, $server = sel * @return string The URL endpoint the request is to be sent to * @throws \JohnConde\Authnet\AuthnetInvalidServerException */ - protected static function getWebServiceURL($server) + protected static function getWebServiceURL(int $server) : string { $urls = [ static::USE_PRODUCTION_SERVER => 'https://api.authorize.net/xml/v1/request.api', @@ -104,7 +104,7 @@ protected static function getWebServiceURL($server) * @throws \JohnConde\Authnet\AuthnetInvalidCredentialsException * @throws \JohnConde\Authnet\AuthnetInvalidServerException */ - public static function getSimHandler($login, $transaction_key, $server = self::USE_PRODUCTION_SERVER) + public static function getSimHandler(string $login, string $transaction_key, $server = self::USE_PRODUCTION_SERVER) : object { $login = trim($login); $transaction_key = trim($transaction_key); @@ -124,16 +124,16 @@ public static function getSimHandler($login, $transaction_key, $server = self::U * @return string The URL endpoint the request is to be sent to * @throws \JohnConde\Authnet\AuthnetInvalidServerException */ - protected static function getSimURL($server) + protected static function getSimURL(int $server) : string { - if ($server === static::USE_PRODUCTION_SERVER) { - $url = 'https://secure2.authorize.net/gateway/transact.dll'; - } else if ($server === static::USE_DEVELOPMENT_SERVER) { - $url = 'https://test.authorize.net/gateway/transact.dll'; - } else { - throw new AuthnetInvalidServerException('You did not provide a valid server.'); + $urls = [ + static::USE_PRODUCTION_SERVER => 'https://secure2.authorize.net/gateway/transact.dll', + static::USE_DEVELOPMENT_SERVER => 'https://test.authorize.net/gateway/transact.dll', + ]; + if (array_key_exists($server, $urls)) { + return $urls[$server]; } - return $url; + throw new AuthnetInvalidServerException('You did not provide a valid server.'); } /** @@ -147,7 +147,7 @@ protected static function getSimURL($server) * @throws \JohnConde\Authnet\AuthnetInvalidCredentialsException * @throws \JohnConde\Authnet\AuthnetInvalidServerException */ - public static function getWebhooksHandler($login, $transaction_key, $server = self::USE_PRODUCTION_SERVER) + public static function getWebhooksHandler(string $login, string $transaction_key, $server = self::USE_PRODUCTION_SERVER) : object { $login = trim($login); $transaction_key = trim($transaction_key); @@ -179,15 +179,15 @@ public static function getWebhooksHandler($login, $transaction_key, $server = se * @return string The URL endpoint the request is to be sent to * @throws \JohnConde\Authnet\AuthnetInvalidServerException */ - protected static function getWebhooksURL($server) + protected static function getWebhooksURL(int $server) : string { - if ($server === static::USE_PRODUCTION_SERVER) { - $url = 'https://api.authorize.net/rest/v1/'; - } else if ($server === static::USE_DEVELOPMENT_SERVER) { - $url = 'https://apitest.authorize.net/rest/v1/'; - } else { - throw new AuthnetInvalidServerException('You did not provide a valid server.'); + $urls = [ + static::USE_PRODUCTION_SERVER => 'https://api.authorize.net/rest/v1/', + static::USE_DEVELOPMENT_SERVER => 'https://apitest.authorize.net/rest/v1/', + ]; + if (array_key_exists($server, $urls)) { + return $urls[$server]; } - return $url; + throw new AuthnetInvalidServerException('You did not provide a valid server.'); } } \ No newline at end of file From 5f28d2878c39b463d4f6230607599aabcf2f3671 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 24 Jan 2019 20:09:30 -0500 Subject: [PATCH 002/105] Updated to reflect changes for PHP 7.2 compatibility --- tests/AuthnetApiFactoryTest.php | 41 ++++++++------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/tests/AuthnetApiFactoryTest.php b/tests/AuthnetApiFactoryTest.php index 5c08b62..1d2b364 100644 --- a/tests/AuthnetApiFactoryTest.php +++ b/tests/AuthnetApiFactoryTest.php @@ -85,7 +85,7 @@ public function testGetWebServiceUrlBadServer() public function testExceptionIsRaisedForInvalidCredentialsLogin() { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; - AuthnetApiFactory::getJsonApiHandler(null, $this->transactionKey, $server); + AuthnetApiFactory::getJsonApiHandler('', $this->transactionKey, $server); } /** @@ -96,7 +96,7 @@ public function testExceptionIsRaisedForInvalidCredentialsLogin() public function testExceptionIsRaisedForInvalidCredentialsTransactionKey() { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; - AuthnetApiFactory::getJsonApiHandler($this->login, null, $server); + AuthnetApiFactory::getJsonApiHandler($this->login, '', $server); } /** @@ -105,7 +105,7 @@ public function testExceptionIsRaisedForInvalidCredentialsTransactionKey() */ public function testExceptionIsRaisedForAuthnetInvalidServer() { - AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, null); + AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, 5); } /** @@ -160,7 +160,7 @@ public function testGetSimHandler() public function testExceptionIsRaisedForInvalidCredentialsSim() { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; - AuthnetApiFactory::getSimHandler(null, $this->transactionKey, $server); + AuthnetApiFactory::getSimHandler('', $this->transactionKey, $server); } /** @@ -171,7 +171,7 @@ public function testGetSimServerTest() $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getSimURL'); $reflectionMethod->setAccessible(true); - $url = $reflectionMethod->invoke(null, $server); + $url = $reflectionMethod->invoke($reflectionMethod, $server); $this->assertEquals($url, 'https://test.authorize.net/gateway/transact.dll'); } @@ -184,7 +184,7 @@ public function testGetSimServerProduction() $server = AuthnetApiFactory::USE_PRODUCTION_SERVER; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getSimURL'); $reflectionMethod->setAccessible(true); - $url = $reflectionMethod->invoke(null, $server); + $url = $reflectionMethod->invoke($reflectionMethod, $server); $this->assertEquals($url, 'https://secure2.authorize.net/gateway/transact.dll'); } @@ -195,18 +195,9 @@ public function testGetSimServerProduction() */ public function testExceptionIsRaisedForAuthnetInvalidSimServer() { - AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, null); + AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, 5); } - - - - - - - - - /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksHandler * @uses \JohnConde\Authnet\AuthnetWebhooksRequest @@ -215,7 +206,7 @@ public function testExceptionIsRaisedForAuthnetInvalidSimServer() public function testExceptionIsRaisedForInvalidCredentialsLoginWebhooks() { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; - AuthnetApiFactory::getWebhooksHandler(null, $this->transactionKey, $server); + AuthnetApiFactory::getWebhooksHandler('', $this->transactionKey, $server); } /** @@ -226,7 +217,7 @@ public function testExceptionIsRaisedForInvalidCredentialsLoginWebhooks() public function testExceptionIsRaisedForInvalidCredentialsTransactionKeyWebhooks() { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; - AuthnetApiFactory::getWebhooksHandler($this->login, null, $server); + AuthnetApiFactory::getWebhooksHandler($this->login, '', $server); } /** @@ -235,7 +226,7 @@ public function testExceptionIsRaisedForInvalidCredentialsTransactionKeyWebhooks */ public function testExceptionIsRaisedForAuthnetInvalidServerWebhooks() { - AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, null); + AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, 5); } /** @@ -272,18 +263,6 @@ public function testCurlWrapperDevelopmentResponseWebhooks() $this->assertInstanceOf('\Curl\Curl', $processor); } - - - - - - - - - - - - /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksURL */ From 4f80c57c929d955526d63640e2bc2104f48386cb Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 24 Jan 2019 20:10:00 -0500 Subject: [PATCH 003/105] Updated to reflect minimum PHP 7.2 compatibility --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4cfb340..f79c0d4 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=5.4.0", + "php": ">=7.2.0", "curl/curl": "^1.5", "ext-json": "*", "ext-curl": "*" From 825a11e78cb2a82830938c766c8e4d6e5b6115f3 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 24 Jan 2019 20:11:39 -0500 Subject: [PATCH 004/105] Fixed incorrect indent --- src/authnet/AuthnetApiFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index f63585f..22daed4 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -89,7 +89,7 @@ protected static function getWebServiceURL(int $server) : string static::USE_AKAMAI_SERVER => 'https://api2.authorize.net/xml/v1/request.api' ]; if (array_key_exists($server, $urls)) { - return $urls[$server]; + return $urls[$server]; } throw new AuthnetInvalidServerException('You did not provide a valid server.'); } From bc18da014465dc689202eabeb99f3a2d3d22ebb6 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 24 Jan 2019 20:29:06 -0500 Subject: [PATCH 005/105] Changed server parameter to be nullable so it can be type hinted and set default inside the constructor --- src/authnet/AuthnetApiFactory.php | 3 ++- src/authnet/AuthnetWebhooksResponse.php | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index 22daed4..6c9a07b 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -52,10 +52,11 @@ class AuthnetApiFactory * @throws \JohnConde\Authnet\AuthnetInvalidCredentialsException * @throws \JohnConde\Authnet\AuthnetInvalidServerException */ - public static function getJsonApiHandler(string $login, string $transaction_key, $server = self::USE_AKAMAI_SERVER) : object + public static function getJsonApiHandler(string $login, string $transaction_key, ?int $server) : object { $login = trim($login); $transaction_key = trim($transaction_key); + $server = $server ?? self::USE_AKAMAI_SERVER; $api_url = static::getWebServiceURL($server); if (empty($login) || empty($transaction_key)) { diff --git a/src/authnet/AuthnetWebhooksResponse.php b/src/authnet/AuthnetWebhooksResponse.php index 910c328..875100b 100644 --- a/src/authnet/AuthnetWebhooksResponse.php +++ b/src/authnet/AuthnetWebhooksResponse.php @@ -100,9 +100,7 @@ public function getEventTypes() $events[] = $event; } } else { - foreach ($this->response as $event) { - $events[] = $event->name; - } + $events = array_column($this->response, 'name'); } return $events; } From 55e4e069385ec4a76d0c79f2ea8f2588bda32959 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 24 Jan 2019 20:33:24 -0500 Subject: [PATCH 006/105] Removed commented out test --- CHANGELOG | 7 +++++++ tests/AuthnetWebhooksResponseTest.php | 18 ------------------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0452b94..2f0a3f3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,12 @@ CHANGE LOG +2019-XX-XX - Version 4.0.0 +-------------------------------------------- +Removed not actually missing return statement to AuthnetWebhooksRequest::delete +Reduced complexity of AuthnetApiFactory::getWebServiceURL)( +Reduced complexity of AuthnetWebhooksResponse::getEventTypes() + + 2019-01-22 - Version 3.1.7 -------------------------------------------- Fixed incorrect and/or incomplete docblock comments diff --git a/tests/AuthnetWebhooksResponseTest.php b/tests/AuthnetWebhooksResponseTest.php index df9ca7e..9ea1659 100644 --- a/tests/AuthnetWebhooksResponseTest.php +++ b/tests/AuthnetWebhooksResponseTest.php @@ -69,24 +69,6 @@ public function testToString() $this->assertContains('active', $string); } -// /** -// * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::__get() -// */ -// public function testGet() -// { -// $responseJson = '{ -// "url": "http://example.com", -// "eventTypes": [ -// "net.authorize.payment.authorization.created" -// ], -// "status": "active" -// }'; -// -// $response = new AuthnetJsonResponse($responseJson); -// -// $this->assertEquals('http://example.com', $response->url); -// } - /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::getEventTypes() */ From ebee70747f9942286117636fd62f9927b1149243 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 24 Jan 2019 20:38:18 -0500 Subject: [PATCH 007/105] Removed complexity by changing foreach loop to array_filter() --- src/authnet/AuthnetWebhook.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/authnet/AuthnetWebhook.php b/src/authnet/AuthnetWebhook.php index 66d1d6d..9920152 100644 --- a/src/authnet/AuthnetWebhook.php +++ b/src/authnet/AuthnetWebhook.php @@ -130,15 +130,12 @@ public function getRequestId() */ protected function getAllHeaders() { - $headers = []; if (function_exists('apache_request_headers')) { $headers = apache_request_headers(); } else { - foreach ($_SERVER as $name => $value) { - if (substr(strtoupper($name), 0, 5) == 'HTTP_') { - $headers[str_replace(' ', '-', ucwords(strtoupper(str_replace('_', ' ', substr($name, 5)))))] = $value; - } - } + $headers = array_filter($_SERVER, function ($key) { + return strpos($key, 'HTTP_') === 0; + }, ARRAY_FILTER_USE_KEY); } return $headers; } From 69e8dd441c29829807322623df84e1a0f7cfa283 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 24 Jan 2019 21:20:29 -0500 Subject: [PATCH 008/105] Fixed errant space between function name and parenthesis --- src/authnet/AuthnetWebhook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/authnet/AuthnetWebhook.php b/src/authnet/AuthnetWebhook.php index 9920152..807a1f6 100644 --- a/src/authnet/AuthnetWebhook.php +++ b/src/authnet/AuthnetWebhook.php @@ -133,7 +133,7 @@ protected function getAllHeaders() if (function_exists('apache_request_headers')) { $headers = apache_request_headers(); } else { - $headers = array_filter($_SERVER, function ($key) { + $headers = array_filter($_SERVER, function($key) { return strpos($key, 'HTTP_') === 0; }, ARRAY_FILTER_USE_KEY); } From e8198550292a87427bbb431b93d2226e04acd693 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 24 Jan 2019 22:17:06 -0500 Subject: [PATCH 009/105] Added space after ### so Github would be happy --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ac4f48..04701a6 100644 --- a/README.md +++ b/README.md @@ -358,7 +358,7 @@ usage of this library. Simple `echo` your AuthnetJson object to see: - The request JSON - The response JSON -###Basic Usage: +### Basic Usage: $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY); $response = $request->getUnsettledTransactionListRequest(); From 1f34b69e49b93188e32c802a9d6a3523dabe753c Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 25 Jan 2019 23:17:49 -0500 Subject: [PATCH 010/105] Removed unnecessary $output = '' from __toString() --- src/authnet/AuthnetJsonRequest.php | 3 +-- src/authnet/AuthnetJsonResponse.php | 3 +-- src/authnet/AuthnetWebhook.php | 3 +-- src/authnet/AuthnetWebhooksRequest.php | 3 +-- src/authnet/AuthnetWebhooksResponse.php | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php index 38e8548..0c88f1d 100644 --- a/src/authnet/AuthnetJsonRequest.php +++ b/src/authnet/AuthnetJsonRequest.php @@ -104,8 +104,7 @@ public function __construct($login, $transactionKey, $api_url) */ public function __toString() { - $output = ''; - $output .= ''."\n"; + $output = '
'."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php index 03157d5..309e679 100644 --- a/src/authnet/AuthnetJsonResponse.php +++ b/src/authnet/AuthnetJsonResponse.php @@ -129,8 +129,7 @@ public function __construct($responseJson) */ public function __toString() { - $output = ''; - $output .= '
Class Parameters
API Login ID'.$this->login.'
Transaction Key'.$this->transactionKey.'
'."\n"; + $output = '
'."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ' - + - +
Response JSON
'."\n";
         $output .= $this->responseJson."\n";
diff --git a/src/authnet/AuthnetWebhook.php b/src/authnet/AuthnetWebhook.php
index 807a1f6..3ae20aa 100644
--- a/src/authnet/AuthnetWebhook.php
+++ b/src/authnet/AuthnetWebhook.php
@@ -76,8 +76,7 @@ public function __construct($signature, $payload, Array $headers = [])
      */
     public function __toString()
     {
-        $output  = '';
-        $output .= ''."\n";
+        $output  = '
'."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ' - + - +
Response HTTP Headers
'."\n";
         $output .= var_export($this->headers)."\n";
diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php
index a5e58bb..40b5f69 100644
--- a/src/authnet/AuthnetWebhooksRequest.php
+++ b/src/authnet/AuthnetWebhooksRequest.php
@@ -61,8 +61,7 @@ public function __construct($api_url)
      */
     public function __toString()
     {
-        $output  = '';
-        $output .= ''."\n";
+        $output  = '
'."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; diff --git a/src/authnet/AuthnetWebhooksResponse.php b/src/authnet/AuthnetWebhooksResponse.php index 875100b..d9b35ce 100644 --- a/src/authnet/AuthnetWebhooksResponse.php +++ b/src/authnet/AuthnetWebhooksResponse.php @@ -54,8 +54,7 @@ public function __construct($responseJson) */ public function __toString() { - $output = ''; - $output .= '
Class Parameters
Authnet Server URL'.$this->url.'
Request JSON
'."\n"; + $output = '
'."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ' - batchList as $batch) : ?> + batchList as $batch) : ?> - transactions as $transaction) : ?> + transactions as $transaction) : ?> - transactions as $transaction) : ?> + transactions as $transaction) : ?> - + - +
Response JSON
'."\n";
         $output .= $this->responseJson."\n";

From 8a11d1cf1dd2fe8b4b6190f83e36a9d5de9fb927 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Fri, 25 Jan 2019 23:18:35 -0500
Subject: [PATCH 011/105] Added ext-apache to require

---
 composer.json | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/composer.json b/composer.json
index f79c0d4..d85cef6 100644
--- a/composer.json
+++ b/composer.json
@@ -16,8 +16,9 @@
     "require": {
         "php": ">=7.2.0",
         "curl/curl": "^1.5",
-        "ext-json": "*",
-        "ext-curl": "*"
+        "ext-apache": "*",
+        "ext-curl": "*",
+        "ext-json": "*"
     },
     "autoload": {
         "classmap": [

From 08c5135d91c73f6a7a64b4d54fc62bd86535f7e6 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 09:30:37 -0500
Subject: [PATCH 012/105] Tweaked Exception classes to better follow PSR-2
 standards

---
 .../AuthnetCannotSetParamsException.php       | 49 +++++++++---------
 src/exceptions/AuthnetCurlException.php       | 49 +++++++++---------
 src/exceptions/AuthnetException.php           | 49 +++++++++---------
 .../AuthnetInvalidAmountException.php         | 49 +++++++++---------
 .../AuthnetInvalidCredentialsException.php    | 49 +++++++++---------
 .../AuthnetInvalidJsonException.php           | 49 +++++++++---------
 .../AuthnetInvalidParameterException.php      | 49 +++++++++---------
 .../AuthnetInvalidServerException.php         | 51 ++++++++++---------
 ...uthnetTransactionResponseCallException.php | 49 +++++++++---------
 9 files changed, 235 insertions(+), 208 deletions(-)

diff --git a/src/exceptions/AuthnetCannotSetParamsException.php b/src/exceptions/AuthnetCannotSetParamsException.php
index d6d6b50..a63c5b0 100644
--- a/src/exceptions/AuthnetCannotSetParamsException.php
+++ b/src/exceptions/AuthnetCannotSetParamsException.php
@@ -1,23 +1,26 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace JohnConde\Authnet;
-
-/**
- * Exception that is throw when when client code attempts to set a parameter directly (i.e. using __set())
- *
- * @package    AuthnetJSON
- * @author     John Conde 
- * @copyright  John Conde 
- * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
- * @link       https://github.com/stymiee/authnetjson
- */
-class AuthnetCannotSetParamsException Extends AuthnetException {}
\ No newline at end of file
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JohnConde\Authnet;
+
+/**
+ * Exception that is throw when when client code attempts to set a parameter directly (i.e. using __set())
+ *
+ * @package    AuthnetJSON
+ * @author     John Conde 
+ * @copyright  John Conde 
+ * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ * @link       https://github.com/stymiee/authnetjson
+ */
+class AuthnetCannotSetParamsException extends AuthnetException
+{
+
+}
\ No newline at end of file
diff --git a/src/exceptions/AuthnetCurlException.php b/src/exceptions/AuthnetCurlException.php
index 59f493b..1d9cf79 100644
--- a/src/exceptions/AuthnetCurlException.php
+++ b/src/exceptions/AuthnetCurlException.php
@@ -1,23 +1,26 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace JohnConde\Authnet;
-
-/**
- * Exception that is throw when cURL experiences an unexpected error
- *
- * @package    AuthnetJSON
- * @author     John Conde 
- * @copyright  John Conde 
- * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
- * @link       https://github.com/stymiee/authnetjson
- */
-class AuthnetCurlException Extends AuthnetException {}
\ No newline at end of file
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JohnConde\Authnet;
+
+/**
+ * Exception that is throw when cURL experiences an unexpected error
+ *
+ * @package    AuthnetJSON
+ * @author     John Conde 
+ * @copyright  John Conde 
+ * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ * @link       https://github.com/stymiee/authnetjson
+ */
+class AuthnetCurlException extends AuthnetException
+{
+
+}
diff --git a/src/exceptions/AuthnetException.php b/src/exceptions/AuthnetException.php
index 7ef757c..996c33b 100644
--- a/src/exceptions/AuthnetException.php
+++ b/src/exceptions/AuthnetException.php
@@ -1,23 +1,26 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace JohnConde\Authnet;
-
-/**
- * Generic Exception that may be thrown whenever an unexpect error occurs using the AuthnetJson class
- *
- * @package    AuthnetJSON
- * @author     John Conde 
- * @copyright  John Conde 
- * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
- * @link       https://github.com/stymiee/authnetjson
- */
-class AuthnetException Extends \Exception {}
\ No newline at end of file
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JohnConde\Authnet;
+
+/**
+ * Generic Exception that may be thrown whenever an unexpect error occurs using the AuthnetJson class
+ *
+ * @package    AuthnetJSON
+ * @author     John Conde 
+ * @copyright  John Conde 
+ * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ * @link       https://github.com/stymiee/authnetjson
+ */
+class AuthnetException extends \Exception
+{
+
+}
\ No newline at end of file
diff --git a/src/exceptions/AuthnetInvalidAmountException.php b/src/exceptions/AuthnetInvalidAmountException.php
index 465a88c..3abe3d5 100644
--- a/src/exceptions/AuthnetInvalidAmountException.php
+++ b/src/exceptions/AuthnetInvalidAmountException.php
@@ -1,23 +1,26 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace JohnConde\Authnet;
-
-/**
- * Exception that is thrown when invalid amount to pay is provided for a SIM transaction
- *
- * @package    AuthnetJSON
- * @author     John Conde 
- * @copyright  John Conde 
- * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
- * @link       https://github.com/stymiee/authnetjson
- */
-class AuthnetInvalidAmountException Extends AuthnetException {}
\ No newline at end of file
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JohnConde\Authnet;
+
+/**
+ * Exception that is thrown when invalid amount to pay is provided for a SIM transaction
+ *
+ * @package    AuthnetJSON
+ * @author     John Conde 
+ * @copyright  John Conde 
+ * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ * @link       https://github.com/stymiee/authnetjson
+ */
+class AuthnetInvalidAmountException extends AuthnetException
+{
+
+}
\ No newline at end of file
diff --git a/src/exceptions/AuthnetInvalidCredentialsException.php b/src/exceptions/AuthnetInvalidCredentialsException.php
index 718316f..2e53cad 100644
--- a/src/exceptions/AuthnetInvalidCredentialsException.php
+++ b/src/exceptions/AuthnetInvalidCredentialsException.php
@@ -1,23 +1,26 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace JohnConde\Authnet;
-
-/**
- * Exception that is throw when invalid Authorize.Net API credentials are provided
- *
- * @package    AuthnetJSON
- * @author     John Conde 
- * @copyright  John Conde 
- * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
- * @link       https://github.com/stymiee/authnetjson
- */
-class AuthnetInvalidCredentialsException Extends AuthnetException {}
\ No newline at end of file
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JohnConde\Authnet;
+
+/**
+ * Exception that is throw when invalid Authorize.Net API credentials are provided
+ *
+ * @package    AuthnetJSON
+ * @author     John Conde 
+ * @copyright  John Conde 
+ * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ * @link       https://github.com/stymiee/authnetjson
+ */
+class AuthnetInvalidCredentialsException extends AuthnetException
+{
+
+}
\ No newline at end of file
diff --git a/src/exceptions/AuthnetInvalidJsonException.php b/src/exceptions/AuthnetInvalidJsonException.php
index 1fd2846..5440d6f 100644
--- a/src/exceptions/AuthnetInvalidJsonException.php
+++ b/src/exceptions/AuthnetInvalidJsonException.php
@@ -1,23 +1,26 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace JohnConde\Authnet;
-
-/**
- * Exception that is throw when invalid JSON is returned by the API
- *
- * @package    AuthnetJSON
- * @author     John Conde 
- * @copyright  John Conde 
- * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
- * @link       https://github.com/stymiee/authnetjson
- */
-class AuthnetInvalidJsonException Extends AuthnetException {}
\ No newline at end of file
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JohnConde\Authnet;
+
+/**
+ * Exception that is throw when invalid JSON is returned by the API
+ *
+ * @package    AuthnetJSON
+ * @author     John Conde 
+ * @copyright  John Conde 
+ * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ * @link       https://github.com/stymiee/authnetjson
+ */
+class AuthnetInvalidJsonException extends AuthnetException
+{
+
+}
\ No newline at end of file
diff --git a/src/exceptions/AuthnetInvalidParameterException.php b/src/exceptions/AuthnetInvalidParameterException.php
index 17a1843..6e4edab 100644
--- a/src/exceptions/AuthnetInvalidParameterException.php
+++ b/src/exceptions/AuthnetInvalidParameterException.php
@@ -1,23 +1,26 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace JohnConde\Authnet;
-
-/**
- * Exception that is throw when invalid parameters are passed to a method that are not otherwise throwing an exception
- *
- * @package    AuthnetJSON
- * @author     John Conde 
- * @copyright  John Conde 
- * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
- * @link       https://github.com/stymiee/authnetjson
- */
-class AuthnetInvalidParameterException Extends AuthnetException {}
\ No newline at end of file
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JohnConde\Authnet;
+
+/**
+ * Exception that is throw when invalid parameters are passed to a method that are not otherwise throwing an exception
+ *
+ * @package    AuthnetJSON
+ * @author     John Conde 
+ * @copyright  John Conde 
+ * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ * @link       https://github.com/stymiee/authnetjson
+ */
+class AuthnetInvalidParameterException extends AuthnetException
+{
+
+}
\ No newline at end of file
diff --git a/src/exceptions/AuthnetInvalidServerException.php b/src/exceptions/AuthnetInvalidServerException.php
index 349825e..e0bc1db 100644
--- a/src/exceptions/AuthnetInvalidServerException.php
+++ b/src/exceptions/AuthnetInvalidServerException.php
@@ -1,24 +1,27 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace JohnConde\Authnet;
-
-/**
- * Exception that is throw when an invalid value is given for the $server paramater when
- * initiating an instance of the AuthnetJson class
- *
- * @package    AuthnetJSON
- * @author     John Conde 
- * @copyright  John Conde 
- * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
- * @link       https://github.com/stymiee/authnetjson
- */
-class AuthnetInvalidServerException Extends AuthnetException {}
\ No newline at end of file
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JohnConde\Authnet;
+
+/**
+ * Exception that is throw when an invalid value is given for the $server paramater when
+ * initiating an instance of the AuthnetJson class
+ *
+ * @package    AuthnetJSON
+ * @author     John Conde 
+ * @copyright  John Conde 
+ * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ * @link       https://github.com/stymiee/authnetjson
+ */
+class AuthnetInvalidServerException extends AuthnetException
+{
+
+}
\ No newline at end of file
diff --git a/src/exceptions/AuthnetTransactionResponseCallException.php b/src/exceptions/AuthnetTransactionResponseCallException.php
index afa3189..90c5e20 100644
--- a/src/exceptions/AuthnetTransactionResponseCallException.php
+++ b/src/exceptions/AuthnetTransactionResponseCallException.php
@@ -1,23 +1,26 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace JohnConde\Authnet;
-
-/**
- * Exception that is throw when transaction response data is requested on an API call that does not return any
- *
- * @package    AuthnetJSON
- * @author     John Conde 
- * @copyright  John Conde 
- * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
- * @link       https://github.com/stymiee/authnetjson
- */
-class AuthnetTransactionResponseCallException Extends AuthnetException {}
\ No newline at end of file
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JohnConde\Authnet;
+
+/**
+ * Exception that is throw when transaction response data is requested on an API call that does not return any
+ *
+ * @package    AuthnetJSON
+ * @author     John Conde 
+ * @copyright  John Conde 
+ * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ * @link       https://github.com/stymiee/authnetjson
+ */
+class AuthnetTransactionResponseCallException extends AuthnetException
+{
+
+}

From b4383ef47c3e18f318284bcbaec73ccea0d57444 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 10:07:46 -0500
Subject: [PATCH 013/105] Added empty line to bottom of file

---
 src/authnet/AuthnetApiFactory.php       | 2 +-
 src/authnet/AuthnetJsonRequest.php      | 2 +-
 src/authnet/AuthnetJsonResponse.php     | 2 +-
 src/authnet/AuthnetSim.php              | 2 +-
 src/authnet/AuthnetWebhook.php          | 2 +-
 src/authnet/AuthnetWebhooksRequest.php  | 2 +-
 src/authnet/AuthnetWebhooksResponse.php | 2 +-
 src/authnet/TransactionResponse.php     | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php
index 6c9a07b..56c2b8c 100644
--- a/src/authnet/AuthnetApiFactory.php
+++ b/src/authnet/AuthnetApiFactory.php
@@ -191,4 +191,4 @@ protected static function getWebhooksURL(int $server) : string
         }
         throw new AuthnetInvalidServerException('You did not provide a valid server.');
     }
-}
\ No newline at end of file
+}
diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php
index 0c88f1d..82ce8a9 100644
--- a/src/authnet/AuthnetJsonRequest.php
+++ b/src/authnet/AuthnetJsonRequest.php
@@ -203,4 +203,4 @@ public function getRawRequest()
     {
         return $this->requestJson;
     }
-}
\ No newline at end of file
+}
diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php
index 309e679..18c9c51 100644
--- a/src/authnet/AuthnetJsonResponse.php
+++ b/src/authnet/AuthnetJsonResponse.php
@@ -274,4 +274,4 @@ public function getErrorCode()
         }
         return $code;
     }
-}
\ No newline at end of file
+}
diff --git a/src/authnet/AuthnetSim.php b/src/authnet/AuthnetSim.php
index 9766211..7f38bfa 100644
--- a/src/authnet/AuthnetSim.php
+++ b/src/authnet/AuthnetSim.php
@@ -133,4 +133,4 @@ public function resetParameters()
         $this->sequence  = rand(1, 1000);
         $this->timestamp = time();
     }
-}
\ No newline at end of file
+}
diff --git a/src/authnet/AuthnetWebhook.php b/src/authnet/AuthnetWebhook.php
index 3ae20aa..819db34 100644
--- a/src/authnet/AuthnetWebhook.php
+++ b/src/authnet/AuthnetWebhook.php
@@ -138,4 +138,4 @@ protected function getAllHeaders()
         }
         return $headers;
     }
-}
\ No newline at end of file
+}
diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php
index 40b5f69..cda587b 100644
--- a/src/authnet/AuthnetWebhooksRequest.php
+++ b/src/authnet/AuthnetWebhooksRequest.php
@@ -321,4 +321,4 @@ public function getRawRequest()
     {
         return $this->requestJson;
     }
-}
\ No newline at end of file
+}
diff --git a/src/authnet/AuthnetWebhooksResponse.php b/src/authnet/AuthnetWebhooksResponse.php
index d9b35ce..3f10717 100644
--- a/src/authnet/AuthnetWebhooksResponse.php
+++ b/src/authnet/AuthnetWebhooksResponse.php
@@ -205,4 +205,4 @@ public function getEventDate()
     {
         return $this->response->eventDate;
     }
-}
\ No newline at end of file
+}
diff --git a/src/authnet/TransactionResponse.php b/src/authnet/TransactionResponse.php
index 41b66d0..ccdf4f7 100644
--- a/src/authnet/TransactionResponse.php
+++ b/src/authnet/TransactionResponse.php
@@ -108,4 +108,4 @@ public function getTransactionResponseField($field)
         }
         return $value;
     }
-}
\ No newline at end of file
+}

From 8dc8b5bcf38d07c0eb40c3314cd88fb11590a6b9 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 10:24:50 -0500
Subject: [PATCH 014/105] Removed ext-apache from copmposer.json

---
 composer.json | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/composer.json b/composer.json
index d85cef6..09e04cb 100644
--- a/composer.json
+++ b/composer.json
@@ -16,10 +16,13 @@
     "require": {
         "php": ">=7.2.0",
         "curl/curl": "^1.5",
-        "ext-apache": "*",
         "ext-curl": "*",
         "ext-json": "*"
     },
+    "require-dev": {
+        "squizlabs/php_codesniffer": "3.*",
+        "phpmd/phpmd" : "@stable"
+    },
     "autoload": {
         "classmap": [
             "src/"

From 952a8b0b90a87c66230f5780d3453cc91f2346a1 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 13:17:26 -0500
Subject: [PATCH 015/105] Updated to a minimum PHP 7.2 compatibility

---
 src/authnet/AuthnetJsonRequest.php      | 75 ++++++++++----------
 src/authnet/AuthnetJsonResponse.php     | 94 ++++++++++++-------------
 src/authnet/AuthnetSim.php              | 29 +++++---
 src/authnet/AuthnetWebhook.php          | 25 ++++---
 src/authnet/AuthnetWebhooksRequest.php  | 36 +++++-----
 src/authnet/AuthnetWebhooksResponse.php | 22 +++---
 src/authnet/TransactionResponse.php     |  4 +-
 7 files changed, 151 insertions(+), 134 deletions(-)

diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php
index 82ce8a9..60a692a 100644
--- a/src/authnet/AuthnetJsonRequest.php
+++ b/src/authnet/AuthnetJsonRequest.php
@@ -21,39 +21,39 @@
  * @link        https://github.com/stymiee/authnetjson
  * @see         https://developer.authorize.net/api/reference/
  *
- * @method      AuthnetJsonResponse createTransactionRequest(array $array)                                 process a payment
- * @method      AuthnetJsonResponse sendCustomerTransactionReceiptRequest(array $array)                    get a list of unsettled transactions
- * @method      AuthnetJsonResponse ARBCancelSubscriptionRequest(array $array)                             cancel a subscription
- * @method      AuthnetJsonResponse ARBCreateSubscriptionRequest(array $array)                             create a subscription
- * @method      AuthnetJsonResponse ARBGetSubscriptionStatusRequest(array $array)                          get a subscription's status
- * @method      AuthnetJsonResponse ARBUpdateSubscriptionRequest(array $array)                             update a subscription
- * @method      AuthnetJsonResponse createCustomerPaymentProfileRequest(array $array)                      create a payment profile
- * @method      AuthnetJsonResponse createCustomerProfileRequest(array $array)                             create a customer profile
- * @method      AuthnetJsonResponse createCustomerProfileTransactionRequest_authCapture(array $array)      process an Authorization and Capture transaction (Sale)
- * @method      AuthnetJsonResponse createCustomerProfileTransactionRequest_authOnly(array $array)         process an Authorization Only transaction
- * @method      AuthnetJsonResponse createCustomerProfileTransactionRequest_captureOnly(array $array)      process a Capture Only transaction
- * @method      AuthnetJsonResponse createCustomerProfileTransactionRequest_priorAuthCapture(array $array) process a Prior Authorization Capture transaction
- * @method      AuthnetJsonResponse createCustomerProfileTransactionRequest_refund(array $array)           process a Refund (credit)
- * @method      AuthnetJsonResponse createCustomerProfileTransactionRequest_void(array $array)             void a transaction
- * @method      AuthnetJsonResponse createCustomerShippingAddressRequest(array $array)                     create a shipping profile
- * @method      AuthnetJsonResponse deleteCustomerPaymentProfileRequest(array $array)                      delete a payment profile
- * @method      AuthnetJsonResponse deleteCustomerProfileRequest(array $array)                             delete a customer profile
- * @method      AuthnetJsonResponse deleteCustomerShippingAddressRequest(array $array)                     delete a shipping profile
- * @method      AuthnetJsonResponse getCustomerPaymentProfileRequest(array $array)                         retrieve a payment profile
- * @method      AuthnetJsonResponse getCustomerProfileIdsRequest(array $array)                             retrieve a list of profile IDs
- * @method      AuthnetJsonResponse getCustomerProfileRequest(array $array)                                retrieve a customer profile
- * @method      AuthnetJsonResponse getCustomerShippingAddressRequest(array $array)                        retrieve a shipping address
- * @method      AuthnetJsonResponse getHostedProfilePageRequest(array $array)                              retrieve a hosted payment page token
- * @method      AuthnetJsonResponse updateCustomerPaymentProfileRequest(array $array)                      update a customer profile
- * @method      AuthnetJsonResponse updateCustomerProfileRequest(array $array)                             update a customer profile
- * @method      AuthnetJsonResponse updateCustomerShippingAddressRequest(array $array)                     update a shipping address
- * @method      AuthnetJsonResponse updateSplitTenderGroupRequest(array $array)                            update a split tender transaction
- * @method      AuthnetJsonResponse validateCustomerPaymentProfileRequest(array $array)                    validate a payment profile
- * @method      AuthnetJsonResponse getBatchStatisticsRequest(array $array)                                get a summary of a settled batch
- * @method      AuthnetJsonResponse getSettledBatchListRequest(array $array)                               get a list of settled batches
- * @method      AuthnetJsonResponse getTransactionDetailsRequest(array $array)                             get the details of a transaction
- * @method      AuthnetJsonResponse getTransactionListRequest(array $array)                                get a list of transaction in a batch
- * @method      AuthnetJsonResponse getUnsettledTransactionListRequest(array $array)                       get a list of unsettled transactions
+ * @method AuthnetJsonResponse createTransactionRequest(array $array)                                 process a payment
+ * @method AuthnetJsonResponse sendCustomerTransactionReceiptRequest(array $array)                    get a list of unsettled transactions
+ * @method AuthnetJsonResponse ARBCancelSubscriptionRequest(array $array)                             cancel a subscription
+ * @method AuthnetJsonResponse ARBCreateSubscriptionRequest(array $array)                             create a subscription
+ * @method AuthnetJsonResponse ARBGetSubscriptionStatusRequest(array $array)                          get a subscription's status
+ * @method AuthnetJsonResponse ARBUpdateSubscriptionRequest(array $array)                             update a subscription
+ * @method AuthnetJsonResponse createCustomerPaymentProfileRequest(array $array)                      create a payment profile
+ * @method AuthnetJsonResponse createCustomerProfileRequest(array $array)                             create a customer profile
+ * @method AuthnetJsonResponse createCustomerProfileTransactionRequest_authCapture(array $array)      process an Authorization and Capture transaction (Sale)
+ * @method AuthnetJsonResponse createCustomerProfileTransactionRequest_authOnly(array $array)         process an Authorization Only transaction
+ * @method AuthnetJsonResponse createCustomerProfileTransactionRequest_captureOnly(array $array)      process a Capture Only transaction
+ * @method AuthnetJsonResponse createCustomerProfileTransactionRequest_priorAuthCapture(array $array) process a Prior Authorization Capture transaction
+ * @method AuthnetJsonResponse createCustomerProfileTransactionRequest_refund(array $array)           process a Refund (credit)
+ * @method AuthnetJsonResponse createCustomerProfileTransactionRequest_void(array $array)             void a transaction
+ * @method AuthnetJsonResponse createCustomerShippingAddressRequest(array $array)                     create a shipping profile
+ * @method AuthnetJsonResponse deleteCustomerPaymentProfileRequest(array $array)                      delete a payment profile
+ * @method AuthnetJsonResponse deleteCustomerProfileRequest(array $array)                             delete a customer profile
+ * @method AuthnetJsonResponse deleteCustomerShippingAddressRequest(array $array)                     delete a shipping profile
+ * @method AuthnetJsonResponse getCustomerPaymentProfileRequest(array $array)                         retrieve a payment profile
+ * @method AuthnetJsonResponse getCustomerProfileIdsRequest(array $array)                             retrieve a list of profile IDs
+ * @method AuthnetJsonResponse getCustomerProfileRequest(array $array)                                retrieve a customer profile
+ * @method AuthnetJsonResponse getCustomerShippingAddressRequest(array $array)                        retrieve a shipping address
+ * @method AuthnetJsonResponse getHostedProfilePageRequest(array $array)                              retrieve a hosted payment page token
+ * @method AuthnetJsonResponse updateCustomerPaymentProfileRequest(array $array)                      update a customer profile
+ * @method AuthnetJsonResponse updateCustomerProfileRequest(array $array)                             update a customer profile
+ * @method AuthnetJsonResponse updateCustomerShippingAddressRequest(array $array)                     update a shipping address
+ * @method AuthnetJsonResponse updateSplitTenderGroupRequest(array $array)                            update a split tender transaction
+ * @method AuthnetJsonResponse validateCustomerPaymentProfileRequest(array $array)                    validate a payment profile
+ * @method AuthnetJsonResponse getBatchStatisticsRequest(array $array)                                get a summary of a settled batch
+ * @method AuthnetJsonResponse getSettledBatchListRequest(array $array)                               get a list of settled batches
+ * @method AuthnetJsonResponse getTransactionDetailsRequest(array $array)                             get the details of a transaction
+ * @method AuthnetJsonResponse getTransactionListRequest(array $array)                                get a list of transaction in a batch
+ * @method AuthnetJsonResponse getUnsettledTransactionListRequest(array $array)                       get a list of unsettled transactions
  */
 class AuthnetJsonRequest
 {
@@ -90,7 +90,7 @@ class AuthnetJsonRequest
      * @param   string  $transactionKey     Authorize.Net API Transaction Key
      * @param   string  $api_url            URL endpoint for processing a transaction
      */
-    public function __construct($login, $transactionKey, $api_url)
+    public function __construct(string $login, string $transactionKey, string $api_url)
     {
         $this->login          = $login;
         $this->transactionKey = $transactionKey;
@@ -166,13 +166,14 @@ public function __call($api_call, Array $args)
     /**
      * Tells the handler to make the API call to Authorize.Net
      *
+     * @return  string  JSON string containing API response
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    private function process()
+    private function process() : string
     {
         $this->processor->post($this->url, $this->requestJson);
 
-        if (!$this->processor->error) {
+        if (!$this->processor->error && isset($this->processor->response)) {
             return $this->processor->response;
         }
         $error_message = null;
@@ -199,7 +200,7 @@ public function setProcessHandler($processor)
      *
      * @return  string transaction request sent to Authorize.Net in JSON format
      */
-    public function getRawRequest()
+    public function getRawRequest() : string
     {
         return $this->requestJson;
     }
diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php
index 18c9c51..3dcbaf7 100644
--- a/src/authnet/AuthnetJsonResponse.php
+++ b/src/authnet/AuthnetJsonResponse.php
@@ -26,39 +26,39 @@
  * @property    string  $validationDirectResponse
  * @property    object  $transactionResponse
  *
- * @method      null createTransactionRequest(array $array)                                 process a payment
- * @method      null sendCustomerTransactionReceiptRequest(array $array)                    get a list of unsettled transactions
- * @method      null ARBCancelSubscriptionRequest(array $array)                             cancel a subscription
- * @method      null ARBCreateSubscriptionRequest(array $array)                             create a subscription
- * @method      null ARBGetSubscriptionStatusRequest(array $array)                          get a subscription's status
- * @method      null ARBUpdateSubscriptionRequest(array $array)                             update a subscription
- * @method      null createCustomerPaymentProfileRequest(array $array)                      create a payment profile
- * @method      null createCustomerProfileRequest(array $array)                             create a customer profile
- * @method      null createCustomerProfileTransactionRequest_authCapture(array $array)      process an Authorization and Capture transaction (Sale)
- * @method      null createCustomerProfileTransactionRequest_authOnly(array $array)         process an Authorization Only transaction
- * @method      null createCustomerProfileTransactionRequest_captureOnly(array $array)      process a Capture Only transaction
- * @method      null createCustomerProfileTransactionRequest_priorAuthCapture(array $array) process a Prior Authorization Capture transaction
- * @method      null createCustomerProfileTransactionRequest_refund(array $array)           process a Refund (credit)
- * @method      null createCustomerProfileTransactionRequest_void(array $array)             void a transaction
- * @method      null createCustomerShippingAddressRequest(array $array)                     create a shipping profile
- * @method      null deleteCustomerPaymentProfileRequest(array $array)                      delete a payment profile
- * @method      null deleteCustomerProfileRequest(array $array)                             delete a customer profile
- * @method      null deleteCustomerShippingAddressRequest(array $array)                     delete a shipping profile
- * @method      null getCustomerPaymentProfileRequest(array $array)                         retrieve a payment profile
- * @method      null getCustomerProfileIdsRequest(array $array)                             retrieve a list of profile IDs
- * @method      null getCustomerProfileRequest(array $array)                                retrieve a customer profile
- * @method      null getCustomerShippingAddressRequest(array $array)                        retrieve a shipping address
- * @method      null getHostedProfilePageRequest(array $array)                              retrieve a hosted payment page token
- * @method      null updateCustomerPaymentProfileRequest(array $array)                      update a customer profile
- * @method      null updateCustomerProfileRequest(array $array)                             update a customer profile
- * @method      null updateCustomerShippingAddressRequest(array $array)                     update a shipping address
- * @method      null updateSplitTenderGroupRequest(array $array)                            update a split tender transaction
- * @method      null validateCustomerPaymentProfileRequest(array $array)                    validate a payment profile
- * @method      null getBatchStatisticsRequest(array $array)                                get a summary of a settled batch
- * @method      null getSettledBatchListRequest(array $array)                               get a list of settled batches
- * @method      null getTransactionDetailsRequest(array $array)                             get the details of a transaction
- * @method      null getTransactionListRequest(array $array)                                get a list of transaction in a batch
- * @method      null getUnsettledTransactionListRequest(array $array)                       get a list of unsettled transactions
+ * @method null createTransactionRequest(array $array)                                 process a payment
+ * @method null sendCustomerTransactionReceiptRequest(array $array)                    get a list of unsettled transactions
+ * @method null ARBCancelSubscriptionRequest(array $array)                             cancel a subscription
+ * @method null ARBCreateSubscriptionRequest(array $array)                             create a subscription
+ * @method null ARBGetSubscriptionStatusRequest(array $array)                          get a subscription's status
+ * @method null ARBUpdateSubscriptionRequest(array $array)                             update a subscription
+ * @method null createCustomerPaymentProfileRequest(array $array)                      create a payment profile
+ * @method null createCustomerProfileRequest(array $array)                             create a customer profile
+ * @method null createCustomerProfileTransactionRequest_authCapture(array $array)      process an Authorization and Capture transaction (Sale)
+ * @method null createCustomerProfileTransactionRequest_authOnly(array $array)         process an Authorization Only transaction
+ * @method null createCustomerProfileTransactionRequest_captureOnly(array $array)      process a Capture Only transaction
+ * @method null createCustomerProfileTransactionRequest_priorAuthCapture(array $array) process a Prior Authorization Capture transaction
+ * @method null createCustomerProfileTransactionRequest_refund(array $array)           process a Refund (credit)
+ * @method null createCustomerProfileTransactionRequest_void(array $array)             void a transaction
+ * @method null createCustomerShippingAddressRequest(array $array)                     create a shipping profile
+ * @method null deleteCustomerPaymentProfileRequest(array $array)                      delete a payment profile
+ * @method null deleteCustomerProfileRequest(array $array)                             delete a customer profile
+ * @method null deleteCustomerShippingAddressRequest(array $array)                     delete a shipping profile
+ * @method null getCustomerPaymentProfileRequest(array $array)                         retrieve a payment profile
+ * @method null getCustomerProfileIdsRequest(array $array)                             retrieve a list of profile IDs
+ * @method null getCustomerProfileRequest(array $array)                                retrieve a customer profile
+ * @method null getCustomerShippingAddressRequest(array $array)                        retrieve a shipping address
+ * @method null getHostedProfilePageRequest(array $array)                              retrieve a hosted payment page token
+ * @method null updateCustomerPaymentProfileRequest(array $array)                      update a customer profile
+ * @method null updateCustomerProfileRequest(array $array)                             update a customer profile
+ * @method null updateCustomerShippingAddressRequest(array $array)                     update a shipping address
+ * @method null updateSplitTenderGroupRequest(array $array)                            update a split tender transaction
+ * @method null validateCustomerPaymentProfileRequest(array $array)                    validate a payment profile
+ * @method null getBatchStatisticsRequest(array $array)                                get a summary of a settled batch
+ * @method null getSettledBatchListRequest(array $array)                               get a list of settled batches
+ * @method null getTransactionDetailsRequest(array $array)                             get the details of a transaction
+ * @method null getTransactionListRequest(array $array)                                get a list of transaction in a batch
+ * @method null getUnsettledTransactionListRequest(array $array)                       get a list of unsettled transactions
  */
 class AuthnetJsonResponse
 {
@@ -108,7 +108,7 @@ class AuthnetJsonResponse
      * @param   string  $responseJson   Response from Authorize.Net
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      */
-    public function __construct($responseJson)
+    public function __construct(string $responseJson)
     {
         $this->responseJson = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $responseJson);
         if (($this->response = json_decode($this->responseJson)) === null) {
@@ -145,7 +145,7 @@ public function __toString()
      * @param   string  $var    unused
      * @return  string          requested variable from the API call response
      */
-    public function __get($var)
+    public function __get(string $var)
     {
         return $this->response->{$var};
     }
@@ -155,7 +155,7 @@ public function __get($var)
      *
      * @return  bool    Whether the transaction was in an successful state
      */
-    public function isSuccessful()
+    public function isSuccessful() : bool
     {
         return strtolower($this->messages->resultCode) === 'ok';
     }
@@ -165,7 +165,7 @@ public function isSuccessful()
      *
      * @return  bool    Whether the transaction was in an error state
      */
-    public function isError()
+    public function isError() : bool
     {
         return strtolower($this->messages->resultCode) === 'error';
     }
@@ -175,7 +175,7 @@ public function isError()
      *
      * @return bool     true if the transaction is approved
      */
-    public function isApproved()
+    public function isApproved() : bool
     {
         return $this->isSuccessful() && $this->checkTransactionStatus(self::STATUS_APPROVED);
     }
@@ -185,7 +185,7 @@ public function isApproved()
      *
      * @return bool     true if the transaction is declined
      */
-    public function isDeclined()
+    public function isDeclined() : bool
     {
         return $this->isSuccessful() && $this->checkTransactionStatus(self::STATUS_DECLINED);
     }
@@ -196,12 +196,12 @@ public function isDeclined()
      * @param  integer $status
      * @return bool Check to see if the ResponseCode matches the expected value
      */
-    protected function checkTransactionStatus($status)
+    protected function checkTransactionStatus(int $status) : bool
     {
         if ($this->transactionInfo instanceof TransactionResponse) {
-            $match = (int) $this->transactionInfo->getTransactionResponseField('ResponseCode') === (int) $status;
+            $match = $this->transactionInfo->getTransactionResponseField('ResponseCode') == $status;
         } else {
-            $match = (int) $this->transactionResponse->responseCode === $status;
+            $match = $this->transactionResponse->responseCode == $status;
         }
         return $match;
     }
@@ -213,7 +213,7 @@ protected function checkTransactionStatus($status)
      * @return  string Transaction field to be retrieved
      * @throws  \JohnConde\Authnet\AuthnetTransactionResponseCallException
      */
-    public function getTransactionResponseField($field)
+    public function getTransactionResponseField($field) : string
     {
         if ($this->transactionInfo instanceof TransactionResponse) {
             return $this->transactionInfo->getTransactionResponseField($field);
@@ -226,7 +226,7 @@ public function getTransactionResponseField($field)
      *
      * @return  string transaction response from Authorize.Net in JSON format
      */
-    public function getRawResponse()
+    public function getRawResponse() : string
     {
         return $this->responseJson;
     }
@@ -236,7 +236,7 @@ public function getRawResponse()
      *
      * @return  string Error response from Authorize.Net
      */
-    public function getErrorText()
+    public function getErrorText() : string
     {
         $message = '';
         if ($this->isError()) {
@@ -253,7 +253,7 @@ public function getErrorText()
      *
      * @return  string Error response from Authorize.Net
      */
-    public function getErrorMessage()
+    public function getErrorMessage() : string
     {
         return $this->getErrorText();
     }
@@ -263,7 +263,7 @@ public function getErrorMessage()
      *
      * @return  string Error response from Authorize.Net
      */
-    public function getErrorCode()
+    public function getErrorCode() : string
     {
         $code = '';
         if ($this->isError()) {
diff --git a/src/authnet/AuthnetSim.php b/src/authnet/AuthnetSim.php
index 7f38bfa..85b81cf 100644
--- a/src/authnet/AuthnetSim.php
+++ b/src/authnet/AuthnetSim.php
@@ -71,18 +71,25 @@ public function __construct($login, $signature, $api_url)
      * @return  string           Hash of five different unique transaction parameters
      * @throws  \JohnConde\Authnet\AuthnetInvalidAmountException
      */
-    public function getFingerprint($amount)
+    public function getFingerprint(float $amount) : string
     {
         if (!filter_var($amount, FILTER_VALIDATE_FLOAT, FILTER_FLAG_ALLOW_THOUSAND)) {
             throw new AuthnetInvalidAmountException('You must enter a valid amount greater than zero.');
         }
 
-        return strtoupper(hash_hmac('sha512', sprintf('%s^%s^%s^%s^',
-            $this->login,
-            $this->sequence,
-            $this->timestamp,
-            $amount
-        ), hex2bin($this->signature)));
+        return strtoupper(
+            hash_hmac(
+                'sha512',
+                sprintf(
+                    '%s^%s^%s^%s^',
+                    $this->login,
+                    $this->sequence,
+                    $this->timestamp,
+                    $amount
+                ),
+                hex2bin($this->signature)
+            )
+        );
     }
 
     /**
@@ -90,7 +97,7 @@ public function getFingerprint($amount)
      *
      * @return  integer           Current sequence
      */
-    public function getSequence()
+    public function getSequence() : int
     {
         return $this->sequence;
     }
@@ -100,7 +107,7 @@ public function getSequence()
      *
      * @return  integer           Current timestamp
      */
-    public function getTimestamp()
+    public function getTimestamp() : int
     {
         return $this->timestamp;
     }
@@ -110,7 +117,7 @@ public function getTimestamp()
      *
      * @return  string           API login ID
      */
-    public function getLogin()
+    public function getLogin() : string
     {
         return $this->login;
     }
@@ -120,7 +127,7 @@ public function getLogin()
      *
      * @return  string           url endpoint
      */
-    public function getEndpoint()
+    public function getEndpoint() : string
     {
         return $this->url;
     }
diff --git a/src/authnet/AuthnetWebhook.php b/src/authnet/AuthnetWebhook.php
index 819db34..e760611 100644
--- a/src/authnet/AuthnetWebhook.php
+++ b/src/authnet/AuthnetWebhook.php
@@ -48,11 +48,11 @@ class AuthnetWebhook
      *
      * @param   string   $signature    Authorize.Net Signature Key
      * @param   string   $payload      Webhook Notification sent by Authorize.Net
-     * @param   array    $headers      HTTP headers sent with the Webhook notification. Optional if PHP is run as an Apache module
+     * @param   array    $headers      HTTP headers sent with Webhook. Optional if PHP is run as an Apache module
      * @throws  \JohnConde\Authnet\AuthnetInvalidCredentialsException
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      */
-    public function __construct($signature, $payload, Array $headers = [])
+    public function __construct(string $signature, string $payload, array $headers = [])
     {
         $this->signature   = $signature;
         $this->webhookJson = $payload;
@@ -106,18 +106,19 @@ public function __get($var)
      *
      * @return bool
      */
-    public function isValid()
+    public function isValid() : bool
     {
         $hashedBody = strtoupper(hash_hmac('sha512', $this->webhookJson, $this->signature));
-        return (isset($this->headers['X-ANET-SIGNATURE']) && strtoupper(explode('=', $this->headers['X-ANET-SIGNATURE'])[1]) === $hashedBody);
+        return (isset($this->headers['X-ANET-SIGNATURE']) &&
+            strtoupper(explode('=', $this->headers['X-ANET-SIGNATURE'])[1]) === $hashedBody);
     }
 
     /**
      * Validates a webhook signature to determine if the webhook is valid
      *
-     * @return string
+     * @return string|null
      */
-    public function getRequestId()
+    public function getRequestId() : ?string
     {
         return (isset($this->headers['X-REQUEST-ID'])) ? $this->headers['X-REQUEST-ID'] : null;
     }
@@ -127,14 +128,18 @@ public function getRequestId()
      *
      * @return array
      */
-    protected function getAllHeaders()
+    protected function getAllHeaders() : array
     {
         if (function_exists('apache_request_headers')) {
             $headers = apache_request_headers();
         } else {
-            $headers = array_filter($_SERVER, function($key) {
-                return strpos($key, 'HTTP_') === 0;
-            }, ARRAY_FILTER_USE_KEY);
+            $headers = array_filter(
+                $_SERVER,
+                function ($key) {
+                    return strpos($key, 'HTTP_') === 0;
+                },
+                ARRAY_FILTER_USE_KEY
+            );
         }
         return $headers;
     }
diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php
index cda587b..b89067e 100644
--- a/src/authnet/AuthnetWebhooksRequest.php
+++ b/src/authnet/AuthnetWebhooksRequest.php
@@ -84,7 +84,7 @@ public function __toString()
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    public function getEventTypes()
+    public function getEventTypes() : object
     {
         $this->endpoint = 'eventtypes';
         $this->url = sprintf('%s%s', $this->url, $this->endpoint);
@@ -102,7 +102,7 @@ public function getEventTypes()
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    public function createWebhooks(Array $webhooks, $webhookUrl, $status = 'active')
+    public function createWebhooks(array $webhooks, string $webhookUrl, string $status = 'active') : object
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s', $this->url, $this->endpoint);
@@ -122,7 +122,7 @@ public function createWebhooks(Array $webhooks, $webhookUrl, $status = 'active')
      * @param   string   $webhookId   Webhook ID to be tested
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    public function testWebhook($webhookId)
+    public function testWebhook(string $webhookId)
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s/%s/pings', $this->url, $this->endpoint, $webhookId);
@@ -137,7 +137,7 @@ public function testWebhook($webhookId)
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    public function getWebhooks()
+    public function getWebhooks() : object
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s', $this->url, $this->endpoint);
@@ -153,7 +153,7 @@ public function getWebhooks()
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    public function getWebhook($webhookId)
+    public function getWebhook(string $webhookId) : object
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s/%s', $this->url, $this->endpoint, $webhookId);
@@ -164,7 +164,7 @@ public function getWebhook($webhookId)
     /**
      * Updates webhook event types
      *
-     * @param   array   $webhookId      Webhook ID to be modified
+     * @param   string  $webhookId      Webhook ID to be modified
      * @param   string  $webhookUrl     URL of where webhook notifications will be sent
      * @param   array   $eventTypes     Array of event types to be added/removed
      * @param   string  $status         Status of webhooks to be modified [active/inactive]
@@ -172,7 +172,7 @@ public function getWebhook($webhookId)
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    public function updateWebhook($webhookId, $webhookUrl, Array $eventTypes, $status = 'active')
+    public function updateWebhook(string $webhookId, string $webhookUrl, array $eventTypes, string $status = 'active') : object
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s/%s', $this->url, $this->endpoint, $webhookId);
@@ -192,7 +192,7 @@ public function updateWebhook($webhookId, $webhookUrl, Array $eventTypes, $statu
      * @param   string   $webhookId   Webhook ID to be deleted
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    public function deleteWebhook($webhookId)
+    public function deleteWebhook(string $webhookId)
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s/%s', $this->url, $this->endpoint, $webhookId);
@@ -208,7 +208,7 @@ public function deleteWebhook($webhookId)
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    public function getNotificationHistory($limit = 1000, $offset = 0)
+    public function getNotificationHistory(int $limit = 1000, int $offset = 0) : object
     {
         $this->endpoint = 'notifications';
         $this->url = sprintf('%s%s', $this->url, $this->endpoint);
@@ -225,7 +225,7 @@ public function getNotificationHistory($limit = 1000, $offset = 0)
      * @return  string
      * @throws  \JohnConde\Authnet\AuthnetCurlException
      */
-    private function handleResponse()
+    private function handleResponse() : string
     {
         if (!$this->processor->error) {
             return $this->processor->response;
@@ -253,7 +253,8 @@ private function handleResponse()
      *
      * @codeCoverageIgnore
      */
-    private function get($url, Array $params = []) {
+    private function get(string $url, array $params = []) : string
+    {
         $this->processor->get($url, $params);
         return $this->handleResponse();
     }
@@ -268,7 +269,8 @@ private function get($url, Array $params = []) {
      *
      * @codeCoverageIgnore
      */
-    private function post($url, $request) {
+    private function post(string $url, string $request) : string
+    {
         $this->processor->post($url, $request);
         return $this->handleResponse();
     }
@@ -283,7 +285,8 @@ private function post($url, $request) {
      *
      * @codeCoverageIgnore
      */
-    private function put($url, $request) {
+    private function put(string $url, string $request) : string
+    {
         $this->processor->put($url, $request, true);
         return $this->handleResponse();
     }
@@ -297,7 +300,8 @@ private function put($url, $request) {
      *
      * @codeCoverageIgnore
      */
-    private function delete($url) {
+    private function delete(string $url) : string
+    {
         $this->processor->delete($url, [], true);
         return $this->handleResponse();
     }
@@ -307,7 +311,7 @@ private function delete($url) {
      *
      * @param   object  $processor
      */
-    public function setProcessHandler($processor)
+    public function setProcessHandler(object $processor)
     {
         $this->processor = $processor;
     }
@@ -317,7 +321,7 @@ public function setProcessHandler($processor)
      *
      * @return  string transaction request sent to Authorize.Net in JSON format
      */
-    public function getRawRequest()
+    public function getRawRequest() : string
     {
         return $this->requestJson;
     }
diff --git a/src/authnet/AuthnetWebhooksResponse.php b/src/authnet/AuthnetWebhooksResponse.php
index 3f10717..15d3683 100644
--- a/src/authnet/AuthnetWebhooksResponse.php
+++ b/src/authnet/AuthnetWebhooksResponse.php
@@ -39,7 +39,7 @@ class AuthnetWebhooksResponse
      * @param   string      $responseJson   Response from Authorize.Net
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      */
-    public function __construct($responseJson)
+    public function __construct(string $responseJson)
     {
         $this->responseJson = $responseJson;
         if (($this->response = json_decode($this->responseJson)) === null) {
@@ -91,7 +91,7 @@ public function __toString()
      *
      * @return  array   Array of event types supported by Webhooks API
      */
-    public function getEventTypes()
+    public function getEventTypes() : array
     {
         $events = [];
         if (isset($this->response->eventTypes)) {
@@ -109,7 +109,7 @@ public function getEventTypes()
      *
      * @return  string  Webhooks ID
      */
-    public function getWebhooksId()
+    public function getWebhooksId() : string
     {
         return $this->response->webhookId;
     }
@@ -119,7 +119,7 @@ public function getWebhooksId()
      *
      * @return  string  Staus of the webhooks [active|inactive]
      */
-    public function getStatus()
+    public function getStatus() : string
     {
         return $this->response->status;
     }
@@ -129,7 +129,7 @@ public function getStatus()
      *
      * @return  string
      */
-    public function getUrl()
+    public function getUrl() : string
     {
         return $this->response->url;
     }
@@ -140,7 +140,7 @@ public function getUrl()
      * @return  array
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      */
-    public function getWebhooks()
+    public function getWebhooks() : array
     {
         $webhooks = [];
         foreach ($this->response as $webhook) {
@@ -155,7 +155,7 @@ public function getWebhooks()
      * @return  array
      * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      */
-    public function getNotificationHistory()
+    public function getNotificationHistory() : array
     {
         $notifications = [];
         if (count($this->response->notifications)) {
@@ -171,7 +171,7 @@ public function getNotificationHistory()
      *
      * @return  string
      */
-    public function getNotificationId()
+    public function getNotificationId() : string
     {
         return $this->response->notificationId;
     }
@@ -181,7 +181,7 @@ public function getNotificationId()
      *
      * @return  string
      */
-    public function getDeliveryStatus()
+    public function getDeliveryStatus() : string
     {
         return $this->response->deliveryStatus;
     }
@@ -191,7 +191,7 @@ public function getDeliveryStatus()
      *
      * @return  string
      */
-    public function getEventType()
+    public function getEventType() : string
     {
         return $this->response->eventType;
     }
@@ -201,7 +201,7 @@ public function getEventType()
      *
      * @return  string
      */
-    public function getEventDate()
+    public function getEventDate() : string
     {
         return $this->response->eventDate;
     }
diff --git a/src/authnet/TransactionResponse.php b/src/authnet/TransactionResponse.php
index ccdf4f7..ab83bd0 100644
--- a/src/authnet/TransactionResponse.php
+++ b/src/authnet/TransactionResponse.php
@@ -83,7 +83,7 @@ class TransactionResponse {
      *
      * @param   string  $response   Comma delimited transaction response string
      */
-    public function __construct($response)
+    public function __construct(string $response)
     {
         $this->responseArray = array_merge([null], explode(',', $response));
     }
@@ -96,7 +96,7 @@ public function __construct($response)
      * @param   mixed  $field  Name or key of the transaction field to be retrieved
      * @return  string Transaction field to be retrieved
      */
-    public function getTransactionResponseField($field)
+    public function getTransactionResponseField($field) : string
     {
         $value = null;
         if (is_int($field)) {

From f489de628c1e88e8d4a67e527d7f0be608697af5 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 13:17:57 -0500
Subject: [PATCH 016/105] Updated to reflect changes made to support PHP 7.2
 compatibility

---
 tests/AuthnetJsonRequestTest.php  | 6 +++---
 tests/AuthnetJsonResponseTest.php | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/AuthnetJsonRequestTest.php b/tests/AuthnetJsonRequestTest.php
index 20602dc..4dd8a7d 100644
--- a/tests/AuthnetJsonRequestTest.php
+++ b/tests/AuthnetJsonRequestTest.php
@@ -44,7 +44,7 @@ public function testConstructor()
      */
     public function testExceptionIsRaisedForCannotSetParamsException()
     {
-        $request = new AuthnetJsonRequest(null, null, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
+        $request = new AuthnetJsonRequest('', '', AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->login = 'test';
     }
 
@@ -53,7 +53,7 @@ public function testExceptionIsRaisedForCannotSetParamsException()
      * @covers            \JohnConde\Authnet\AuthnetJsonRequest::process()
      * @uses              \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler
      * @uses              \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL
-     * @expectedException \JohnConde\Authnet\AuthnetInvalidJsonException
+     * @expectedException \JohnConde\Authnet\AuthnetCurlException
      */
     public function testExceptionIsRaisedForInvalidJsonException()
     {
@@ -77,7 +77,7 @@ public function testExceptionIsRaisedForInvalidJsonException()
      */
     public function testProcessorIsInstanceOfCurlWrapper()
     {
-        $request = new AuthnetJsonRequest(null, null, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
+        $request = new AuthnetJsonRequest('', '', AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler(new \Curl\Curl());
 
         $reflectionOfRequest = new \ReflectionObject($request);
diff --git a/tests/AuthnetJsonResponseTest.php b/tests/AuthnetJsonResponseTest.php
index 8dd43de..71c7c26 100644
--- a/tests/AuthnetJsonResponseTest.php
+++ b/tests/AuthnetJsonResponseTest.php
@@ -21,7 +21,7 @@ class AuthnetJsonResponseTest extends TestCase
      */
     public function testExceptionIsRaisedForCannotSetParamsException()
     {
-        $request = new AuthnetJsonRequest(null, null, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
+        $request = new AuthnetJsonRequest('', '', AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->login = 'test';
     }
 

From e2afdfa2228498fd82ba84d699e83f7088d95459 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 13:19:08 -0500
Subject: [PATCH 017/105] Updated to reflect minimum PHP version bump to 7.2

---
 CHANGELOG | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 2f0a3f3..a77be7b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,10 +2,11 @@ CHANGE LOG
 
 2019-XX-XX - Version 4.0.0
 --------------------------------------------
+Bumped minimum supported version of PHP to 7.2
 Removed not actually missing return statement to AuthnetWebhooksRequest::delete
 Reduced complexity of AuthnetApiFactory::getWebServiceURL)(
 Reduced complexity of AuthnetWebhooksResponse::getEventTypes()
-
+Minor formatting changes
 
 2019-01-22 - Version 3.1.7
 --------------------------------------------

From 7106e48c65a2c1b7b7b050e59f7914b60f1648d4 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 13:19:29 -0500
Subject: [PATCH 018/105] Updated to reflect minimum PHP version bump to 7.2

---
 config.inc.php.dist | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config.inc.php.dist b/config.inc.php.dist
index 7c4ae30..ca01df3 100644
--- a/config.inc.php.dist
+++ b/config.inc.php.dist
@@ -10,6 +10,6 @@
     defined('AUTHNET_TRANSKEY')  || define('AUTHNET_TRANSKEY', '');
     defined('AUTHNET_SIGNATURE') || define('AUTHNET_SIGNATURE', '');
 
-    if (version_compare(PHP_VERSION, '5.4.0') < 0) {
-        throw new \Exception('AuthnetJson requires PHP 5.4 or greater');
+    if (version_compare(PHP_VERSION, '7.2.0') < 0) {
+        throw new \Exception('AuthnetJson requires PHP 7.2 or greater');
     }

From 74f86fa289834a1dfedeeab8983a924c41519a40 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 14:09:12 -0500
Subject: [PATCH 019/105] Consolidated some similar code

---
 src/authnet/AuthnetWebhooksRequest.php | 53 +++++++++++++++-----------
 1 file changed, 31 insertions(+), 22 deletions(-)

diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php
index b89067e..ac90e24 100644
--- a/src/authnet/AuthnetWebhooksRequest.php
+++ b/src/authnet/AuthnetWebhooksRequest.php
@@ -77,21 +77,6 @@ public function __toString()
         return $output;
     }
 
-    /**
-     * Gets all of the available event types
-     *
-     * @return  \JohnConde\Authnet\AuthnetWebhooksResponse
-     * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
-     * @throws  \JohnConde\Authnet\AuthnetCurlException
-     */
-    public function getEventTypes() : object
-    {
-        $this->endpoint = 'eventtypes';
-        $this->url = sprintf('%s%s', $this->url, $this->endpoint);
-        $response = $this->get($this->url);
-        return new AuthnetWebhooksResponse($response);
-    }
-
     /**
      * Creates a new webhook
      *
@@ -130,19 +115,30 @@ public function testWebhook(string $webhookId)
         $this->post($this->url, $this->requestJson);
     }
 
+    /**
+     * Gets all of the available event types
+     *
+     * @return  \JohnConde\Authnet\AuthnetWebhooksResponse
+     */
+    public function getEventTypes() : object
+    {
+        $this->endpoint = 'eventtypes';
+        $this->url = sprintf('%s%s', $this->url, $this->endpoint);
+        return $this->getByUrl('eventtypes', '%s%s');
+    }
+
     /**
      * List all of your webhooks
      *
      * @return  \JohnConde\Authnet\AuthnetWebhooksResponse
-     * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      * @throws  \JohnConde\Authnet\AuthnetCurlException
+     * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      */
     public function getWebhooks() : object
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s', $this->url, $this->endpoint);
-        $response = $this->get($this->url);
-        return new AuthnetWebhooksResponse($response);
+        return $this->getByUrl('webhooks', '%s%s');
     }
 
     /**
@@ -150,14 +146,27 @@ public function getWebhooks() : object
      *
      * @param   string   $webhookId   Webhook ID to be retrieved
      * @return  \JohnConde\Authnet\AuthnetWebhooksResponse
-     * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      * @throws  \JohnConde\Authnet\AuthnetCurlException
+     * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
      */
     public function getWebhook(string $webhookId) : object
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s/%s', $this->url, $this->endpoint, $webhookId);
-        $response = $this->get($this->url);
+        return $this->getByUrl('webhooks', '%s%s/%s');
+    }
+
+    /**
+     * GET API request
+     *
+     * @param   string $url API endpoint to hit
+     * @return  object
+     * @throws  \JohnConde\Authnet\AuthnetCurlException
+     * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
+     */
+    private function getByUrl(string $url) : object
+    {
+        $response = $this->get($url);
         return new AuthnetWebhooksResponse($response);
     }
 
@@ -309,9 +318,9 @@ private function delete(string $url) : string
     /**
      * Sets the handler to be used to handle our API call. Mainly used for unit testing as Curl is used by default.
      *
-     * @param   object  $processor
+     * @param   \Curl\Curl  $processor
      */
-    public function setProcessHandler(object $processor)
+    public function setProcessHandler(\Curl\Curl $processor)
     {
         $this->processor = $processor;
     }

From b07585b4783ba02dc0ec5eb8cac3bcc18d466897 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 14:09:34 -0500
Subject: [PATCH 020/105] Updated to reflect changes to similar code in main
 class

---
 tests/AuthnetWebhooksRequestTest.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/AuthnetWebhooksRequestTest.php b/tests/AuthnetWebhooksRequestTest.php
index 377fa2b..2a50f27 100644
--- a/tests/AuthnetWebhooksRequestTest.php
+++ b/tests/AuthnetWebhooksRequestTest.php
@@ -93,6 +93,7 @@ public function testToStringNA()
 
     /**
      * @covers            \JohnConde\Authnet\AuthnetWebhooksRequest::getEventTypes()
+     * @covers            \JohnConde\Authnet\AuthnetWebhooksRequest::getByUrl()
      */
     public function testGetEventTypes()
     {
@@ -236,6 +237,7 @@ public function testDeleteWebhook()
 
     /**
      * @covers            \JohnConde\Authnet\AuthnetWebhooksRequest::getWebhooks()
+     * @covers            \JohnConde\Authnet\AuthnetWebhooksRequest::getByUrl()
      */
     public function testGetWebhooks()
     {
@@ -296,6 +298,7 @@ public function testGetWebhooks()
 
     /**
      * @covers            \JohnConde\Authnet\AuthnetWebhooksRequest::getWebhook()
+     * @covers            \JohnConde\Authnet\AuthnetWebhooksRequest::getByUrl()
      */
     public function testGetWebhook()
     {

From f0fa21c80835eb9f626d7f341edda7f210d31330 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 14:33:54 -0500
Subject: [PATCH 021/105] Fixed incorrect parameters to getByUrl()

---
 src/authnet/AuthnetWebhooksRequest.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php
index ac90e24..e813a19 100644
--- a/src/authnet/AuthnetWebhooksRequest.php
+++ b/src/authnet/AuthnetWebhooksRequest.php
@@ -124,7 +124,7 @@ public function getEventTypes() : object
     {
         $this->endpoint = 'eventtypes';
         $this->url = sprintf('%s%s', $this->url, $this->endpoint);
-        return $this->getByUrl('eventtypes', '%s%s');
+        return $this->getByUrl($this->url);
     }
 
     /**
@@ -138,7 +138,7 @@ public function getWebhooks() : object
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s', $this->url, $this->endpoint);
-        return $this->getByUrl('webhooks', '%s%s');
+        return $this->getByUrl($this->url);
     }
 
     /**
@@ -153,7 +153,7 @@ public function getWebhook(string $webhookId) : object
     {
         $this->endpoint = 'webhooks';
         $this->url = sprintf('%s%s/%s', $this->url, $this->endpoint, $webhookId);
-        return $this->getByUrl('webhooks', '%s%s/%s');
+        return $this->getByUrl($this->url);
     }
 
     /**

From 6084420bbc31c75031f42eb6a7d73245e48eae1e Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 18:17:58 -0500
Subject: [PATCH 022/105] Combined similar logic into one method

---
 src/authnet/AuthnetJsonResponse.php | 39 ++++++++++++++++-------------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php
index 3dcbaf7..ee32560 100644
--- a/src/authnet/AuthnetJsonResponse.php
+++ b/src/authnet/AuthnetJsonResponse.php
@@ -232,30 +232,23 @@ public function getRawResponse() : string
     }
 
     /**
-     * If an error has occurred, returns the error message
+     * An alias of self::getErrorText()
      *
      * @return  string Error response from Authorize.Net
      */
-    public function getErrorText() : string
+    public function getErrorMessage() : string
     {
-        $message = '';
-        if ($this->isError()) {
-            $message = $this->messages->message[0]->text;
-            if (@$this->transactionResponse->errors[0]->errorText) {
-                $message = $this->transactionResponse->errors[0]->errorText;
-            }
-        }
-        return $message;
+        return $this->getErrorText();
     }
 
     /**
-     * An alias of self::getErrorText()
+     * If an error has occurred, returns the error message
      *
      * @return  string Error response from Authorize.Net
      */
-    public function getErrorMessage() : string
+    public function getErrorText() : string
     {
-        return $this->getErrorText();
+        return $this->getError('text');
     }
 
     /**
@@ -265,13 +258,23 @@ public function getErrorMessage() : string
      */
     public function getErrorCode() : string
     {
-        $code = '';
+        return $this->getError('code');
+    }
+
+    /**
+     * @param  string   $type     Whether to get the error code or text
+     * @return string
+     */
+    private function getError(string $type) : string
+    {
+        $msg = '';
         if ($this->isError()) {
-            $code = $this->messages->message[0]->code;
-            if (@$this->transactionResponse->errors[0]->errorCode) {
-                $code = $this->transactionResponse->errors[0]->errorCode;
+            $prop = sprintf('error%s', ucfirst($type));
+            $msg = $this->messages->message[0]->{$type};
+            if (@$this->transactionResponse->errors[0]->{$prop}) {
+                $msg = $this->transactionResponse->errors[0]->{$prop};
             }
         }
-        return $code;
+        return $msg;
     }
 }

From 656bf60e0f3d49eeb6e1e45c1005a81f0ec1ef26 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 18:18:13 -0500
Subject: [PATCH 023/105] Updated to include coverage for new method

---
 tests/AuthnetJsonResponseTest.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/AuthnetJsonResponseTest.php b/tests/AuthnetJsonResponseTest.php
index 71c7c26..6810a05 100644
--- a/tests/AuthnetJsonResponseTest.php
+++ b/tests/AuthnetJsonResponseTest.php
@@ -375,6 +375,7 @@ public function testGetErrorMethods()
     /**
      * @covers            \JohnConde\Authnet\AuthnetJsonResponse::getErrorText()
      * @covers            \JohnConde\Authnet\AuthnetJsonResponse::getErrorCode()
+     * @covers            \JohnConde\Authnet\AuthnetJsonResponse::getError()
      */
     public function testGetErrorTextAim()
     {
@@ -424,7 +425,8 @@ public function testGetErrorTextAim()
     }
 
     /**
-     * @covers            \JohnConde\Authnet\AuthnetJsonResponse::getErrorMessage()
+     * @covers \JohnConde\Authnet\AuthnetJsonResponse::getErrorMessage()
+     * @covers \JohnConde\Authnet\AuthnetJsonResponse::getError()
      */
     public function testGetErrorMessage()
     {

From 3e8a8fe6d8be303ba06c1a73bddcc6f604c2e62c Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 26 Jan 2019 19:15:26 -0500
Subject: [PATCH 024/105] Getting ready for merge of 3.1.8 into branch

---
 CHANGELOG | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index a77be7b..0452b94 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,13 +1,5 @@
 CHANGE LOG
 
-2019-XX-XX - Version 4.0.0
---------------------------------------------
-Bumped minimum supported version of PHP to 7.2
-Removed not actually missing return statement to AuthnetWebhooksRequest::delete
-Reduced complexity of AuthnetApiFactory::getWebServiceURL)(
-Reduced complexity of AuthnetWebhooksResponse::getEventTypes()
-Minor formatting changes
-
 2019-01-22 - Version 3.1.7
 --------------------------------------------
 Fixed incorrect and/or incomplete docblock comments

From e24b324f54fd213f24299ed470a61b61b63663ea Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Mon, 28 Jan 2019 21:59:43 -0500
Subject: [PATCH 025/105] Fixed whitespace issue. Fixed incorrect variable name
 when getting results.

---
 examples/cim/deleteCustomerProfileRequest.php | 14 +++----
 .../reporting/getBatchStatisticsRequest.php   | 14 +++----
 .../reporting/getSettledBatchListRequest.php  | 20 +++++-----
 .../getTransactionDetailsRequest.php          | 14 +++----
 .../reporting/getTransactionListRequest.php   | 18 ++++-----
 .../getUnsettledTransactionListRequest.php    | 38 +++++++++----------
 6 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/examples/cim/deleteCustomerProfileRequest.php b/examples/cim/deleteCustomerProfileRequest.php
index 7f6f17d..af710f8 100644
--- a/examples/cim/deleteCustomerProfileRequest.php
+++ b/examples/cim/deleteCustomerProfileRequest.php
@@ -65,13 +65,13 @@
 
             pre
             {
-            	overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
-            	white-space: pre-wrap; /* css-3 */
-            	white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
-            	white-space: -pre-wrap; /* Opera 4-6 */
-            	white-space: -o-pre-wrap; /* Opera 7 */ /*
-            	width: 99%; */
-            	word-wrap: break-word; /* Internet Explorer 5.5+ */
+                overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
+                white-space: pre-wrap; /* css-3 */
+                white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+                white-space: -pre-wrap; /* Opera 4-6 */
+                white-space: -o-pre-wrap; /* Opera 7 */ /*
+                width: 99%; */
+                word-wrap: break-word; /* Internet Explorer 5.5+ */
             }
 
             table th
diff --git a/examples/reporting/getBatchStatisticsRequest.php b/examples/reporting/getBatchStatisticsRequest.php
index c52232d..a728807 100644
--- a/examples/reporting/getBatchStatisticsRequest.php
+++ b/examples/reporting/getBatchStatisticsRequest.php
@@ -109,13 +109,13 @@
 
             pre
             {
-            	overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
-            	white-space: pre-wrap; /* css-3 */
-            	white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
-            	white-space: -pre-wrap; /* Opera 4-6 */
-            	white-space: -o-pre-wrap; /* Opera 7 */ /*
-            	width: 99%; */
-            	word-wrap: break-word; /* Internet Explorer 5.5+ */
+                overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
+                white-space: pre-wrap; /* css-3 */
+                white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+                white-space: -pre-wrap; /* Opera 4-6 */
+                white-space: -o-pre-wrap; /* Opera 7 */ /*
+                width: 99%; */
+                word-wrap: break-word; /* Internet Explorer 5.5+ */
             }
 
             table th
diff --git a/examples/reporting/getSettledBatchListRequest.php b/examples/reporting/getSettledBatchListRequest.php
index 1f327e6..bd0f805 100644
--- a/examples/reporting/getSettledBatchListRequest.php
+++ b/examples/reporting/getSettledBatchListRequest.php
@@ -171,8 +171,8 @@
     $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
     $response = $request->getSettledBatchListRequest([
         'includeStatistics'   => 'true',
-        'firstSettlementDate' => '2015-01-01T08:15:30',
-        'lastSettlementDate'  => '2015-01-30T08:15:30',
+        'firstSettlementDate' => '2018-01-01T08:15:30',
+        'lastSettlementDate'  => '2018-01-30T08:15:30',
     ]);
 ?>
 
@@ -199,13 +199,13 @@
 
             pre
             {
-            	overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
-            	white-space: pre-wrap; /* css-3 */
-            	white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
-            	white-space: -pre-wrap; /* Opera 4-6 */
-            	white-space: -o-pre-wrap; /* Opera 7 */ /*
-            	width: 99%; */
-            	word-wrap: break-word; /* Internet Explorer 5.5+ */
+                overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
+                white-space: pre-wrap; /* css-3 */
+                white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+                white-space: -pre-wrap; /* Opera 4-6 */
+                white-space: -o-pre-wrap; /* Opera 7 */ /*
+                width: 99%; */
+                word-wrap: break-word; /* Internet Explorer 5.5+ */
             }
 
             table th
@@ -240,7 +240,7 @@
                 
Error? isError()) ? 'yes' : 'no'; ?>
Batch diff --git a/examples/reporting/getTransactionDetailsRequest.php b/examples/reporting/getTransactionDetailsRequest.php index 6cf8db0..28dce22 100644 --- a/examples/reporting/getTransactionDetailsRequest.php +++ b/examples/reporting/getTransactionDetailsRequest.php @@ -130,13 +130,13 @@ pre { - overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ /* - width: 99%; */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ + overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ /* + width: 99%; */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ } table th diff --git a/examples/reporting/getTransactionListRequest.php b/examples/reporting/getTransactionListRequest.php index 8a5211e..9efad3b 100644 --- a/examples/reporting/getTransactionListRequest.php +++ b/examples/reporting/getTransactionListRequest.php @@ -65,7 +65,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getTransactionListRequest([ - 'batchId' => '1221577' + 'batchId' => '7864228' ]); ?> @@ -92,13 +92,13 @@ pre { - overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ /* - width: 99%; */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ + overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ /* + width: 99%; */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ } table th @@ -133,7 +133,7 @@ Error? isError()) ? 'yes' : 'no'; ?>
Transaction diff --git a/examples/reporting/getUnsettledTransactionListRequest.php b/examples/reporting/getUnsettledTransactionListRequest.php index 13cf1f3..957efa5 100644 --- a/examples/reporting/getUnsettledTransactionListRequest.php +++ b/examples/reporting/getUnsettledTransactionListRequest.php @@ -8,16 +8,16 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - + /************************************************************************************************* Use the Transaction Details API to get a list of unsettled transactions SAMPLE REQUEST -------------------------------------------------------------------------------------------------- -{ - "getUnsettledTransactionListRequest":{ - "merchantAuthentication":{ +{ + "getUnsettledTransactionListRequest":{ + "merchantAuthentication":{ "name":"", "transactionKey":"" } @@ -27,8 +27,8 @@ SAMPLE RESPONSE -------------------------------------------------------------------------------------------------- { - "transactions":[ - { + "transactions":[ + { "transId":"2228546203", "submitTimeUTC":"2015-02-16T03:34:43Z", "submitTimeLocal":"2015-02-15T20:34:43", @@ -43,7 +43,7 @@ "product":"Card Not Present", "hasReturnedItemsSpecified":false }, - { + { "transId":"2228546083", "submitTimeUTC":"2015-02-16T03:31:42Z", "submitTimeLocal":"2015-02-15T20:31:42", @@ -58,7 +58,7 @@ "product":"Card Not Present", "hasReturnedItemsSpecified":false }, - { + { "transId":"2228545865", "submitTimeUTC":"2015-02-16T03:25:00Z", "submitTimeLocal":"2015-02-15T20:25:00", @@ -74,10 +74,10 @@ "hasReturnedItemsSpecified":false } ], - "messages":{ + "messages":{ "resultCode":"Ok", - "message":[ - { + "message":[ + { "code":"I00001", "text":"Successful." } @@ -119,13 +119,13 @@ pre { - overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ /* - width: 99%; */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ + overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ /* + width: 99%; */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ } table th @@ -160,7 +160,7 @@ Error? isError()) ? 'yes' : 'no'; ?>
Transaction From 9d30a2d23a916aac934e76945595b1f5646d1cb7 Mon Sep 17 00:00:00 2001 From: John Conde Date: Mon, 28 Jan 2019 22:00:16 -0500 Subject: [PATCH 026/105] Added new shiny badges --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04701a6..e3c260d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ [![Latest Stable Version](https://poser.pugx.org/stymiee/authnetjson/v/stable.svg)](https://packagist.org/packages/stymiee/authnetjson) +[![Total Downloads](https://poser.pugx.org/stymiee/authnetjson/downloads)](https://packagist.org/packages/stymiee/authnetjson) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/stymiee/authnetjson/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/build.png?b=master)](https://scrutinizer-ci.com/g/stymiee/authnetjson/build-status/master) [![Maintainability](https://api.codeclimate.com/v1/badges/5847da924af47933e25f/maintainability)](https://codeclimate.com/github/stymiee/authnetjson/maintainability) - +[![License](https://poser.pugx.org/stymiee/authnetjson/license)](https://packagist.org/packages/stymiee/authnetjson) # AuthnetJSON Library that abstracts [Authorize.Net](http://www.authorize.net/)'s [JSON APIs](http://developer.authorize.net/api/reference/). From bf2fca9e1d9d281ba02057e04900a818b042b163 Mon Sep 17 00:00:00 2001 From: John Conde Date: Mon, 28 Jan 2019 22:09:31 -0500 Subject: [PATCH 027/105] Added declare(strict_types = 1); to all src files --- src/authnet/AuthnetApiFactory.php | 2 +- src/authnet/AuthnetJsonRequest.php | 2 +- src/authnet/AuthnetJsonResponse.php | 2 +- src/authnet/AuthnetSim.php | 2 +- src/authnet/AuthnetWebhook.php | 2 +- src/authnet/AuthnetWebhooksRequest.php | 2 +- src/authnet/AuthnetWebhooksResponse.php | 2 +- src/authnet/TransactionResponse.php | 2 +- src/exceptions/AuthnetCannotSetParamsException.php | 2 +- src/exceptions/AuthnetCurlException.php | 2 +- src/exceptions/AuthnetException.php | 2 +- src/exceptions/AuthnetInvalidAmountException.php | 2 +- src/exceptions/AuthnetInvalidCredentialsException.php | 2 +- src/exceptions/AuthnetInvalidJsonException.php | 2 +- src/exceptions/AuthnetInvalidParameterException.php | 2 +- src/exceptions/AuthnetInvalidServerException.php | 2 +- src/exceptions/AuthnetTransactionResponseCallException.php | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index 56c2b8c..d75560e 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -1,4 +1,4 @@ - Date: Thu, 31 Jan 2019 20:17:57 -0500 Subject: [PATCH 028/105] Cleaned up HTML and CSS in examples --- .../createTransactionRequest_authCapture.php | 46 +-- .../aim/createTransactionRequest_authOnly.php | 46 +-- .../createTransactionRequest_captureOnly.php | 323 ++++++++------- ...teTransactionRequest_paypalAuthCapture.php | 377 ++++++++---------- ...ctionRequest_paypalAuthCaptureContinue.php | 339 +++++++--------- ...reateTransactionRequest_paypalAuthOnly.php | 339 +++++++--------- ...nsactionRequest_paypalAuthOnlyContinue.php | 339 +++++++--------- ...ateTransactionRequest_paypalGetDetails.php | 319 +++++++-------- ...nsactionRequest_paypalPriorAuthCapture.php | 319 +++++++-------- .../createTransactionRequest_paypalRefund.php | 309 +++++++------- .../createTransactionRequest_paypalVoid.php | 319 +++++++-------- ...ateTransactionRequest_priorAuthCapture.php | 305 +++++++------- .../aim/createTransactionRequest_refund.php | 46 +-- .../createTransactionRequest_visaCheckout.php | 45 +-- .../aim/createTransactionRequest_void.php | 46 +-- examples/aim/decryptPaymentDataRequest.php | 273 ++++++------- .../sendCustomerTransactionReceiptRequest.php | 46 +-- examples/arb/ARBCancelSubscriptionRequest.php | 46 +-- examples/arb/ARBCreateSubscriptionRequest.php | 46 +-- .../arb/ARBGetSubscriptionStatusRequest.php | 46 +-- examples/arb/ARBUpdateSubscriptionRequest.php | 46 +-- .../createCustomerPaymentProfileRequest.php | 46 +-- examples/cim/createCustomerProfileRequest.php | 46 +-- ...tomerProfileRequestMultiplePayAccounts.php | 1 - ...rProfileTransactionRequest_authCapture.php | 46 +-- ...omerProfileTransactionRequest_authOnly.php | 46 +-- ...rProfileTransactionRequest_captureOnly.php | 1 - ...ileTransactionRequest_priorAuthCapture.php | 46 +-- ...stomerProfileTransactionRequest_refund.php | 46 +-- ...CustomerProfileTransactionRequest_void.php | 46 +-- .../createCustomerShippingAddressRequest.php | 46 +-- .../deleteCustomerPaymentProfileRequest.php | 46 +-- examples/cim/deleteCustomerProfileRequest.php | 46 +-- .../deleteCustomerShippingAddressRequest.php | 46 +-- .../cim/getCustomerPaymentProfileRequest.php | 46 +-- examples/cim/getCustomerProfileIdsRequest.php | 46 +-- examples/cim/getCustomerProfileRequest.php | 46 +-- .../cim/getCustomerShippingAddressRequest.php | 46 +-- examples/cim/getHostedProfilePageRequest.php | 46 +-- .../updateCustomerPaymentProfileRequest.php | 46 +-- examples/cim/updateCustomerProfileRequest.php | 46 +-- .../updateCustomerShippingAddressRequest.php | 46 +-- .../cim/updateSplitTenderGroupRequest.php | 46 +-- .../validateCustomerPaymentProfileRequest.php | 46 +-- .../reporting/getBatchStatisticsRequest.php | 46 +-- .../reporting/getSettledBatchListRequest.php | 46 +-- .../getTransactionDetailsRequest.php | 46 +-- .../reporting/getTransactionListRequest.php | 46 +-- .../getUnsettledTransactionListRequest.php | 46 +-- examples/sim/sim.php | 1 - examples/webhooks/createWebhook.php | 344 ++++++++-------- examples/webhooks/deleteWebhook.php | 198 ++++----- examples/webhooks/getEventTypes.php | 352 ++++++++-------- examples/webhooks/getWebhook.php | 280 ++++++------- examples/webhooks/listWebhooks.php | 354 ++++++++-------- examples/webhooks/notificationHistory.php | 290 +++++++------- examples/webhooks/ping.php | 196 ++++----- examples/webhooks/updateWebhook.php | 334 ++++++++-------- 58 files changed, 2978 insertions(+), 4589 deletions(-) diff --git a/examples/aim/createTransactionRequest_authCapture.php b/examples/aim/createTransactionRequest_authCapture.php index 916f4e4..4cb927d 100644 --- a/examples/aim/createTransactionRequest_authCapture.php +++ b/examples/aim/createTransactionRequest_authCapture.php @@ -291,48 +291,16 @@ ?> - AIM :: Authorize and Capture - +

diff --git a/examples/aim/createTransactionRequest_authOnly.php b/examples/aim/createTransactionRequest_authOnly.php index 48ad056..f9fec21 100644 --- a/examples/aim/createTransactionRequest_authOnly.php +++ b/examples/aim/createTransactionRequest_authOnly.php @@ -253,48 +253,16 @@ ?> - - +

diff --git a/examples/aim/createTransactionRequest_captureOnly.php b/examples/aim/createTransactionRequest_captureOnly.php index ea03f9e..3218a27 100644 --- a/examples/aim/createTransactionRequest_captureOnly.php +++ b/examples/aim/createTransactionRequest_captureOnly.php @@ -1,162 +1,161 @@ -createTransactionRequest([ - 'refId' => rand(1000000, 100000000), - 'transactionRequest' => [ - 'transactionType' => 'captureOnlyTransaction', - 'amount' => 5, - 'payment' => [ - 'creditCard' => [ - 'cardNumber' => '5424000000000015', - 'expirationDate' => '122020' - ] - ], - 'authCode' => '123456' - ], - ]); -?> - - - - - - - - - -

- AIM :: Capture Only -

-

- Results -

- - - - - - - - - - - - - - - - - - - - - -
Responsemessages->resultCode; ?>
codemessages->message[0]->code; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
transIdtransactionResponse->transId; ?>
-

- Raw Input/Output -

- - - +createTransactionRequest([ + 'refId' => rand(1000000, 100000000), + 'transactionRequest' => [ + 'transactionType' => 'captureOnlyTransaction', + 'amount' => 5, + 'payment' => [ + 'creditCard' => [ + 'cardNumber' => '5424000000000015', + 'expirationDate' => '122020' + ] + ], + 'authCode' => '123456' + ], + ]); +?> + + + + + + + + +

+ AIM :: Capture Only +

+

+ Results +

+ + + + + + + + + + + + + + + + + + + + + +
Responsemessages->resultCode; ?>
codemessages->message[0]->code; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
transIdtransactionResponse->transId; ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_paypalAuthCapture.php b/examples/aim/createTransactionRequest_paypalAuthCapture.php index b11dfc2..3d726ca 100644 --- a/examples/aim/createTransactionRequest_paypalAuthCapture.php +++ b/examples/aim/createTransactionRequest_paypalAuthCapture.php @@ -1,204 +1,173 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the AIM JSON API to process an Authorize and Capture transaction through Paypal - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- -{ - "createTransactionRequest": { - "merchantAuthentication": { - "name": "cnpdev4289", - "transactionKey": "SR2P8g4jdEn7vFLQ" - }, - "transactionRequest": { - "transactionType": "authCaptureTransaction", - "amount": "80.93", - "payment": { - "payPal": { - "successUrl": "https://my.server.com/success.html", - "cancelUrl": "https://my.server.com/cancel.html", - "paypalLc": "", - "paypalHdrImg": "", - "paypalPayflowcolor": "FFFF00" - } - }, - "lineItems": { - "lineItem": { - "itemId": "item1", - "name": "golf balls", - "quantity": "1", - "unitPrice": "18.95" - } - } - } - } -} - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- -{ - "transactionResponse": { - "responseCode": "1", - "transId": "2149186848", - "refTransID": "2149186775", - "transHash": "D6C9036F443BADE785D57DA2B44CD190", - "testRequest": "0", - "accountType": "PayPal", - "messages": [ - { - "code": "1", - "description": "This transaction has been approved." - } - ] - }, - "refId": "123456", - "messages": { - "resultCode": "Ok", - "message": [ - { - "code": "I00001", - "text": "Successful." - } - ] - } -} - -*************************************************************************************************/ - - namespace JohnConde\Authnet; - - require('../../config.inc.php'); - require('../../src/autoload.php'); - - $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->createTransactionRequest([ - "transactionRequest" => [ - "transactionType" => "authCaptureTransaction", - "amount" => "80.93", - "payment" => [ - "payPal" => [ - "successUrl" => "https://my.server.com/success.html", - "cancelUrl" => "https://my.server.com/cancel.html", - "paypalLc" => "", - "paypalHdrImg" => "", - "paypalPayflowcolor" => "FFFF00" - ] - ], - "lineItems" => [ - "lineItem" => [ - "itemId" => "item1", - "name" => "golf balls", - "quantity" => "1", - "unitPrice" => "18.95" - ] - ] - ] - ]); -?> - - - - - AIM :: Paypal :: Authorize and Capture - - - -

- AIM :: Authorize and Capture -

-

- Results -

- - - - - - - - - - - - - - isSuccessful()) : ?> - - - - - - - - - - - - - isError()) : ?> - - - - - - - - - -
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
-

- Raw Input/Output -

- - - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the AIM JSON API to process an Authorize and Capture transaction through Paypal + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- +{ + "createTransactionRequest": { + "merchantAuthentication": { + "name": "cnpdev4289", + "transactionKey": "SR2P8g4jdEn7vFLQ" + }, + "transactionRequest": { + "transactionType": "authCaptureTransaction", + "amount": "80.93", + "payment": { + "payPal": { + "successUrl": "https://my.server.com/success.html", + "cancelUrl": "https://my.server.com/cancel.html", + "paypalLc": "", + "paypalHdrImg": "", + "paypalPayflowcolor": "FFFF00" + } + }, + "lineItems": { + "lineItem": { + "itemId": "item1", + "name": "golf balls", + "quantity": "1", + "unitPrice": "18.95" + } + } + } + } +} + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- +{ + "transactionResponse": { + "responseCode": "1", + "transId": "2149186848", + "refTransID": "2149186775", + "transHash": "D6C9036F443BADE785D57DA2B44CD190", + "testRequest": "0", + "accountType": "PayPal", + "messages": [ + { + "code": "1", + "description": "This transaction has been approved." + } + ] + }, + "refId": "123456", + "messages": { + "resultCode": "Ok", + "message": [ + { + "code": "I00001", + "text": "Successful." + } + ] + } +} + +*************************************************************************************************/ + + namespace JohnConde\Authnet; + + require('../../config.inc.php'); + require('../../src/autoload.php'); + + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createTransactionRequest([ + "transactionRequest" => [ + "transactionType" => "authCaptureTransaction", + "amount" => "80.93", + "payment" => [ + "payPal" => [ + "successUrl" => "https://my.server.com/success.html", + "cancelUrl" => "https://my.server.com/cancel.html", + "paypalLc" => "", + "paypalHdrImg" => "", + "paypalPayflowcolor" => "FFFF00" + ] + ], + "lineItems" => [ + "lineItem" => [ + "itemId" => "item1", + "name" => "golf balls", + "quantity" => "1", + "unitPrice" => "18.95" + ] + ] + ] + ]); +?> + + + + + AIM :: Paypal :: Authorize and Capture + + + +

+ AIM :: Authorize and Capture +

+

+ Results +

+ + + + + + + + + + + + + + isSuccessful()) : ?> + + + + + + + + + + + + + isError()) : ?> + + + + + + + + + +
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php index 0ccea36..facfd15 100644 --- a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php +++ b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php @@ -1,185 +1,154 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the AIM JSON API to process an Authorize and Capture Continue transaction through Paypal - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- -{ - "createTransactionRequest": { - "merchantAuthentication": { - "name": "cnpdev4289", - "transactionKey": "SR2P8g4jdEn7vFLQ" - }, - "transactionRequest": { - "transactionType": "authCaptureContinueTransaction", - "payment": { - "payPal": { - "payerID": "S6D5ETGSVYX94" - } - }, - "refTransId": "139" - } - } -} - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- -{ - "transactionResponse": { - "responseCode": "1", - "authCode": "HH5414", - "avsResultCode": "P", - "cvvResultCode": "", - "cavvResultCode": "", - "transId": "2149186848", - "refTransID": "2149186848", - "transHash": "D3A855F0934EB404DE3B13508D0E3826", - "testRequest": "0", - "accountNumber": "XXXX0015", - "accountType": "MasterCard", - "messages": [ - { - "code": "1", - "description": "This transaction has been approved." - } - ] - }, - "refId": "123456", - "messages": { - "resultCode": "Ok", - "message": [ - { - "code": "I00001", - "text": "Successful." - } - ] - } -} - -*************************************************************************************************/ - - namespace JohnConde\Authnet; - - require('../../config.inc.php'); - require('../../src/autoload.php'); - - $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->createTransactionRequest([ - "transactionRequest" => [ - "transactionType" => "authCaptureContinueTransaction", - "payment" => [ - "payPal" => [ - "payerID" => "S6D5ETGSVYX94" - ] - ], - "refTransId" => "139" - ] - ]); -?> - - - - - AIM :: Paypal :: Authorize and Capture Continue - - - -

- AIM :: Authorize and Capture -

-

- Results -

- - - - - - - - - - - - - - isSuccessful()) : ?> - - - - - - - - - - - - - isError()) : ?> - - - - - - - - - -
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
-

- Raw Input/Output -

- - - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the AIM JSON API to process an Authorize and Capture Continue transaction through Paypal + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- +{ + "createTransactionRequest": { + "merchantAuthentication": { + "name": "cnpdev4289", + "transactionKey": "SR2P8g4jdEn7vFLQ" + }, + "transactionRequest": { + "transactionType": "authCaptureContinueTransaction", + "payment": { + "payPal": { + "payerID": "S6D5ETGSVYX94" + } + }, + "refTransId": "139" + } + } +} + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- +{ + "transactionResponse": { + "responseCode": "1", + "authCode": "HH5414", + "avsResultCode": "P", + "cvvResultCode": "", + "cavvResultCode": "", + "transId": "2149186848", + "refTransID": "2149186848", + "transHash": "D3A855F0934EB404DE3B13508D0E3826", + "testRequest": "0", + "accountNumber": "XXXX0015", + "accountType": "MasterCard", + "messages": [ + { + "code": "1", + "description": "This transaction has been approved." + } + ] + }, + "refId": "123456", + "messages": { + "resultCode": "Ok", + "message": [ + { + "code": "I00001", + "text": "Successful." + } + ] + } +} + +*************************************************************************************************/ + + namespace JohnConde\Authnet; + + require('../../config.inc.php'); + require('../../src/autoload.php'); + + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createTransactionRequest([ + "transactionRequest" => [ + "transactionType" => "authCaptureContinueTransaction", + "payment" => [ + "payPal" => [ + "payerID" => "S6D5ETGSVYX94" + ] + ], + "refTransId" => "139" + ] + ]); +?> + + + + + AIM :: Paypal :: Authorize and Capture Continue + + + +

+ AIM :: Authorize and Capture +

+

+ Results +

+ + + + + + + + + + + + + + isSuccessful()) : ?> + + + + + + + + + + + + + isError()) : ?> + + + + + + + + + +
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_paypalAuthOnly.php b/examples/aim/createTransactionRequest_paypalAuthOnly.php index 36fc3fd..bd5013f 100644 --- a/examples/aim/createTransactionRequest_paypalAuthOnly.php +++ b/examples/aim/createTransactionRequest_paypalAuthOnly.php @@ -1,185 +1,154 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the AIM JSON API to process an Auth Only transaction through Paypal - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- -{ - "createTransactionRequest": { - "merchantAuthentication": { - "name": "cnpdev4289", - "transactionKey": "SR2P8g4jdEn7vFLQ" - }, - "transactionRequest": { - "transactionType": "authOnlyTransaction", - "amount": "5", - "payment": { - "payPal": { - "successUrl": "https://my.server.com/success.html", - "cancelUrl": "https://my.server.com/cancel.html" - } - } - } - } -} - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- -{ - "transactionResponse": { - "responseCode": "5", - "rawResponseCode": "0", - "transId": "2149186954", - "refTransID": "", - "transHash": "A719785EE9752530FDCE67695E9A56EE", - "testRequest": "0", - "accountType": "PayPal", - "messages": [ - { - "code": "2000", - "description": "Need payer consent." - } - ], - "secureAcceptance": { - "SecureAcceptanceUrl": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-C506B0LGTG2J800OK" - } - }, - "messages": { - "resultCode": "Ok", - "message": [ - { - "code": "I00001", - "text": "Successful." - } - ] - } -} - -*************************************************************************************************/ - - namespace JohnConde\Authnet; - - require('../../config.inc.php'); - require('../../src/autoload.php'); - - $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->createTransactionRequest([ - "transactionRequest" => [ - "transactionType" => "authOnlyTransaction", - "amount" => "5", - "payment" => [ - "payPal" => [ - "successUrl" => "https://my.server.com/success.html", - "cancelUrl" => "https://my.server.com/cancel.html" - ] - ] - ] - ]); -?> - - - - - AIM :: Paypal :: Auth Only - - - -

- AIM :: Authorize and Capture -

-

- Results -

- - - - - - - - - - - - - - isSuccessful()) : ?> - - - - - - - - - - - - - isError()) : ?> - - - - - - - - - -
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
-

- Raw Input/Output -

- - - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the AIM JSON API to process an Auth Only transaction through Paypal + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- +{ + "createTransactionRequest": { + "merchantAuthentication": { + "name": "cnpdev4289", + "transactionKey": "SR2P8g4jdEn7vFLQ" + }, + "transactionRequest": { + "transactionType": "authOnlyTransaction", + "amount": "5", + "payment": { + "payPal": { + "successUrl": "https://my.server.com/success.html", + "cancelUrl": "https://my.server.com/cancel.html" + } + } + } + } +} + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- +{ + "transactionResponse": { + "responseCode": "5", + "rawResponseCode": "0", + "transId": "2149186954", + "refTransID": "", + "transHash": "A719785EE9752530FDCE67695E9A56EE", + "testRequest": "0", + "accountType": "PayPal", + "messages": [ + { + "code": "2000", + "description": "Need payer consent." + } + ], + "secureAcceptance": { + "SecureAcceptanceUrl": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-C506B0LGTG2J800OK" + } + }, + "messages": { + "resultCode": "Ok", + "message": [ + { + "code": "I00001", + "text": "Successful." + } + ] + } +} + +*************************************************************************************************/ + + namespace JohnConde\Authnet; + + require('../../config.inc.php'); + require('../../src/autoload.php'); + + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createTransactionRequest([ + "transactionRequest" => [ + "transactionType" => "authOnlyTransaction", + "amount" => "5", + "payment" => [ + "payPal" => [ + "successUrl" => "https://my.server.com/success.html", + "cancelUrl" => "https://my.server.com/cancel.html" + ] + ] + ] + ]); +?> + + + + + AIM :: Paypal :: Auth Only + + + +

+ AIM :: Authorize and Capture +

+

+ Results +

+ + + + + + + + + + + + + + isSuccessful()) : ?> + + + + + + + + + + + + + isError()) : ?> + + + + + + + + + +
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php index f947a8d..03b1357 100644 --- a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php +++ b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php @@ -1,185 +1,154 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the AIM JSON API to process an Auth Only Continue transaction through Paypal - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- -{ - "createTransactionRequest": { - "merchantAuthentication": { - "name": "cnpdev4289", - "transactionKey": "SR2P8g4jdEn7vFLQ" - }, - "transactionRequest": { - "transactionType": "authOnlyContinueTransaction", - "payment": { - "payPal": { - "payerID": "S6D5ETGSVYX94" - } - }, - "refTransId": "128" - } - } -} - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- -{ - "transactionResponse": { - "responseCode": "1", - "authCode": "HH5414", - "avsResultCode": "P", - "cvvResultCode": "", - "cavvResultCode": "", - "transId": "2149186848", - "refTransID": "2149186848", - "transHash": "D3A855F0934EB404DE3B13508D0E3826", - "testRequest": "0", - "accountNumber": "XXXX0015", - "accountType": "MasterCard", - "messages": [ - { - "code": "1", - "description": "This transaction has been approved." - } - ] - }, - "refId": "123456", - "messages": { - "resultCode": "Ok", - "message": [ - { - "code": "I00001", - "text": "Successful." - } - ] - } -} - -*************************************************************************************************/ - - namespace JohnConde\Authnet; - - require('../../config.inc.php'); - require('../../src/autoload.php'); - - $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->authOnlyContinueTransaction([ - "transactionRequest" => [ - "transactionType" => "authOnlyContinueTransaction", - "payment" => [ - "payPal" => [ - "payerID" => "S6D5ETGSVYX94" - ] - ], - "refTransId" => "128" - ] - ]); -?> - - - - - AIM :: Paypal :: Auth Only Continue - - - -

- AIM :: Authorize and Capture -

-

- Results -

- - - - - - - - - - - - - - isSuccessful()) : ?> - - - - - - - - - - - - - isError()) : ?> - - - - - - - - - -
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
-

- Raw Input/Output -

- - - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the AIM JSON API to process an Auth Only Continue transaction through Paypal + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- +{ + "createTransactionRequest": { + "merchantAuthentication": { + "name": "cnpdev4289", + "transactionKey": "SR2P8g4jdEn7vFLQ" + }, + "transactionRequest": { + "transactionType": "authOnlyContinueTransaction", + "payment": { + "payPal": { + "payerID": "S6D5ETGSVYX94" + } + }, + "refTransId": "128" + } + } +} + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- +{ + "transactionResponse": { + "responseCode": "1", + "authCode": "HH5414", + "avsResultCode": "P", + "cvvResultCode": "", + "cavvResultCode": "", + "transId": "2149186848", + "refTransID": "2149186848", + "transHash": "D3A855F0934EB404DE3B13508D0E3826", + "testRequest": "0", + "accountNumber": "XXXX0015", + "accountType": "MasterCard", + "messages": [ + { + "code": "1", + "description": "This transaction has been approved." + } + ] + }, + "refId": "123456", + "messages": { + "resultCode": "Ok", + "message": [ + { + "code": "I00001", + "text": "Successful." + } + ] + } +} + +*************************************************************************************************/ + + namespace JohnConde\Authnet; + + require('../../config.inc.php'); + require('../../src/autoload.php'); + + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->authOnlyContinueTransaction([ + "transactionRequest" => [ + "transactionType" => "authOnlyContinueTransaction", + "payment" => [ + "payPal" => [ + "payerID" => "S6D5ETGSVYX94" + ] + ], + "refTransId" => "128" + ] + ]); +?> + + + + + AIM :: Paypal :: Auth Only Continue + + + +

+ AIM :: Authorize and Capture +

+

+ Results +

+ + + + + + + + + + + + + + isSuccessful()) : ?> + + + + + + + + + + + + + isError()) : ?> + + + + + + + + + +
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_paypalGetDetails.php b/examples/aim/createTransactionRequest_paypalGetDetails.php index 646caaa..d66dbbf 100644 --- a/examples/aim/createTransactionRequest_paypalGetDetails.php +++ b/examples/aim/createTransactionRequest_paypalGetDetails.php @@ -1,175 +1,144 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the AIM JSON API to process a Get Details transaction through Paypal - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- -{ - "createTransactionRequest": { - "merchantAuthentication": { - "name": "cnpdev4289", - "transactionKey": "SR2P8g4jdEn7vFLQ" - }, - "transactionRequest": { - "transactionType": "getDetailsTransaction", - "refTransId": "128" - } - } -} - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- -{ - "transactionResponse": { - "responseCode": "1", - "authCode": "HH5414", - "avsResultCode": "P", - "cvvResultCode": "", - "cavvResultCode": "", - "transId": "2149186848", - "refTransID": "2149186848", - "transHash": "D3A855F0934EB404DE3B13508D0E3826", - "testRequest": "0", - "accountNumber": "XXXX0015", - "accountType": "MasterCard", - "messages": [ - { - "code": "1", - "description": "This transaction has been approved." - } - ] - }, - "refId": "123456", - "messages": { - "resultCode": "Ok", - "message": [ - { - "code": "I00001", - "text": "Successful." - } - ] - } -} - -*************************************************************************************************/ - - namespace JohnConde\Authnet; - - require('../../config.inc.php'); - require('../../src/autoload.php'); - - $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->createTransactionRequest([ - "transactionRequest" => [ - "transactionType" => "getDetailsTransaction", - "refTransId" => "128" - ] - ]); -?> - - - - - AIM :: Paypal :: Get Details - - - -

- AIM :: Authorize and Capture -

-

- Results -

- - - - - - - - - - - - - - isSuccessful()) : ?> - - - - - - - - - - - - - isError()) : ?> - - - - - - - - - -
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
-

- Raw Input/Output -

- - - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the AIM JSON API to process a Get Details transaction through Paypal + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- +{ + "createTransactionRequest": { + "merchantAuthentication": { + "name": "cnpdev4289", + "transactionKey": "SR2P8g4jdEn7vFLQ" + }, + "transactionRequest": { + "transactionType": "getDetailsTransaction", + "refTransId": "128" + } + } +} + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- +{ + "transactionResponse": { + "responseCode": "1", + "authCode": "HH5414", + "avsResultCode": "P", + "cvvResultCode": "", + "cavvResultCode": "", + "transId": "2149186848", + "refTransID": "2149186848", + "transHash": "D3A855F0934EB404DE3B13508D0E3826", + "testRequest": "0", + "accountNumber": "XXXX0015", + "accountType": "MasterCard", + "messages": [ + { + "code": "1", + "description": "This transaction has been approved." + } + ] + }, + "refId": "123456", + "messages": { + "resultCode": "Ok", + "message": [ + { + "code": "I00001", + "text": "Successful." + } + ] + } +} + +*************************************************************************************************/ + + namespace JohnConde\Authnet; + + require('../../config.inc.php'); + require('../../src/autoload.php'); + + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createTransactionRequest([ + "transactionRequest" => [ + "transactionType" => "getDetailsTransaction", + "refTransId" => "128" + ] + ]); +?> + + + + + AIM :: Paypal :: Get Details + + + +

+ AIM :: Authorize and Capture +

+

+ Results +

+ + + + + + + + + + + + + + isSuccessful()) : ?> + + + + + + + + + + + + + isError()) : ?> + + + + + + + + + +
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php index 2ac644b..dc35c1c 100644 --- a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php +++ b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php @@ -1,175 +1,144 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the AIM JSON API to process a Prior Auth Capture transaction through Paypal - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- -{ - "createTransactionRequest": { - "merchantAuthentication": { - "name": "89nE4Beh", - "transactionKey": "7s2g3yWC3TfC92p2" - }, - "transactionRequest": { - "transactionType": "priorAuthCaptureTransaction", - "refTransId": "128" - } - } -} - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- -{ - "transactionResponse": { - "responseCode": "1", - "authCode": "HH5414", - "avsResultCode": "P", - "cvvResultCode": "", - "cavvResultCode": "", - "transId": "2149186848", - "refTransID": "2149186848", - "transHash": "D3A855F0934EB404DE3B13508D0E3826", - "testRequest": "0", - "accountNumber": "XXXX0015", - "accountType": "MasterCard", - "messages": [ - { - "code": "1", - "description": "This transaction has been approved." - } - ] - }, - "refId": "123456", - "messages": { - "resultCode": "Ok", - "message": [ - { - "code": "I00001", - "text": "Successful." - } - ] - } -} - -*************************************************************************************************/ - - namespace JohnConde\Authnet; - - require('../../config.inc.php'); - require('../../src/autoload.php'); - - $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->createTransactionRequest([ - "transactionRequest" => [ - "transactionType" => "priorAuthCaptureTransaction", - "refTransId" => "128" - ] - ]); -?> - - - - - AIM :: Paypal :: Prior Auth Capture - - - -

- AIM :: Authorize and Capture -

-

- Results -

- - - - - - - - - - - - - - isSuccessful()) : ?> - - - - - - - - - - - - - isError()) : ?> - - - - - - - - - -
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
-

- Raw Input/Output -

- - - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the AIM JSON API to process a Prior Auth Capture transaction through Paypal + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- +{ + "createTransactionRequest": { + "merchantAuthentication": { + "name": "89nE4Beh", + "transactionKey": "7s2g3yWC3TfC92p2" + }, + "transactionRequest": { + "transactionType": "priorAuthCaptureTransaction", + "refTransId": "128" + } + } +} + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- +{ + "transactionResponse": { + "responseCode": "1", + "authCode": "HH5414", + "avsResultCode": "P", + "cvvResultCode": "", + "cavvResultCode": "", + "transId": "2149186848", + "refTransID": "2149186848", + "transHash": "D3A855F0934EB404DE3B13508D0E3826", + "testRequest": "0", + "accountNumber": "XXXX0015", + "accountType": "MasterCard", + "messages": [ + { + "code": "1", + "description": "This transaction has been approved." + } + ] + }, + "refId": "123456", + "messages": { + "resultCode": "Ok", + "message": [ + { + "code": "I00001", + "text": "Successful." + } + ] + } +} + +*************************************************************************************************/ + + namespace JohnConde\Authnet; + + require('../../config.inc.php'); + require('../../src/autoload.php'); + + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createTransactionRequest([ + "transactionRequest" => [ + "transactionType" => "priorAuthCaptureTransaction", + "refTransId" => "128" + ] + ]); +?> + + + + + AIM :: Paypal :: Prior Auth Capture + + + +

+ AIM :: Authorize and Capture +

+

+ Results +

+ + + + + + + + + + + + + + isSuccessful()) : ?> + + + + + + + + + + + + + isError()) : ?> + + + + + + + + + +
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_paypalRefund.php b/examples/aim/createTransactionRequest_paypalRefund.php index 7aceebd..ad24030 100644 --- a/examples/aim/createTransactionRequest_paypalRefund.php +++ b/examples/aim/createTransactionRequest_paypalRefund.php @@ -1,170 +1,139 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the AIM JSON API to process a Credit transaction through Paypal - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- -{ - "createTransactionRequest": { - "merchantAuthentication": { - "name": "cnpdev4289", - "transactionKey": "SR2P8g4jdEn7vFLQ" - }, - "transactionRequest": { - "transactionType": "refundTransaction", - "refTransId": "138" - } - } -} - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- -{ - "transactionResponse": { - "responseCode": "1", - "transId": "2149186848", - "refTransID": "2149186775", - "transHash": "D6C9036F443BADE785D57DA2B44CD190", - "testRequest": "0", - "accountType": "PayPal", - "messages": [ - { - "code": "1", - "description": "This transaction has been approved." - } - ] - }, - "refId": "123456", - "messages": { - "resultCode": "Ok", - "message": [ - { - "code": "I00001", - "text": "Successful." - } - ] - } -} - -*************************************************************************************************/ - - namespace JohnConde\Authnet; - - require('../../config.inc.php'); - require('../../src/autoload.php'); - - $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->createTransactionRequest([ - "transactionRequest" => [ - "transactionType" => "refundTransaction", - "refTransId" => "138" - ] - ]); -?> - - - - - AIM :: Paypal :: Refund - - - -

- AIM :: Authorize and Capture -

-

- Results -

- - - - - - - - - - - - - - isSuccessful()) : ?> - - - - - - - - - - - - - isError()) : ?> - - - - - - - - - -
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
-

- Raw Input/Output -

- - - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the AIM JSON API to process a Credit transaction through Paypal + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- +{ + "createTransactionRequest": { + "merchantAuthentication": { + "name": "cnpdev4289", + "transactionKey": "SR2P8g4jdEn7vFLQ" + }, + "transactionRequest": { + "transactionType": "refundTransaction", + "refTransId": "138" + } + } +} + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- +{ + "transactionResponse": { + "responseCode": "1", + "transId": "2149186848", + "refTransID": "2149186775", + "transHash": "D6C9036F443BADE785D57DA2B44CD190", + "testRequest": "0", + "accountType": "PayPal", + "messages": [ + { + "code": "1", + "description": "This transaction has been approved." + } + ] + }, + "refId": "123456", + "messages": { + "resultCode": "Ok", + "message": [ + { + "code": "I00001", + "text": "Successful." + } + ] + } +} + +*************************************************************************************************/ + + namespace JohnConde\Authnet; + + require('../../config.inc.php'); + require('../../src/autoload.php'); + + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createTransactionRequest([ + "transactionRequest" => [ + "transactionType" => "refundTransaction", + "refTransId" => "138" + ] + ]); +?> + + + + + AIM :: Paypal :: Refund + + + +

+ AIM :: Authorize and Capture +

+

+ Results +

+ + + + + + + + + + + + + + isSuccessful()) : ?> + + + + + + + + + + + + + isError()) : ?> + + + + + + + + + +
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_paypalVoid.php b/examples/aim/createTransactionRequest_paypalVoid.php index 05112e6..8d3e83f 100644 --- a/examples/aim/createTransactionRequest_paypalVoid.php +++ b/examples/aim/createTransactionRequest_paypalVoid.php @@ -1,175 +1,144 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the AIM JSON API to process a Void transaction through Paypal - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- -{ - "createTransactionRequest": { - "merchantAuthentication": { - "name": "cnpdev4289", - "transactionKey": "SR2P8g4jdEn7vFLQ" - }, - "transactionRequest": { - "transactionType": "voidTransaction", - "refTransId": "138" - } - } -} - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- -{ - "transactionResponse": { - "responseCode": "1", - "authCode": "HH5414", - "avsResultCode": "P", - "cvvResultCode": "", - "cavvResultCode": "", - "transId": "2149186848", - "refTransID": "2149186848", - "transHash": "D3A855F0934EB404DE3B13508D0E3826", - "testRequest": "0", - "accountNumber": "XXXX0015", - "accountType": "MasterCard", - "messages": [ - { - "code": "1", - "description": "This transaction has been approved." - } - ] - }, - "refId": "123456", - "messages": { - "resultCode": "Ok", - "message": [ - { - "code": "I00001", - "text": "Successful." - } - ] - } -} - -*************************************************************************************************/ - - namespace JohnConde\Authnet; - - require('../../config.inc.php'); - require('../../src/autoload.php'); - - $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->createTransactionRequest([ - "transactionRequest" => [ - "transactionType" => "voidTransaction", - "refTransId" => "138" - ] - ]); -?> - - - - - AIM :: Paypal :: Void - - - -

- AIM :: Authorize and Capture -

-

- Results -

- - - - - - - - - - - - - - isSuccessful()) : ?> - - - - - - - - - - - - - isError()) : ?> - - - - - - - - - -
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
-

- Raw Input/Output -

- - - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the AIM JSON API to process a Void transaction through Paypal + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- +{ + "createTransactionRequest": { + "merchantAuthentication": { + "name": "cnpdev4289", + "transactionKey": "SR2P8g4jdEn7vFLQ" + }, + "transactionRequest": { + "transactionType": "voidTransaction", + "refTransId": "138" + } + } +} + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- +{ + "transactionResponse": { + "responseCode": "1", + "authCode": "HH5414", + "avsResultCode": "P", + "cvvResultCode": "", + "cavvResultCode": "", + "transId": "2149186848", + "refTransID": "2149186848", + "transHash": "D3A855F0934EB404DE3B13508D0E3826", + "testRequest": "0", + "accountNumber": "XXXX0015", + "accountType": "MasterCard", + "messages": [ + { + "code": "1", + "description": "This transaction has been approved." + } + ] + }, + "refId": "123456", + "messages": { + "resultCode": "Ok", + "message": [ + { + "code": "I00001", + "text": "Successful." + } + ] + } +} + +*************************************************************************************************/ + + namespace JohnConde\Authnet; + + require('../../config.inc.php'); + require('../../src/autoload.php'); + + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createTransactionRequest([ + "transactionRequest" => [ + "transactionType" => "voidTransaction", + "refTransId" => "138" + ] + ]); +?> + + + + + AIM :: Paypal :: Void + + + +

+ AIM :: Authorize and Capture +

+

+ Results +

+ + + + + + + + + + + + + + isSuccessful()) : ?> + + + + + + + + + + + + + isError()) : ?> + + + + + + + + + +
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
DescriptiontransactionResponse->messages[0]->description; ?>
authCodetransactionResponse->authCode; ?>
transIdtransactionResponse->transId; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_priorAuthCapture.php b/examples/aim/createTransactionRequest_priorAuthCapture.php index b5792ba..ae934cb 100644 --- a/examples/aim/createTransactionRequest_priorAuthCapture.php +++ b/examples/aim/createTransactionRequest_priorAuthCapture.php @@ -1,153 +1,152 @@ -createTransactionRequest([ - 'refId' => rand(1000000, 100000000), - 'transactionRequest' => [ - 'transactionType' => 'priorAuthCaptureTransaction', - 'refTransId' => '2230581333' - ], - ]); -?> - - - - - - - - - -

- AIM :: Prior Authorization Capture -

-

- Results -

- - - - - - - - - - - - - - - - - - - - - -
Responsemessages->resultCode; ?>
codemessages->message[0]->code; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
transIdtransactionResponse->transId; ?>
-

- Raw Input/Output -

- - - +createTransactionRequest([ + 'refId' => rand(1000000, 100000000), + 'transactionRequest' => [ + 'transactionType' => 'priorAuthCaptureTransaction', + 'refTransId' => '2230581333' + ], + ]); +?> + + + + + + + + +

+ AIM :: Prior Authorization Capture +

+

+ Results +

+ + + + + + + + + + + + + + + + + + + + + +
Responsemessages->resultCode; ?>
codemessages->message[0]->code; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
transIdtransactionResponse->transId; ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/createTransactionRequest_refund.php b/examples/aim/createTransactionRequest_refund.php index d3e39c6..674abf7 100644 --- a/examples/aim/createTransactionRequest_refund.php +++ b/examples/aim/createTransactionRequest_refund.php @@ -85,48 +85,16 @@ ?> - - +

diff --git a/examples/aim/createTransactionRequest_visaCheckout.php b/examples/aim/createTransactionRequest_visaCheckout.php index 2f20619..d88a424 100644 --- a/examples/aim/createTransactionRequest_visaCheckout.php +++ b/examples/aim/createTransactionRequest_visaCheckout.php @@ -100,44 +100,13 @@ AIM :: Visa Checkout - +

diff --git a/examples/aim/createTransactionRequest_void.php b/examples/aim/createTransactionRequest_void.php index c46153b..0100c5c 100644 --- a/examples/aim/createTransactionRequest_void.php +++ b/examples/aim/createTransactionRequest_void.php @@ -71,48 +71,16 @@ ?> - - +

diff --git a/examples/aim/decryptPaymentDataRequest.php b/examples/aim/decryptPaymentDataRequest.php index 2c5f57a..0dce667 100644 --- a/examples/aim/decryptPaymentDataRequest.php +++ b/examples/aim/decryptPaymentDataRequest.php @@ -1,152 +1,121 @@ -decryptPaymentDataRequest([ - "opaqueData" => [ - "dataDescriptor" => "COMMON.VCO.ONLINE.PAYMENT", - "dataValue" => "2BceaAHSHwTc0oA8RTqXfqpqDQk+e0thusXG/SAy3EuyksOis8aEMkxuVZDRUpbZVOFh6JnmUl/LS3s+GuoPFJbR8+OBfwJRBNGSuFIgYFhZooXYQbH0pkO6jY3WCMTwiYymGz359T9M6WEdCA2oIMRKOw8PhRpZLvaoqlxZ+oILMq6+NCckdBd2LJeFNOHzUlBvYdVmUX1K1IhJVB0+nxCjFijYQQQVlxx5sacg+9A0YWWhxNnEk8HzeCghnU9twR1P/JGI5LlT+AaPmP0wj6LupH0mNFDIYzLIoA6eReIrTqn63OwJdCwYZ7qQ2hWVhPyLZty22NycWjVCdl2hdrNhWyOySXJqKDFGIq0yrnD3Hh1Y71hbg4GjsObhxtq3IsGT1JgoL9t6Q393Yw2K4sdzjgSJgetxrh2aElgLs9mEtQfWYUo71KpesMmDPxZYlf+NToIXpgz5yrQ/FT29YCSbGUICO9ems9buhb0iwcuhhamUcg336bLjL2K54+s1cpOGNEuqUi0cSMvng9T9IKZgWO+jMvQmJzRsIB5KD3FooCnDwxadp61eWfc+Bl+e0b0oQXSxJt12vyghZBgHvhEQcXU+YGBihbyYuI1JOPtt+A3smz7Emfd2+ktGF4lp82RVQNXlG9ENtKr26Utntc/xfj+y1UX2NUtsn22rW+Kahb20/4hHXA8DLcmfeHMDvrupePIcCKj02+Feofc2RMnVQLS9bsXXzbxzYGm6kHtmaXteNTnpB67U0z3igD17bYFOZurNQUBEHLXntCAMqCL7kkBT8Qx8yaSA3uhzJVhLSWU9ovu2uM1AGIauJki5TxdjSyrcj56Hi8sVB7FNxWcsZhGb67wwNRVwwyurU+YFVXB8fJna3FW686qPfo+UnyVUxwOXP4g+wC661VcrkMPPwZySzVaM7vH2n2VENkECCpm3bBYBitRifHwhRlYFF6z0GNhJQ2JLy2+YJZrlNWUMtzvYjcKojgA6YsCkSr1tFCv2c+oLAfkC720G9IvfCNQyv4o2dH554taGPvMynzbtCjWbhCj3sdX80AO2o/fQjeowa45/lYkY4CDgthzjwQwDaEK9qEKSIWjt3C/gb/VgxPRikdwmVCfI5XltVSX/bIoSyGiHvIo8DoTYebridtw4dHNx55y/a12Y/dWjpDNqV+8enZqNEfSrGSAC3E+nv9oM8ttB1JQ1GVtuN7vIv+tjHuYLEV9/U2WkUlA5ia3JjWRp3mOiYmluyof7pZbFPi5UpbKs9Nqp58oH5nI4f9JhUg2iQUz5cBiRJpntD8/KgA9JngTuQsoGWSt397hDmM99q848cqJf8UJ0OXqdgMf5mjh/atatfqgxglXfuPD2lJlJAdFDLEs0a/EEGrhwf2t14Gaw7XwBl6CSy2HzdD+HwmkNSdicb8an+JbH0WPqH8DXR8eaT0P11rjVtoGTPwQD1G+OllgfmzL5kxtRZFqbfFVCRqLjHGsygNX9Ts8nxGz301NT294HnkZSfre7hadDQUqTpZo0Em/DkwY1ruuba3zfLwzv0C4Hil3FllEhZbPNYIcb4C5FHQ2NlqVCSt2YfofGYkDWI2g46UJG1rlLQ4OQ7jcdjybvasMqcCvqO+jkQK07DZtb5gZEnzWqGSNcRdzz6cJbnbJqDDhxyci+FRBE0an9m7iHX7lyhEbfnjatP606DRikKQkmPnjaDlhsAJA6Yx82zu3z88/wJG75W8TkKrbyEAMiB5CGDSg/bvEUN60VN9PRbYiD3XTm8ZpTg0k2hQfh/xwRktbRKJ/zqp5l5Jchif0vrtMJdk6omzMMy0LBCSzu9aNAELwz4CQoSpeKA90piGy0T/IjiAvq2r6hOWfAUvZITckN9PA1NPaqEkACG1jyK+LgXew/CCplywL3Tz76fKkkYYApJAuTgzja6O2a9xC3ULlMjfVzeDHbV+R4mDno35mDOz7q7BB2Qoj3TBr6yLgz9mzZssY48U93Nwd1g663NKk1mn/i2a0fLeaOOr46d/tS0oXCEIB+NIOlYYQqKfuZAh0GSzVZMYZsQ4NfueSx5VY80MibBYrVk26u3/sco5wvaz0C3PY27pBj89VhM5kAhGv1CXJcbIFBJ/B9Xw9VFsTf39PfJUhB7b0+7+zFwtriJn02WcW1Z9pX78wSs0AxwYCMbNtxzK5fFZZcdOt2HOsIHw==", - "dataKey" => "k5qdgh6t5BnvuBz3Xs0f+iraXB0tXO+6WewMUVTBsqYN3G16HHYwlz8To602G/pZ+Sng0mjTAy3mwhpOb/5nJktiCTpKL4wvn0exJxGt9GIAODBYz4PFbxuenmuQE9O5" - ], - "callId" => "4859677641513545101" -]); -?> - - - - - AIM :: Decrypt Visa Checkout Data - - - -

- AIM :: Receipt Request -

-

- Results -

- - - - - -
Responsemessages->resultCode; ?>
-

- Raw Input/Output -

- - - +decryptPaymentDataRequest([ + "opaqueData" => [ + "dataDescriptor" => "COMMON.VCO.ONLINE.PAYMENT", + "dataValue" => "2BceaAHSHwTc0oA8RTqXfqpqDQk+e0thusXG/SAy3EuyksOis8aEMkxuVZDRUpbZVOFh6JnmUl/LS3s+GuoPFJbR8+OBfwJRBNGSuFIgYFhZooXYQbH0pkO6jY3WCMTwiYymGz359T9M6WEdCA2oIMRKOw8PhRpZLvaoqlxZ+oILMq6+NCckdBd2LJeFNOHzUlBvYdVmUX1K1IhJVB0+nxCjFijYQQQVlxx5sacg+9A0YWWhxNnEk8HzeCghnU9twR1P/JGI5LlT+AaPmP0wj6LupH0mNFDIYzLIoA6eReIrTqn63OwJdCwYZ7qQ2hWVhPyLZty22NycWjVCdl2hdrNhWyOySXJqKDFGIq0yrnD3Hh1Y71hbg4GjsObhxtq3IsGT1JgoL9t6Q393Yw2K4sdzjgSJgetxrh2aElgLs9mEtQfWYUo71KpesMmDPxZYlf+NToIXpgz5yrQ/FT29YCSbGUICO9ems9buhb0iwcuhhamUcg336bLjL2K54+s1cpOGNEuqUi0cSMvng9T9IKZgWO+jMvQmJzRsIB5KD3FooCnDwxadp61eWfc+Bl+e0b0oQXSxJt12vyghZBgHvhEQcXU+YGBihbyYuI1JOPtt+A3smz7Emfd2+ktGF4lp82RVQNXlG9ENtKr26Utntc/xfj+y1UX2NUtsn22rW+Kahb20/4hHXA8DLcmfeHMDvrupePIcCKj02+Feofc2RMnVQLS9bsXXzbxzYGm6kHtmaXteNTnpB67U0z3igD17bYFOZurNQUBEHLXntCAMqCL7kkBT8Qx8yaSA3uhzJVhLSWU9ovu2uM1AGIauJki5TxdjSyrcj56Hi8sVB7FNxWcsZhGb67wwNRVwwyurU+YFVXB8fJna3FW686qPfo+UnyVUxwOXP4g+wC661VcrkMPPwZySzVaM7vH2n2VENkECCpm3bBYBitRifHwhRlYFF6z0GNhJQ2JLy2+YJZrlNWUMtzvYjcKojgA6YsCkSr1tFCv2c+oLAfkC720G9IvfCNQyv4o2dH554taGPvMynzbtCjWbhCj3sdX80AO2o/fQjeowa45/lYkY4CDgthzjwQwDaEK9qEKSIWjt3C/gb/VgxPRikdwmVCfI5XltVSX/bIoSyGiHvIo8DoTYebridtw4dHNx55y/a12Y/dWjpDNqV+8enZqNEfSrGSAC3E+nv9oM8ttB1JQ1GVtuN7vIv+tjHuYLEV9/U2WkUlA5ia3JjWRp3mOiYmluyof7pZbFPi5UpbKs9Nqp58oH5nI4f9JhUg2iQUz5cBiRJpntD8/KgA9JngTuQsoGWSt397hDmM99q848cqJf8UJ0OXqdgMf5mjh/atatfqgxglXfuPD2lJlJAdFDLEs0a/EEGrhwf2t14Gaw7XwBl6CSy2HzdD+HwmkNSdicb8an+JbH0WPqH8DXR8eaT0P11rjVtoGTPwQD1G+OllgfmzL5kxtRZFqbfFVCRqLjHGsygNX9Ts8nxGz301NT294HnkZSfre7hadDQUqTpZo0Em/DkwY1ruuba3zfLwzv0C4Hil3FllEhZbPNYIcb4C5FHQ2NlqVCSt2YfofGYkDWI2g46UJG1rlLQ4OQ7jcdjybvasMqcCvqO+jkQK07DZtb5gZEnzWqGSNcRdzz6cJbnbJqDDhxyci+FRBE0an9m7iHX7lyhEbfnjatP606DRikKQkmPnjaDlhsAJA6Yx82zu3z88/wJG75W8TkKrbyEAMiB5CGDSg/bvEUN60VN9PRbYiD3XTm8ZpTg0k2hQfh/xwRktbRKJ/zqp5l5Jchif0vrtMJdk6omzMMy0LBCSzu9aNAELwz4CQoSpeKA90piGy0T/IjiAvq2r6hOWfAUvZITckN9PA1NPaqEkACG1jyK+LgXew/CCplywL3Tz76fKkkYYApJAuTgzja6O2a9xC3ULlMjfVzeDHbV+R4mDno35mDOz7q7BB2Qoj3TBr6yLgz9mzZssY48U93Nwd1g663NKk1mn/i2a0fLeaOOr46d/tS0oXCEIB+NIOlYYQqKfuZAh0GSzVZMYZsQ4NfueSx5VY80MibBYrVk26u3/sco5wvaz0C3PY27pBj89VhM5kAhGv1CXJcbIFBJ/B9Xw9VFsTf39PfJUhB7b0+7+zFwtriJn02WcW1Z9pX78wSs0AxwYCMbNtxzK5fFZZcdOt2HOsIHw==", + "dataKey" => "k5qdgh6t5BnvuBz3Xs0f+iraXB0tXO+6WewMUVTBsqYN3G16HHYwlz8To602G/pZ+Sng0mjTAy3mwhpOb/5nJktiCTpKL4wvn0exJxGt9GIAODBYz4PFbxuenmuQE9O5" + ], + "callId" => "4859677641513545101" +]); +?> + + + + + AIM :: Decrypt Visa Checkout Data + + + +

+ AIM :: Receipt Request +

+

+ Results +

+ + + + + +
Responsemessages->resultCode; ?>
+

+ Raw Input/Output +

+ + + diff --git a/examples/aim/sendCustomerTransactionReceiptRequest.php b/examples/aim/sendCustomerTransactionReceiptRequest.php index 691e8b8..57a8003 100644 --- a/examples/aim/sendCustomerTransactionReceiptRequest.php +++ b/examples/aim/sendCustomerTransactionReceiptRequest.php @@ -64,48 +64,16 @@ ?> - - +

diff --git a/examples/arb/ARBCancelSubscriptionRequest.php b/examples/arb/ARBCancelSubscriptionRequest.php index 925194a..9cff4e5 100644 --- a/examples/arb/ARBCancelSubscriptionRequest.php +++ b/examples/arb/ARBCancelSubscriptionRequest.php @@ -56,48 +56,16 @@ ?> - - +

diff --git a/examples/arb/ARBCreateSubscriptionRequest.php b/examples/arb/ARBCreateSubscriptionRequest.php index c6b3f38..cdaaf83 100644 --- a/examples/arb/ARBCreateSubscriptionRequest.php +++ b/examples/arb/ARBCreateSubscriptionRequest.php @@ -103,48 +103,16 @@ ?> - - +

diff --git a/examples/arb/ARBGetSubscriptionStatusRequest.php b/examples/arb/ARBGetSubscriptionStatusRequest.php index b8431bb..4af650c 100644 --- a/examples/arb/ARBGetSubscriptionStatusRequest.php +++ b/examples/arb/ARBGetSubscriptionStatusRequest.php @@ -61,48 +61,16 @@ ?> - - +

diff --git a/examples/arb/ARBUpdateSubscriptionRequest.php b/examples/arb/ARBUpdateSubscriptionRequest.php index df2072e..2853b55 100644 --- a/examples/arb/ARBUpdateSubscriptionRequest.php +++ b/examples/arb/ARBUpdateSubscriptionRequest.php @@ -72,48 +72,16 @@ ?> - - +

diff --git a/examples/cim/createCustomerPaymentProfileRequest.php b/examples/cim/createCustomerPaymentProfileRequest.php index d8e68f8..ff27cbc 100644 --- a/examples/cim/createCustomerPaymentProfileRequest.php +++ b/examples/cim/createCustomerPaymentProfileRequest.php @@ -88,48 +88,16 @@ ?> - - +

diff --git a/examples/cim/createCustomerProfileRequest.php b/examples/cim/createCustomerProfileRequest.php index 9ad537b..19d60a0 100644 --- a/examples/cim/createCustomerProfileRequest.php +++ b/examples/cim/createCustomerProfileRequest.php @@ -123,48 +123,16 @@ ?> - - +

diff --git a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php index f21a271..a2d04b7 100644 --- a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php +++ b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php @@ -167,7 +167,6 @@ ?> - diff --git a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php index ef00f4d..1770dd2 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php +++ b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php @@ -128,48 +128,16 @@ ?> - - +

diff --git a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php index 2fdd654..9b60681 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php +++ b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php @@ -128,48 +128,16 @@ ?> - - +

diff --git a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php index 360cd92..6b36027 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php +++ b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php @@ -130,7 +130,6 @@ ?> - diff --git a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php index 59a3e54..bd0fdc5 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php +++ b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php @@ -114,48 +114,16 @@ ?> - - +

diff --git a/examples/cim/createCustomerProfileTransactionRequest_refund.php b/examples/cim/createCustomerProfileTransactionRequest_refund.php index 5ca3c4a..c0d79c6 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_refund.php +++ b/examples/cim/createCustomerProfileTransactionRequest_refund.php @@ -126,48 +126,16 @@ ?> - - +

diff --git a/examples/cim/createCustomerProfileTransactionRequest_void.php b/examples/cim/createCustomerProfileTransactionRequest_void.php index 9e15882..19c43db 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_void.php +++ b/examples/cim/createCustomerProfileTransactionRequest_void.php @@ -60,48 +60,16 @@ ?> - - +

diff --git a/examples/cim/createCustomerShippingAddressRequest.php b/examples/cim/createCustomerShippingAddressRequest.php index 5da1398..6dfff4a 100644 --- a/examples/cim/createCustomerShippingAddressRequest.php +++ b/examples/cim/createCustomerShippingAddressRequest.php @@ -68,48 +68,16 @@ ?> - - +

diff --git a/examples/cim/deleteCustomerPaymentProfileRequest.php b/examples/cim/deleteCustomerPaymentProfileRequest.php index d0c9c20..48d931c 100644 --- a/examples/cim/deleteCustomerPaymentProfileRequest.php +++ b/examples/cim/deleteCustomerPaymentProfileRequest.php @@ -45,48 +45,16 @@ ?> - - +

diff --git a/examples/cim/deleteCustomerProfileRequest.php b/examples/cim/deleteCustomerProfileRequest.php index af710f8..6aa2d58 100644 --- a/examples/cim/deleteCustomerProfileRequest.php +++ b/examples/cim/deleteCustomerProfileRequest.php @@ -43,48 +43,16 @@ ?> - - +

diff --git a/examples/cim/deleteCustomerShippingAddressRequest.php b/examples/cim/deleteCustomerShippingAddressRequest.php index 3e6fec4..4a74d74 100644 --- a/examples/cim/deleteCustomerShippingAddressRequest.php +++ b/examples/cim/deleteCustomerShippingAddressRequest.php @@ -45,48 +45,16 @@ ?> - - +

diff --git a/examples/cim/getCustomerPaymentProfileRequest.php b/examples/cim/getCustomerPaymentProfileRequest.php index 240c125..0faa204 100644 --- a/examples/cim/getCustomerPaymentProfileRequest.php +++ b/examples/cim/getCustomerPaymentProfileRequest.php @@ -64,48 +64,16 @@ ?> - - +

diff --git a/examples/cim/getCustomerProfileIdsRequest.php b/examples/cim/getCustomerProfileIdsRequest.php index 9c647ff..a7e5629 100644 --- a/examples/cim/getCustomerProfileIdsRequest.php +++ b/examples/cim/getCustomerProfileIdsRequest.php @@ -128,48 +128,16 @@ ?> - - +

diff --git a/examples/cim/getCustomerProfileRequest.php b/examples/cim/getCustomerProfileRequest.php index 888df86..d0fddab 100644 --- a/examples/cim/getCustomerProfileRequest.php +++ b/examples/cim/getCustomerProfileRequest.php @@ -94,48 +94,16 @@ ?> - - +

diff --git a/examples/cim/getCustomerShippingAddressRequest.php b/examples/cim/getCustomerShippingAddressRequest.php index ea67f4a..42df4ef 100644 --- a/examples/cim/getCustomerShippingAddressRequest.php +++ b/examples/cim/getCustomerShippingAddressRequest.php @@ -55,48 +55,16 @@ ?> - - +

diff --git a/examples/cim/getHostedProfilePageRequest.php b/examples/cim/getHostedProfilePageRequest.php index e4b9ff1..cd905f6 100644 --- a/examples/cim/getHostedProfilePageRequest.php +++ b/examples/cim/getHostedProfilePageRequest.php @@ -64,48 +64,16 @@ ?> - - +

diff --git a/examples/cim/updateCustomerPaymentProfileRequest.php b/examples/cim/updateCustomerPaymentProfileRequest.php index da97baa..b0adaca 100644 --- a/examples/cim/updateCustomerPaymentProfileRequest.php +++ b/examples/cim/updateCustomerPaymentProfileRequest.php @@ -85,48 +85,16 @@ ?> - - +

diff --git a/examples/cim/updateCustomerProfileRequest.php b/examples/cim/updateCustomerProfileRequest.php index 33ae02d..763f238 100644 --- a/examples/cim/updateCustomerProfileRequest.php +++ b/examples/cim/updateCustomerProfileRequest.php @@ -53,48 +53,16 @@ ?> - - +

diff --git a/examples/cim/updateCustomerShippingAddressRequest.php b/examples/cim/updateCustomerShippingAddressRequest.php index 72149e4..94e23a4 100644 --- a/examples/cim/updateCustomerShippingAddressRequest.php +++ b/examples/cim/updateCustomerShippingAddressRequest.php @@ -69,48 +69,16 @@ ?> - - +

diff --git a/examples/cim/updateSplitTenderGroupRequest.php b/examples/cim/updateSplitTenderGroupRequest.php index 19fb590..5c2cbde 100644 --- a/examples/cim/updateSplitTenderGroupRequest.php +++ b/examples/cim/updateSplitTenderGroupRequest.php @@ -45,48 +45,16 @@ ?> - - +

diff --git a/examples/cim/validateCustomerPaymentProfileRequest.php b/examples/cim/validateCustomerPaymentProfileRequest.php index f39eaa5..b022e7b 100644 --- a/examples/cim/validateCustomerPaymentProfileRequest.php +++ b/examples/cim/validateCustomerPaymentProfileRequest.php @@ -50,48 +50,16 @@ ?> - - +

diff --git a/examples/reporting/getBatchStatisticsRequest.php b/examples/reporting/getBatchStatisticsRequest.php index a728807..7bccf29 100644 --- a/examples/reporting/getBatchStatisticsRequest.php +++ b/examples/reporting/getBatchStatisticsRequest.php @@ -87,48 +87,16 @@ ?> - - +

diff --git a/examples/reporting/getSettledBatchListRequest.php b/examples/reporting/getSettledBatchListRequest.php index bd0f805..810aad4 100644 --- a/examples/reporting/getSettledBatchListRequest.php +++ b/examples/reporting/getSettledBatchListRequest.php @@ -177,48 +177,16 @@ ?> - - +

diff --git a/examples/reporting/getTransactionDetailsRequest.php b/examples/reporting/getTransactionDetailsRequest.php index 28dce22..2da0b31 100644 --- a/examples/reporting/getTransactionDetailsRequest.php +++ b/examples/reporting/getTransactionDetailsRequest.php @@ -108,48 +108,16 @@ ?> - - +

diff --git a/examples/reporting/getTransactionListRequest.php b/examples/reporting/getTransactionListRequest.php index 9efad3b..eddd9e0 100644 --- a/examples/reporting/getTransactionListRequest.php +++ b/examples/reporting/getTransactionListRequest.php @@ -70,48 +70,16 @@ ?> - - +

diff --git a/examples/reporting/getUnsettledTransactionListRequest.php b/examples/reporting/getUnsettledTransactionListRequest.php index 957efa5..2580661 100644 --- a/examples/reporting/getUnsettledTransactionListRequest.php +++ b/examples/reporting/getUnsettledTransactionListRequest.php @@ -97,48 +97,16 @@ ?> - - +

diff --git a/examples/sim/sim.php b/examples/sim/sim.php index 5276219..872bd9c 100644 --- a/examples/sim/sim.php +++ b/examples/sim/sim.php @@ -30,7 +30,6 @@ ?> - SIM diff --git a/examples/webhooks/createWebhook.php b/examples/webhooks/createWebhook.php index caa4f13..8c95190 100644 --- a/examples/webhooks/createWebhook.php +++ b/examples/webhooks/createWebhook.php @@ -1,184 +1,162 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the Webhooks API to create a webhook - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- - -POST https://apitest.authorize.net/rest/v1/webhooks - -{ - "url": "http://localhost:55950/api/webhooks", - "eventTypes": [ - "net.authorize.payment.authcapture.created", - "net.authorize.customer.created", - "net.authorize.customer.paymentProfile.created", - "net.authorize.customer.subscription.expiring" - ], - "status": "active" -} - - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- - -{ - "_links": { - "self": { - "href": "/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f" - } - }, - "webhookId": "72a55c78-66e6-4b1e-a4d6-3f925c00561f", - "eventTypes": [ - "net.authorize.payment.authcapture.created", - "net.authorize.customer.created", - "net.authorize.customer.paymentProfile.created", - "net.authorize.customer.subscription.expiring" - ], - "status": "active", - "url": "http://localhost:55950/api/webhooks" -} - -*************************************************************************************************/ - -namespace JohnConde\Authnet; - -require('../../config.inc.php'); -require('../../src/autoload.php'); - -$successful = false; -$error = true; -try { - $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->createWebhooks([ - 'net.authorize.customer.created', - 'net.authorize.customer.deleted', - 'net.authorize.customer.updated', - 'net.authorize.customer.paymentProfile.created', - 'net.authorize.customer.paymentProfile.deleted', - 'net.authorize.customer.paymentProfile.updated', - 'net.authorize.customer.subscription.cancelled', - 'net.authorize.customer.subscription.created', - 'net.authorize.customer.subscription.expiring', - 'net.authorize.customer.subscription.suspended', - 'net.authorize.customer.subscription.terminated', - 'net.authorize.customer.subscription.updated', - 'net.authorize.payment.authcapture.created', - 'net.authorize.payment.authorization.created', - 'net.authorize.payment.capture.created', - 'net.authorize.payment.fraud.approved', - 'net.authorize.payment.fraud.declined', - 'net.authorize.payment.fraud.held', - 'net.authorize.payment.priorAuthCapture.created', - 'net.authorize.payment.refund.created', - 'net.authorize.payment.void.created' - ], 'http://requestb.in/', 'active'); - $successful = true; - $error = false; -} -catch (\Exception $e) { - $errorMessage = $e->getMessage(); -} - -?> - - - - - Webhooks :: Create Webhooks - - - -

- Webhooks :: Create Webhooks -

-

- Results -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Successful
Event Types - getEventTypes() as $eventType) { - echo $eventType, "
\n"; - } - ?> -
Webhook IDgetWebhooksId(); ?>
StatusgetStatus(); ?>
URLgetUrl(); ?>
Error message
-

- Raw Input/Output -

- - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the Webhooks API to create a webhook + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- + +POST https://apitest.authorize.net/rest/v1/webhooks + +{ + "url": "http://localhost:55950/api/webhooks", + "eventTypes": [ + "net.authorize.payment.authcapture.created", + "net.authorize.customer.created", + "net.authorize.customer.paymentProfile.created", + "net.authorize.customer.subscription.expiring" + ], + "status": "active" +} + + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- + +{ + "_links": { + "self": { + "href": "/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f" + } + }, + "webhookId": "72a55c78-66e6-4b1e-a4d6-3f925c00561f", + "eventTypes": [ + "net.authorize.payment.authcapture.created", + "net.authorize.customer.created", + "net.authorize.customer.paymentProfile.created", + "net.authorize.customer.subscription.expiring" + ], + "status": "active", + "url": "http://localhost:55950/api/webhooks" +} + +*************************************************************************************************/ + +namespace JohnConde\Authnet; + +require('../../config.inc.php'); +require('../../src/autoload.php'); + +$successful = false; +$error = true; +try { + $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createWebhooks([ + 'net.authorize.customer.created', + 'net.authorize.customer.deleted', + 'net.authorize.customer.updated', + 'net.authorize.customer.paymentProfile.created', + 'net.authorize.customer.paymentProfile.deleted', + 'net.authorize.customer.paymentProfile.updated', + 'net.authorize.customer.subscription.cancelled', + 'net.authorize.customer.subscription.created', + 'net.authorize.customer.subscription.expiring', + 'net.authorize.customer.subscription.suspended', + 'net.authorize.customer.subscription.terminated', + 'net.authorize.customer.subscription.updated', + 'net.authorize.payment.authcapture.created', + 'net.authorize.payment.authorization.created', + 'net.authorize.payment.capture.created', + 'net.authorize.payment.fraud.approved', + 'net.authorize.payment.fraud.declined', + 'net.authorize.payment.fraud.held', + 'net.authorize.payment.priorAuthCapture.created', + 'net.authorize.payment.refund.created', + 'net.authorize.payment.void.created' + ], 'http://requestb.in/', 'active'); + $successful = true; + $error = false; +} +catch (\Exception $e) { + $errorMessage = $e->getMessage(); +} + +?> + + + + Webhooks :: Create Webhooks + + + +

+ Webhooks :: Create Webhooks +

+

+ Results +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Successful
Event Types + getEventTypes() as $eventType) { + echo $eventType, "
\n"; + } + ?> +
Webhook IDgetWebhooksId(); ?>
StatusgetStatus(); ?>
URLgetUrl(); ?>
Error message
+

+ Raw Input/Output +

+ + \ No newline at end of file diff --git a/examples/webhooks/deleteWebhook.php b/examples/webhooks/deleteWebhook.php index 503f492..7e74783 100644 --- a/examples/webhooks/deleteWebhook.php +++ b/examples/webhooks/deleteWebhook.php @@ -1,111 +1,89 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the Webhooks API to - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- - -DELETE https://apitest.authorize.net/rest/v1/webhooks/ - - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- - -HTTP response code 200 will be returned for a successful deletion - - - *************************************************************************************************/ - -namespace JohnConde\Authnet; - -require('../../config.inc.php'); -require('../../src/autoload.php'); - -$successful = false; -$error = true; -try { - $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $request->deleteWebhook('0550f061-59a1-4f13-a9da-3e8bfc50e80b'); - $successful = true; - $error = false; -} -catch (\Exception $e) { - $errorMessage = $e->getMessage(); -} - -?> - - - - - Webhooks :: Delete Webhooks - - - -

- Webhooks :: Delete Webhooks -

-

- Results -

- - - - - - - - - - - -
Successful
Error message
-

- Raw Input/Output -

- - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the Webhooks API to + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- + +DELETE https://apitest.authorize.net/rest/v1/webhooks/ + + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- + +HTTP response code 200 will be returned for a successful deletion + + + *************************************************************************************************/ + +namespace JohnConde\Authnet; + +require('../../config.inc.php'); +require('../../src/autoload.php'); + +$successful = false; +$error = true; +try { + $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $request->deleteWebhook('0550f061-59a1-4f13-a9da-3e8bfc50e80b'); + $successful = true; + $error = false; +} +catch (\Exception $e) { + $errorMessage = $e->getMessage(); +} + +?> + + + + Webhooks :: Delete Webhooks + + + +

+ Webhooks :: Delete Webhooks +

+

+ Results +

+ + + + + + + + + + + +
Successful
Error message
+

+ Raw Input/Output +

+ + \ No newline at end of file diff --git a/examples/webhooks/getEventTypes.php b/examples/webhooks/getEventTypes.php index 26beef0..bfe1699 100644 --- a/examples/webhooks/getEventTypes.php +++ b/examples/webhooks/getEventTypes.php @@ -1,188 +1,166 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the Webhooks API to retreive a list of all available webhooks - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- - -GET https://apitest.authorize.net/rest/v1/eventtypes - - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- - -[ - { - "name": "net.authorize.customer.created" - }, - { - "name": "net.authorize.customer.deleted" - }, - { - "name": "net.authorize.customer.updated" - }, - { - "name": "net.authorize.customer.paymentProfile.created" - }, - { - "name": "net.authorize.customer.paymentProfile.deleted" - }, - { - "name": "net.authorize.customer.paymentProfile.updated" - }, - { - "name": "net.authorize.customer.subscription.cancelled" - }, - { - "name": "net.authorize.customer.subscription.created" - }, - { - "name": "net.authorize.customer.subscription.expiring" - }, - { - "name": "net.authorize.customer.subscription.suspended" - }, - { - "name": "net.authorize.customer.subscription.terminated" - }, - { - "name": "net.authorize.customer.subscription.updated" - }, - { - "name": "net.authorize.payment.authcapture.created" - }, - { - "name": "net.authorize.payment.authorization.created" - }, - { - "name": "net.authorize.payment.capture.created" - }, - { - "name": "net.authorize.payment.fraud.approved" - }, - { - "name": "net.authorize.payment.fraud.declined" - }, - { - "name": "net.authorize.payment.fraud.held" - }, - { - "name": "net.authorize.payment.priorAuthCapture.created" - }, - { - "name": "net.authorize.payment.refund.created" - }, - { - "name": "net.authorize.payment.void.created" - } -] - - *************************************************************************************************/ - -namespace JohnConde\Authnet; - -require('../../config.inc.php'); -require('../../src/autoload.php'); - -$successful = false; -$error = true; -try { - $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->getEventTypes(); - $successful = true; - $error = false; -} -catch (\Exception $e) { - $errorMessage = $e->getMessage(); -} - -?> - - - - - Webhooks :: Get Event Types - - - -

- Webhooks :: Get Event Types -

-

- Results -

- - - - - - - - - - - - - - - - -
Successful
Event Types - getEventTypes() as $eventType) { - echo $eventType, "
\n"; - } - ?> -
Error message
-

- Raw Input/Output -

- - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the Webhooks API to retreive a list of all available webhooks + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- + +GET https://apitest.authorize.net/rest/v1/eventtypes + + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- + +[ + { + "name": "net.authorize.customer.created" + }, + { + "name": "net.authorize.customer.deleted" + }, + { + "name": "net.authorize.customer.updated" + }, + { + "name": "net.authorize.customer.paymentProfile.created" + }, + { + "name": "net.authorize.customer.paymentProfile.deleted" + }, + { + "name": "net.authorize.customer.paymentProfile.updated" + }, + { + "name": "net.authorize.customer.subscription.cancelled" + }, + { + "name": "net.authorize.customer.subscription.created" + }, + { + "name": "net.authorize.customer.subscription.expiring" + }, + { + "name": "net.authorize.customer.subscription.suspended" + }, + { + "name": "net.authorize.customer.subscription.terminated" + }, + { + "name": "net.authorize.customer.subscription.updated" + }, + { + "name": "net.authorize.payment.authcapture.created" + }, + { + "name": "net.authorize.payment.authorization.created" + }, + { + "name": "net.authorize.payment.capture.created" + }, + { + "name": "net.authorize.payment.fraud.approved" + }, + { + "name": "net.authorize.payment.fraud.declined" + }, + { + "name": "net.authorize.payment.fraud.held" + }, + { + "name": "net.authorize.payment.priorAuthCapture.created" + }, + { + "name": "net.authorize.payment.refund.created" + }, + { + "name": "net.authorize.payment.void.created" + } +] + + *************************************************************************************************/ + +namespace JohnConde\Authnet; + +require('../../config.inc.php'); +require('../../src/autoload.php'); + +$successful = false; +$error = true; +try { + $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->getEventTypes(); + $successful = true; + $error = false; +} +catch (\Exception $e) { + $errorMessage = $e->getMessage(); +} + +?> + + + + Webhooks :: Get Event Types + + + +

+ Webhooks :: Get Event Types +

+

+ Results +

+ + + + + + + + + + + + + + + + +
Successful
Event Types + getEventTypes() as $eventType) { + echo $eventType, "
\n"; + } + ?> +
Error message
+

+ Raw Input/Output +

+ + \ No newline at end of file diff --git a/examples/webhooks/getWebhook.php b/examples/webhooks/getWebhook.php index 5fed1fd..798c3ba 100644 --- a/examples/webhooks/getWebhook.php +++ b/examples/webhooks/getWebhook.php @@ -1,152 +1,130 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the Webhooks API to retrieve a webhook - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- - -GET https://apitest.authorize.net/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f - - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- - -{ - "_links": { - "self": { - "href": "/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f" - } - }, - "webhookId": "72a55c78-66e6-4b1e-a4d6-3f925c00561f", - "eventTypes": [ - "net.authorize.payment.authcapture.created", - "net.authorize.customer.created", - "net.authorize.customer.paymentProfile.created", - "net.authorize.customer.subscription.expiring" - ], - "status": "active", - "url": "http://localhost:55950/api/webhooks" -} - - - *************************************************************************************************/ - -namespace JohnConde\Authnet; - -require('../../config.inc.php'); -require('../../src/autoload.php'); - -$successful = false; -$error = true; -try { - $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->getWebhook('cd2c262f-2723-4848-ae92-5d317902441c'); - $successful = true; - $error = false; -} -catch (\Exception $e) { - $errorMessage = $e->getMessage(); -} - -?> - - - - - Webhooks :: Get A Webhook - - - -

- Webhooks :: Get A Webhook -

-

- Results -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Successful
Event Types - getEventTypes() as $eventType) { - echo $eventType, "
\n"; - } - ?> -
Webhook IDgetWebhooksId(); ?>
StatusgetStatus(); ?>
URLgetUrl(); ?>
Error message
-

- Raw Input/Output -

- - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the Webhooks API to retrieve a webhook + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- + +GET https://apitest.authorize.net/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f + + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- + +{ + "_links": { + "self": { + "href": "/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f" + } + }, + "webhookId": "72a55c78-66e6-4b1e-a4d6-3f925c00561f", + "eventTypes": [ + "net.authorize.payment.authcapture.created", + "net.authorize.customer.created", + "net.authorize.customer.paymentProfile.created", + "net.authorize.customer.subscription.expiring" + ], + "status": "active", + "url": "http://localhost:55950/api/webhooks" +} + + + *************************************************************************************************/ + +namespace JohnConde\Authnet; + +require('../../config.inc.php'); +require('../../src/autoload.php'); + +$successful = false; +$error = true; +try { + $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->getWebhook('cd2c262f-2723-4848-ae92-5d317902441c'); + $successful = true; + $error = false; +} +catch (\Exception $e) { + $errorMessage = $e->getMessage(); +} + +?> + + + + Webhooks :: Get A Webhook + + + +

+ Webhooks :: Get A Webhook +

+

+ Results +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Successful
Event Types + getEventTypes() as $eventType) { + echo $eventType, "
\n"; + } + ?> +
Webhook IDgetWebhooksId(); ?>
StatusgetStatus(); ?>
URLgetUrl(); ?>
Error message
+

+ Raw Input/Output +

+ + \ No newline at end of file diff --git a/examples/webhooks/listWebhooks.php b/examples/webhooks/listWebhooks.php index 40a8702..78562be 100644 --- a/examples/webhooks/listWebhooks.php +++ b/examples/webhooks/listWebhooks.php @@ -1,189 +1,167 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the Webhooks API to list all of my webhooks - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- - -GET https://apitest.authorize.net/rest/v1/webhooks - - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- - -[{ - "_links": { - "self": { - "href": "/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f" - } - }, - "webhookId": "72a55c78-66e6-4b1e-a4d6-3f925c00561f", - "eventTypes": [ - "net.authorize.payment.authcapture.created", - "net.authorize.customer.created", - "net.authorize.customer.paymentProfile.created", - "net.authorize.customer.subscription.expiring" - ], - "status": "active", - "url": "http://localhost:55950/api/webhooks" - }, { - "_links": { - "self": { - "href": "/rest/v1/webhooks/7be120d3-2247-4706-b9b1-98931fdfdcce" - } - }, - "webhookId": "7be120d3-2247-4706-b9b1-98931fdfdcce", - "eventTypes": [ - "net.authorize.customer.subscription.expiring", - "net.authorize.customer.paymentProfile.created", - "net.authorize.payment.authcapture.created", - "net.authorize.customer.created" - ], - "status": "inactive", - "url": "http://localhost:55950/api/webhooks" - }, { - "_links": { - "self": { - "href": "/rest/v1/webhooks/62c68677-0d71-43a7-977a-f4dea3827fac" - } - }, - "webhookId": "62c68677-0d71-43a7-977a-f4dea3827fac", - "eventTypes": [ - "net.authorize.customer.subscription.expiring", - "net.authorize.customer.created", - "net.authorize.customer.paymentProfile.created", - "net.authorize.payment.authcapture.created" - ], - "status": "active", - "url": "http://localhost:55950/api/webhooks" -}] - - - *************************************************************************************************/ - -namespace JohnConde\Authnet; - -require('../../config.inc.php'); -require('../../src/autoload.php'); - -$successful = false; -$error = true; -try { - $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->getWebhooks(); - $successful = true; - $error = false; -} -catch (\Exception $e) { - $errorMessage = $e->getMessage(); -} - -?> - - - - - Webhooks :: List Webhooks - - - -

- Webhooks :: List Webhooks -

-

- Results -

- - - - - - getWebhooks() as $webhook) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - -
Successful
-
-
Event Types - getEventTypes() as $eventType) { - echo $eventType, "
\n"; - } - ?> -
Webhook IDgetWebhooksId(); ?>
StatusgetStatus(); ?>
URLgetUrl(); ?>
Error message
-

- Raw Input/Output -

- - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the Webhooks API to list all of my webhooks + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- + +GET https://apitest.authorize.net/rest/v1/webhooks + + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- + +[{ + "_links": { + "self": { + "href": "/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f" + } + }, + "webhookId": "72a55c78-66e6-4b1e-a4d6-3f925c00561f", + "eventTypes": [ + "net.authorize.payment.authcapture.created", + "net.authorize.customer.created", + "net.authorize.customer.paymentProfile.created", + "net.authorize.customer.subscription.expiring" + ], + "status": "active", + "url": "http://localhost:55950/api/webhooks" + }, { + "_links": { + "self": { + "href": "/rest/v1/webhooks/7be120d3-2247-4706-b9b1-98931fdfdcce" + } + }, + "webhookId": "7be120d3-2247-4706-b9b1-98931fdfdcce", + "eventTypes": [ + "net.authorize.customer.subscription.expiring", + "net.authorize.customer.paymentProfile.created", + "net.authorize.payment.authcapture.created", + "net.authorize.customer.created" + ], + "status": "inactive", + "url": "http://localhost:55950/api/webhooks" + }, { + "_links": { + "self": { + "href": "/rest/v1/webhooks/62c68677-0d71-43a7-977a-f4dea3827fac" + } + }, + "webhookId": "62c68677-0d71-43a7-977a-f4dea3827fac", + "eventTypes": [ + "net.authorize.customer.subscription.expiring", + "net.authorize.customer.created", + "net.authorize.customer.paymentProfile.created", + "net.authorize.payment.authcapture.created" + ], + "status": "active", + "url": "http://localhost:55950/api/webhooks" +}] + + + *************************************************************************************************/ + +namespace JohnConde\Authnet; + +require('../../config.inc.php'); +require('../../src/autoload.php'); + +$successful = false; +$error = true; +try { + $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->getWebhooks(); + $successful = true; + $error = false; +} +catch (\Exception $e) { + $errorMessage = $e->getMessage(); +} + +?> + + + + Webhooks :: List Webhooks + + + +

+ Webhooks :: List Webhooks +

+

+ Results +

+ + + + + + getWebhooks() as $webhook) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
Successful
+
+
Event Types + getEventTypes() as $eventType) { + echo $eventType, "
\n"; + } + ?> +
Webhook IDgetWebhooksId(); ?>
StatusgetStatus(); ?>
URLgetUrl(); ?>
Error message
+

+ Raw Input/Output +

+ + \ No newline at end of file diff --git a/examples/webhooks/notificationHistory.php b/examples/webhooks/notificationHistory.php index 9258a10..6c1302b 100644 --- a/examples/webhooks/notificationHistory.php +++ b/examples/webhooks/notificationHistory.php @@ -1,157 +1,135 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the Webhooks API to - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- - -GET https://apitest.authorize.net/rest/v1/notifications?offset=0&limit=1000 - - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- - -{ - "_links": { - "self": { - "href": "/rest/v1/notifications?offset=0&limit=100" - } - }, - "notifications": [ - { - "_links": { - "self": { - "href": "/rest/v1/notifications/e35d5ede-27c5-46cc-aabb-131f10154ed3" - } - }, - "notificationId": "e35d5ede-27c5-46cc-aabb-131f10154ed3", - "deliveryStatus": "Delivered", - "eventType": "net.authorize.payment.authcapture.created", - "eventDate": "2017-02-09T19:18:42.167" - } - ] -} - - - *************************************************************************************************/ - -namespace JohnConde\Authnet; - -require('../../config.inc.php'); -require('../../src/autoload.php'); - -$successful = false; -$error = true; -try { - $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->getNotificationHistory(); - $successful = true; - $error = false; -} -catch (\Exception $e) { - $errorMessage = $e->getMessage(); -} - -?> - - - - - Webhooks :: Notification History - - - -

- Webhooks :: Notification History -

-

- Results -

- - - - - - getNotificationHistory() as $notification) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - -
Successful
-
-
Notification IDgetNotificationId(); ?>
Delivery StatusgetDeliveryStatus(); ?>
Event TypegetEventType(); ?>
Event DategetEventDate(); ?>
Error message
-

- Raw Input/Output -

- - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the Webhooks API to + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- + +GET https://apitest.authorize.net/rest/v1/notifications?offset=0&limit=1000 + + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- + +{ + "_links": { + "self": { + "href": "/rest/v1/notifications?offset=0&limit=100" + } + }, + "notifications": [ + { + "_links": { + "self": { + "href": "/rest/v1/notifications/e35d5ede-27c5-46cc-aabb-131f10154ed3" + } + }, + "notificationId": "e35d5ede-27c5-46cc-aabb-131f10154ed3", + "deliveryStatus": "Delivered", + "eventType": "net.authorize.payment.authcapture.created", + "eventDate": "2017-02-09T19:18:42.167" + } + ] +} + + + *************************************************************************************************/ + +namespace JohnConde\Authnet; + +require('../../config.inc.php'); +require('../../src/autoload.php'); + +$successful = false; +$error = true; +try { + $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->getNotificationHistory(); + $successful = true; + $error = false; +} +catch (\Exception $e) { + $errorMessage = $e->getMessage(); +} + +?> + + + + Webhooks :: Notification History + + + +

+ Webhooks :: Notification History +

+

+ Results +

+ + + + + + getNotificationHistory() as $notification) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
Successful
+
+
Notification IDgetNotificationId(); ?>
Delivery StatusgetDeliveryStatus(); ?>
Event TypegetEventType(); ?>
Event DategetEventDate(); ?>
Error message
+

+ Raw Input/Output +

+ + \ No newline at end of file diff --git a/examples/webhooks/ping.php b/examples/webhooks/ping.php index de05c9d..4c6fac5 100644 --- a/examples/webhooks/ping.php +++ b/examples/webhooks/ping.php @@ -1,110 +1,88 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the Webhooks API to send a test webhook - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- - -POST https://apitest.authorize.net/rest/v1/webhooks//pings - - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- - -HTTP 200 response for success -HTTP 500 response for connection error - -*************************************************************************************************/ - -namespace JohnConde\Authnet; - -require('../../config.inc.php'); -require('../../src/autoload.php'); - -$successful = false; -$error = true; -try { - $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $request->testWebhook('ba4c73f3-0808-48bf-ae2f-f49064770e60'); - $successful = true; - $error = false; -} -catch (\Exception $e) { - $errorMessage = $e->getMessage(); -} -?> - - - - - Webhooks :: Create Webhooks - - - -

- Webhooks :: Ping -

-

- Results -

- - - - - - - - - - - -
Successful
Error message
-

- Raw Input/Output -

- - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the Webhooks API to send a test webhook + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- + +POST https://apitest.authorize.net/rest/v1/webhooks//pings + + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- + +HTTP 200 response for success +HTTP 500 response for connection error + +*************************************************************************************************/ + +namespace JohnConde\Authnet; + +require('../../config.inc.php'); +require('../../src/autoload.php'); + +$successful = false; +$error = true; +try { + $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $request->testWebhook('ba4c73f3-0808-48bf-ae2f-f49064770e60'); + $successful = true; + $error = false; +} +catch (\Exception $e) { + $errorMessage = $e->getMessage(); +} +?> + + + + Webhooks :: Create Webhooks + + + +

+ Webhooks :: Ping +

+

+ Results +

+ + + + + + + + + + + +
Successful
Error message
+

+ Raw Input/Output +

+ + \ No newline at end of file diff --git a/examples/webhooks/updateWebhook.php b/examples/webhooks/updateWebhook.php index 3db2f51..8aa3550 100644 --- a/examples/webhooks/updateWebhook.php +++ b/examples/webhooks/updateWebhook.php @@ -1,179 +1,157 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/************************************************************************************************* - -Use the Webhooks API to update a webhook - -SAMPLE REQUEST --------------------------------------------------------------------------------------------------- - -PUT https://apitest.authorize.net/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f - -{ - "url": "http://requestb.in/19okx6x1", - "eventTypes": [ - "net.authorize.payment.authorization.created" - ], - "status": "active" -} - - -SAMPLE RESPONSE --------------------------------------------------------------------------------------------------- - -{ - "_links": { - "self": { - "href": "/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f" - } - }, - "webhookId": "72a55c78-66e6-4b1e-a4d6-3f925c00561f", - "eventTypes": [ - "net.authorize.payment.authcapture.created" - ], - "status": "active", - "url": "http://requestb.in/19okx6x1" -} - - - *************************************************************************************************/ - -namespace JohnConde\Authnet; - -require('../../config.inc.php'); -require('../../src/autoload.php'); - -$successful = false; -$error = true; -try { - $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $response = $request->updateWebhook('ba4c73f3-0808-48bf-ae2f-f49064770e60', 'http://requestb.in/', [ - 'net.authorize.customer.created', - 'net.authorize.customer.deleted', - 'net.authorize.customer.updated', - 'net.authorize.customer.paymentProfile.created', - 'net.authorize.customer.paymentProfile.deleted', - 'net.authorize.customer.paymentProfile.updated', - 'net.authorize.customer.subscription.cancelled', - 'net.authorize.customer.subscription.created', - 'net.authorize.customer.subscription.expiring', - 'net.authorize.customer.subscription.suspended', - 'net.authorize.customer.subscription.terminated', - 'net.authorize.customer.subscription.updated', - 'net.authorize.payment.authcapture.created', - 'net.authorize.payment.authorization.created', - 'net.authorize.payment.capture.created', - 'net.authorize.payment.fraud.approved', - 'net.authorize.payment.fraud.declined', - 'net.authorize.payment.fraud.held', - 'net.authorize.payment.priorAuthCapture.created', - 'net.authorize.payment.refund.created', - 'net.authorize.payment.void.created' - ], 'active'); - $successful = true; - $error = false; -} -catch (\Exception $e) { - $errorMessage = $e->getMessage(); -} - -?> - - - - - Webhooks :: Update Webhooks - - - -

- Webhooks :: Update Webhooks -

-

- Results -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Successful
Event Types - getEventTypes() as $eventType) { - echo $eventType, "
\n"; - } - ?> -
Webhook IDgetWebhooksId(); ?>
StatusgetStatus(); ?>
URLgetUrl(); ?>
Error message
-

- Raw Input/Output -

- - + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/************************************************************************************************* + +Use the Webhooks API to update a webhook + +SAMPLE REQUEST +-------------------------------------------------------------------------------------------------- + +PUT https://apitest.authorize.net/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f + +{ + "url": "http://requestb.in/19okx6x1", + "eventTypes": [ + "net.authorize.payment.authorization.created" + ], + "status": "active" +} + + +SAMPLE RESPONSE +-------------------------------------------------------------------------------------------------- + +{ + "_links": { + "self": { + "href": "/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f" + } + }, + "webhookId": "72a55c78-66e6-4b1e-a4d6-3f925c00561f", + "eventTypes": [ + "net.authorize.payment.authcapture.created" + ], + "status": "active", + "url": "http://requestb.in/19okx6x1" +} + + + *************************************************************************************************/ + +namespace JohnConde\Authnet; + +require('../../config.inc.php'); +require('../../src/autoload.php'); + +$successful = false; +$error = true; +try { + $request = AuthnetApiFactory::getWebhooksHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->updateWebhook('ba4c73f3-0808-48bf-ae2f-f49064770e60', 'http://requestb.in/', [ + 'net.authorize.customer.created', + 'net.authorize.customer.deleted', + 'net.authorize.customer.updated', + 'net.authorize.customer.paymentProfile.created', + 'net.authorize.customer.paymentProfile.deleted', + 'net.authorize.customer.paymentProfile.updated', + 'net.authorize.customer.subscription.cancelled', + 'net.authorize.customer.subscription.created', + 'net.authorize.customer.subscription.expiring', + 'net.authorize.customer.subscription.suspended', + 'net.authorize.customer.subscription.terminated', + 'net.authorize.customer.subscription.updated', + 'net.authorize.payment.authcapture.created', + 'net.authorize.payment.authorization.created', + 'net.authorize.payment.capture.created', + 'net.authorize.payment.fraud.approved', + 'net.authorize.payment.fraud.declined', + 'net.authorize.payment.fraud.held', + 'net.authorize.payment.priorAuthCapture.created', + 'net.authorize.payment.refund.created', + 'net.authorize.payment.void.created' + ], 'active'); + $successful = true; + $error = false; +} +catch (\Exception $e) { + $errorMessage = $e->getMessage(); +} + +?> + + + + Webhooks :: Update Webhooks + + + +

+ Webhooks :: Update Webhooks +

+

+ Results +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Successful
Event Types + getEventTypes() as $eventType) { + echo $eventType, "
\n"; + } + ?> +
Webhook IDgetWebhooksId(); ?>
StatusgetStatus(); ?>
URLgetUrl(); ?>
Error message
+

+ Raw Input/Output +

+ + \ No newline at end of file From 53e8c1b63da58a71a3c07714e4b83e0938bfbc0f Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 31 Jan 2019 20:24:41 -0500 Subject: [PATCH 029/105] Cleaned up HTML and CSS in examples --- .../createTransactionRequest_captureOnly.php | 40 ++++-------------- ...ateTransactionRequest_priorAuthCapture.php | 41 +++---------------- ...tomerProfileRequestMultiplePayAccounts.php | 41 +++---------------- ...rProfileTransactionRequest_captureOnly.php | 36 +++------------- 4 files changed, 22 insertions(+), 136 deletions(-) diff --git a/examples/aim/createTransactionRequest_captureOnly.php b/examples/aim/createTransactionRequest_captureOnly.php index 3218a27..7a308d1 100644 --- a/examples/aim/createTransactionRequest_captureOnly.php +++ b/examples/aim/createTransactionRequest_captureOnly.php @@ -67,8 +67,8 @@ require('../../config.inc.php'); require('../../src/autoload.php'); - $json = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $json->createTransactionRequest([ + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createTransactionRequest([ 'refId' => rand(1000000, 100000000), 'transactionRequest' => [ 'transactionType' => 'captureOnlyTransaction', @@ -89,37 +89,11 @@ diff --git a/examples/aim/createTransactionRequest_priorAuthCapture.php b/examples/aim/createTransactionRequest_priorAuthCapture.php index ae934cb..ffb19aa 100644 --- a/examples/aim/createTransactionRequest_priorAuthCapture.php +++ b/examples/aim/createTransactionRequest_priorAuthCapture.php @@ -75,42 +75,11 @@ diff --git a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php index a2d04b7..d0e258e 100644 --- a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php +++ b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php @@ -171,42 +171,11 @@ diff --git a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php index 6b36027..cb566c4 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php +++ b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php @@ -134,37 +134,11 @@ From 1cb9cd9dcecac68e0ae42e8adb0fdb8e174f6e78 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 31 Jan 2019 20:30:30 -0500 Subject: [PATCH 030/105] Fixed incorrect variable names --- examples/aim/createTransactionRequest_priorAuthCapture.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/aim/createTransactionRequest_priorAuthCapture.php b/examples/aim/createTransactionRequest_priorAuthCapture.php index ffb19aa..7271e50 100644 --- a/examples/aim/createTransactionRequest_priorAuthCapture.php +++ b/examples/aim/createTransactionRequest_priorAuthCapture.php @@ -60,8 +60,8 @@ require('../../config.inc.php'); require('../../src/autoload.php'); - $json = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); - $json->createTransactionRequest([ + $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); + $response = $request->createTransactionRequest([ 'refId' => rand(1000000, 100000000), 'transactionRequest' => [ 'transactionType' => 'priorAuthCaptureTransaction', From b064a71fb6b87944ddffee5a284ca01cd7d46525 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 31 Jan 2019 20:45:34 -0500 Subject: [PATCH 031/105] Removed errant duplicate array key --- examples/aim/sendCustomerTransactionReceiptRequest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/aim/sendCustomerTransactionReceiptRequest.php b/examples/aim/sendCustomerTransactionReceiptRequest.php index 57a8003..2a60553 100644 --- a/examples/aim/sendCustomerTransactionReceiptRequest.php +++ b/examples/aim/sendCustomerTransactionReceiptRequest.php @@ -55,10 +55,6 @@ 'settingName' => 'headerEmailReceipt', 'settingValue' => 'some HEADER stuff' ], - 'setting' => [ - 'settingName' => 'footerEmailReceipt', - 'settingValue' => 'some FOOTER stuff' - ], ], ]); ?> From 1d0beeab1fc2a272b0755e5a1d0c8e7d40c4f07b Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 31 Jan 2019 20:46:22 -0500 Subject: [PATCH 032/105] If trying to retrieve non-existent response value, NULL is returned --- src/authnet/AuthnetJsonResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php index a52e8bb..8207d9f 100644 --- a/src/authnet/AuthnetJsonResponse.php +++ b/src/authnet/AuthnetJsonResponse.php @@ -147,7 +147,7 @@ public function __toString() */ public function __get(string $var) { - return $this->response->{$var}; + return $this->response->{$var} ?? null; } /** From 22e1d01ddf03f7ddcee62b9e06f2b3927aedca63 Mon Sep 17 00:00:00 2001 From: John Conde Date: Sat, 2 Feb 2019 19:04:19 -0500 Subject: [PATCH 033/105] Added Class 'authnet\className' not found to HELP.md --- HELP.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/HELP.md b/HELP.md index 6176429..7e491d9 100644 --- a/HELP.md +++ b/HELP.md @@ -7,22 +7,32 @@ Here are some tips, solutions to common problems, and guides for testing. ### Create a Sandbox Account Before doing any development for the Authorize.Net suite of APIs, be sure to create a -[Sandbox Account](https://developer.authorize.net/hello_world/sandbox/) with Authorize.Net. With it you can simulate virtually -every aspect of the Authorize.Net production APIs without incurring any fees. +[Sandbox Account](https://developer.authorize.net/hello_world/sandbox/) with Authorize.Net. With it you can simulate +virtually every aspect of the Authorize.Net production APIs without incurring any fees. ### Use a webhook testing site to test webhooks -Having a full understanding of what a webhook looks like makes working with webhooks easier. You can inspect an Authorize.Net -webhook using a third party service like [RequestBin](https://requestbin.fullcontact.com/). +Having a full understanding of what a webhook looks like makes working with webhooks easier. You can inspect an +Authorize.Net webhook using a third party service like [RequestBin](https://requestbin.fullcontact.com/). ## FAQ -Solutions to common problems when integrating the [AuthnetJSON](https://github.com/stymiee/authnetjson) library into your project. +Solutions to common problems when integrating the [AuthnetJSON](https://github.com/stymiee/authnetjson) library into +your project. ### php://input is empty, POST is empty, webhook has no data This may happen because a redirect occurred and steps were not taken to persist that data across the redirect. Look for redirects to HTTPS or to/from the `www` subdomain in your .htaccess or web.config file. +### Class 'authnet\className' not found +- This may happen if you did not include the Composer autoload.php file in your project + + require __DIR__.'/vendor/autoload.php'; + +- If you do not use Composer, you did not include the AuthnetJSON autoload.php file in your project) + + require __DIR__.'vendor/stymiee/authnetjson/src/autoload.php'; + ## Support If you require assistance using this library I can be found at Stack Overflow. Be sure when you From d25dd32450b46dcc3a3abd6726ae954bba1ae089 Mon Sep 17 00:00:00 2001 From: John Conde Date: Sat, 2 Feb 2019 19:05:37 -0500 Subject: [PATCH 034/105] Updated to reflect PHP 7.2 version requirements --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e3c260d..b54441e 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,10 @@ Library that abstracts [Authorize.Net](http://www.authorize.net/)'s [JSON APIs]( ## Requirements -- PHP 5.4+ +- PHP 7.2+ - cURL PHP Extension - JSON PHP Extension - An Authorize.Net account -- TLS 1.2 capable versions of libcurl and OpenSSL or equivalent - -**NOTE:** AuthnetJSON 4.0 will not be backwards compatible with PHP 5 and the minimum PHP version will be 7.2. ## Installation @@ -27,7 +24,7 @@ Here is a minimal example of a `composer.json` file that just defines a dependen { "require": { - "stymiee/authnetjson": "3.1.*" + "stymiee/authnetjson": "4.0.*" } } @@ -367,7 +364,10 @@ usage of this library. Simple `echo` your AuthnetJson object to see: ## Support -If you require assistance using this library I can be found at Stack Overflow. Be sure when you +If you require assistance using this library start by viewing the [HELP.md](HELP.md) file included in this package. It +includes common problems and their solutions. + +If you need additional assistance, I can be found at Stack Overflow. Be sure when you [ask a question](http://stackoverflow.com/questions/ask?tags=php,authorize.net) pertaining to the usage of this class to tag your question with the **PHP** and **Authorize.Net** tags. Make sure you follow their [guide for asking a good question](http://stackoverflow.com/help/how-to-ask) as poorly asked questions will be closed From ac101d9fb1dd010da4272cab291aee2291a95d80 Mon Sep 17 00:00:00 2001 From: John Conde Date: Sat, 2 Feb 2019 19:06:09 -0500 Subject: [PATCH 035/105] Added 4.0.0 --- CHANGELOG | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 07e67cf..2c279c9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,17 @@ CHANGE LOG +2019-XX-XX - Version 4.0.0 +-------------------------------------------- +Bumped minimum supported version of PHP to 7.2 +If trying to retrieve non-existent response value, NULL is returned in AuthnetJsonResponse::__get() +Shiny badges for the README +Cleaned up HTML and CSS in examples +Minor formatting changes + 2019-01-26 - Version 3.1.8 -------------------------------------------- Removed not actually missing return statement to AuthnetWebhooksRequest::delete -Reduced complexity of AuthnetApiFactory::getWebServiceURL)( +Reduced complexity of AuthnetApiFactory::getWebServiceURL() Reduced complexity of AuthnetWebhooksResponse::getEventTypes() Reduced complexity of AuthnetWebhook::getAllHeaders() From f9927090261e72f4b488953976256d95efffc807 Mon Sep 17 00:00:00 2001 From: John Conde Date: Sat, 2 Feb 2019 19:49:54 -0500 Subject: [PATCH 036/105] Added note to explain a webhook must be inactive for a PING to work --- examples/webhooks/ping.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/examples/webhooks/ping.php b/examples/webhooks/ping.php index 4c6fac5..520f25b 100644 --- a/examples/webhooks/ping.php +++ b/examples/webhooks/ping.php @@ -10,12 +10,23 @@ /************************************************************************************************* -Use the Webhooks API to send a test webhook +Use the Webhooks API to send a test webhook. + +When a webhook is inactive, you can send a test event to the Webhooks endpoint using this method: + +POST https://apitest.authorize.net/rest/v1/webhooks/72a55c78-66e6-4b1e-a4d6-3f925c00561f/pings + +The POST request message body should be empty. Construct the request URL containing the webhook ID that you want to +test. Then, make an HTTP POST request to that URL. Authorize.Net receives the request and sends a notification to +the registered URL for that webhook, emulating the event for that webhook. + +Note: This request works only on webhooks that are inactive. To test an active webhook, you must first set the webhook +status to inactive. SAMPLE REQUEST -------------------------------------------------------------------------------------------------- -POST https://apitest.authorize.net/rest/v1/webhooks//pings +POST https://apitest.authorize.net/rest/v1/webhooks/ba4c73f3-0808-48bf-ae2f-f49064770e60/pings SAMPLE RESPONSE From 617bd5a306695d9741fae2a943e093805d8b247d Mon Sep 17 00:00:00 2001 From: John Conde Date: Sun, 3 Feb 2019 14:22:26 -0500 Subject: [PATCH 037/105] Updated project description and keywords --- composer.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 09e04cb..60ecc54 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,20 @@ { "name": "stymiee/authnetjson", "type": "library", - "description": "Abstract library for the Authorize.Net JSON APIs", - "keywords": ["authnetjson","Authorize.Net","JSON"], + "description": "Library that abstracts Authorize.Net's JSON APIs. This includes the Advanced Integration Method (AIM), Automated Recurring Billing (ARB), Customer Information Manager (CIM), Transaction Reporting, Simple Integration Method (SIM), and Webhooks.", + "keywords": [ + "PHP", + "authnetjson", + "Authorize.Net", + "JSON", + "json-api", + "webhook", + "capture-transaction", + "authorize-net", + "authorizenet", + "payment", + "payment-gateway" + ], "homepage": "http://github.com/stymiee/authnetjson", "license": "Apache-2.0", "authors": [ From bc1797ce88f32ce79f4f57a7730d105ec8d7c98a Mon Sep 17 00:00:00 2001 From: John Conde Date: Tue, 5 Feb 2019 21:52:07 -0500 Subject: [PATCH 038/105] Clarification of response --- src/authnet/AuthnetWebhooksResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/authnet/AuthnetWebhooksResponse.php b/src/authnet/AuthnetWebhooksResponse.php index bcd5ef9..d435dfd 100644 --- a/src/authnet/AuthnetWebhooksResponse.php +++ b/src/authnet/AuthnetWebhooksResponse.php @@ -55,7 +55,7 @@ public function __construct(string $responseJson) public function __toString() { $output = ''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; + $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ''."\n"; From 0defdba7a7a251ac2b88d61bb356c601c6be79a2 Mon Sep 17 00:00:00 2001 From: John Conde Date: Wed, 6 Feb 2019 19:21:11 -0500 Subject: [PATCH 039/105] Changed spacing of declare(strict_types = 1); to declare(strict_types=1); --- src/authnet/AuthnetApiFactory.php | 2 +- src/authnet/AuthnetJsonRequest.php | 2 +- src/authnet/AuthnetJsonResponse.php | 2 +- src/authnet/AuthnetSim.php | 2 +- src/authnet/AuthnetWebhook.php | 2 +- src/authnet/AuthnetWebhooksRequest.php | 2 +- src/authnet/AuthnetWebhooksResponse.php | 2 +- src/authnet/TransactionResponse.php | 2 +- src/exceptions/AuthnetCannotSetParamsException.php | 2 +- src/exceptions/AuthnetCurlException.php | 2 +- src/exceptions/AuthnetException.php | 2 +- src/exceptions/AuthnetInvalidAmountException.php | 2 +- src/exceptions/AuthnetInvalidCredentialsException.php | 2 +- src/exceptions/AuthnetInvalidJsonException.php | 2 +- src/exceptions/AuthnetInvalidParameterException.php | 2 +- src/exceptions/AuthnetInvalidServerException.php | 2 +- src/exceptions/AuthnetTransactionResponseCallException.php | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index d75560e..0a4e203 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -1,4 +1,4 @@ - Date: Sat, 9 Feb 2019 18:35:17 -0500 Subject: [PATCH 040/105] Put declare(strict_types=1); on its own line --- src/authnet/AuthnetApiFactory.php | 4 +++- src/authnet/AuthnetJsonRequest.php | 4 +++- src/authnet/AuthnetJsonResponse.php | 4 +++- src/authnet/AuthnetSim.php | 4 +++- src/authnet/AuthnetWebhook.php | 4 +++- src/authnet/AuthnetWebhooksRequest.php | 4 +++- src/authnet/AuthnetWebhooksResponse.php | 4 +++- src/authnet/TransactionResponse.php | 4 +++- src/exceptions/AuthnetCannotSetParamsException.php | 4 +++- src/exceptions/AuthnetCurlException.php | 4 +++- src/exceptions/AuthnetException.php | 4 +++- src/exceptions/AuthnetInvalidAmountException.php | 4 +++- src/exceptions/AuthnetInvalidCredentialsException.php | 4 +++- src/exceptions/AuthnetInvalidJsonException.php | 4 +++- src/exceptions/AuthnetInvalidParameterException.php | 3 ++- src/exceptions/AuthnetInvalidServerException.php | 4 +++- src/exceptions/AuthnetTransactionResponseCallException.php | 4 +++- 17 files changed, 50 insertions(+), 17 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index 0a4e203..f8a19c5 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -1,4 +1,6 @@ - Date: Fri, 15 Feb 2019 22:53:23 -0500 Subject: [PATCH 041/105] Added AuthnetJson::BOUNDLESS_OCCURRENCES to indicate an endless subscription --- CHANGELOG | 1 + examples/arb/ARBCreateSubscriptionRequest.php | 2 +- src/authnet/AuthnetJson.php | 32 +++++++++++++++++++ src/autoload.php | 1 + 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/authnet/AuthnetJson.php diff --git a/CHANGELOG b/CHANGELOG index 2c279c9..22e5bf0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ CHANGE LOG -------------------------------------------- Bumped minimum supported version of PHP to 7.2 If trying to retrieve non-existent response value, NULL is returned in AuthnetJsonResponse::__get() +Added AuthnetJson::BOUNDLESS_OCCURRENCES to indicate an endless subscription Shiny badges for the README Cleaned up HTML and CSS in examples Minor formatting changes diff --git a/examples/arb/ARBCreateSubscriptionRequest.php b/examples/arb/ARBCreateSubscriptionRequest.php index cdaaf83..8a173da 100644 --- a/examples/arb/ARBCreateSubscriptionRequest.php +++ b/examples/arb/ARBCreateSubscriptionRequest.php @@ -83,7 +83,7 @@ 'unit' => 'months' ], 'startDate' => '2015-04-18', - 'totalOccurrences' => '12', + 'totalOccurrences' => AuthnetJson::BOUNDLESS_OCCURRENCES, 'trialOccurrences' => '1' ], 'amount' => '10.29', diff --git a/src/authnet/AuthnetJson.php b/src/authnet/AuthnetJson.php new file mode 100644 index 0000000..337a508 --- /dev/null +++ b/src/authnet/AuthnetJson.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JohnConde\Authnet; + +/** + * Contains constant values + * + * @package AuthnetJSON + * @author John Conde + * @copyright John Conde + * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 + * @link https://github.com/stymiee/authnetjson + * @see https://developer.authorize.net/api/reference/ + */ +class AuthnetJson +{ + /** + * @var int Subscription of endless length. + */ + const BOUNDLESS_OCCURRENCES = 9999; +} diff --git a/src/autoload.php b/src/autoload.php index 07546a6..216620f 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -14,6 +14,7 @@ function($class) { static $classes = null; if ($classes === null) { $classes = array( + 'johnconde\\authnet\\authnetjson' => '/authnet/AuthnetJson.php', 'johnconde\\authnet\\authnetapifactory' => '/authnet/AuthnetApiFactory.php', 'johnconde\\authnet\\authnetjsonrequest' => '/authnet/AuthnetJsonRequest.php', 'johnconde\\authnet\\authnetjsonresponse' => '/authnet/AuthnetJsonResponse.php', From e6a460c5bd9ba6fe7420179d2e82fd43fe23706d Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 15 Feb 2019 23:27:59 -0500 Subject: [PATCH 042/105] Changed autoload to PSR-4. Removed references to class map autoload. --- HELP.md | 4 -- composer.json | 6 +-- .../createTransactionRequest_authCapture.php | 1 - .../aim/createTransactionRequest_authOnly.php | 1 - .../createTransactionRequest_captureOnly.php | 1 - ...teTransactionRequest_paypalAuthCapture.php | 1 - ...ctionRequest_paypalAuthCaptureContinue.php | 1 - ...reateTransactionRequest_paypalAuthOnly.php | 1 - ...nsactionRequest_paypalAuthOnlyContinue.php | 1 - ...ateTransactionRequest_paypalGetDetails.php | 1 - ...nsactionRequest_paypalPriorAuthCapture.php | 1 - .../createTransactionRequest_paypalRefund.php | 1 - .../createTransactionRequest_paypalVoid.php | 1 - ...ateTransactionRequest_priorAuthCapture.php | 1 - .../aim/createTransactionRequest_refund.php | 1 - .../createTransactionRequest_visaCheckout.php | 1 - .../aim/createTransactionRequest_void.php | 1 - examples/aim/decryptPaymentDataRequest.php | 1 - .../sendCustomerTransactionReceiptRequest.php | 1 - examples/arb/ARBCancelSubscriptionRequest.php | 1 - examples/arb/ARBCreateSubscriptionRequest.php | 1 - .../arb/ARBGetSubscriptionStatusRequest.php | 1 - examples/arb/ARBUpdateSubscriptionRequest.php | 1 - .../createCustomerPaymentProfileRequest.php | 1 - examples/cim/createCustomerProfileRequest.php | 1 - ...tomerProfileRequestMultiplePayAccounts.php | 1 - ...rProfileTransactionRequest_authCapture.php | 1 - ...omerProfileTransactionRequest_authOnly.php | 1 - ...rProfileTransactionRequest_captureOnly.php | 1 - ...ileTransactionRequest_priorAuthCapture.php | 1 - ...stomerProfileTransactionRequest_refund.php | 1 - ...CustomerProfileTransactionRequest_void.php | 1 - .../createCustomerShippingAddressRequest.php | 1 - .../deleteCustomerPaymentProfileRequest.php | 1 - examples/cim/deleteCustomerProfileRequest.php | 1 - .../deleteCustomerShippingAddressRequest.php | 1 - .../cim/getCustomerPaymentProfileRequest.php | 1 - examples/cim/getCustomerProfileIdsRequest.php | 1 - examples/cim/getCustomerProfileRequest.php | 1 - .../cim/getCustomerShippingAddressRequest.php | 1 - examples/cim/getHostedProfilePageRequest.php | 1 - .../updateCustomerPaymentProfileRequest.php | 1 - examples/cim/updateCustomerProfileRequest.php | 1 - .../updateCustomerShippingAddressRequest.php | 1 - .../cim/updateSplitTenderGroupRequest.php | 1 - .../validateCustomerPaymentProfileRequest.php | 1 - .../reporting/getBatchStatisticsRequest.php | 1 - .../reporting/getSettledBatchListRequest.php | 1 - .../getTransactionDetailsRequest.php | 1 - .../reporting/getTransactionListRequest.php | 1 - .../getUnsettledTransactionListRequest.php | 1 - examples/sim/sim.php | 1 - examples/webhooks/createWebhook.php | 1 - examples/webhooks/deleteWebhook.php | 1 - examples/webhooks/getEventTypes.php | 1 - examples/webhooks/getWebhook.php | 1 - examples/webhooks/listWebhooks.php | 1 - examples/webhooks/notificationHistory.php | 1 - examples/webhooks/ping.php | 1 - examples/webhooks/updateWebhook.php | 1 - phpdoc.xml | 25 ++++++----- phpunit.xml | 2 - src/autoload.php | 41 ------------------- 63 files changed, 15 insertions(+), 121 deletions(-) delete mode 100644 src/autoload.php diff --git a/HELP.md b/HELP.md index 7e491d9..752916a 100644 --- a/HELP.md +++ b/HELP.md @@ -29,10 +29,6 @@ Look for redirects to HTTPS or to/from the `www` subdomain in your .htaccess or require __DIR__.'/vendor/autoload.php'; -- If you do not use Composer, you did not include the AuthnetJSON autoload.php file in your project) - - require __DIR__.'vendor/stymiee/authnetjson/src/autoload.php'; - ## Support If you require assistance using this library I can be found at Stack Overflow. Be sure when you diff --git a/composer.json b/composer.json index 60ecc54..52ccb2d 100644 --- a/composer.json +++ b/composer.json @@ -36,8 +36,8 @@ "phpmd/phpmd" : "@stable" }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "JohnConde\\Authnet\\": ["src/authnet/" ,"src/exceptions/"] + } } } \ No newline at end of file diff --git a/examples/aim/createTransactionRequest_authCapture.php b/examples/aim/createTransactionRequest_authCapture.php index 4cb927d..193e421 100644 --- a/examples/aim/createTransactionRequest_authCapture.php +++ b/examples/aim/createTransactionRequest_authCapture.php @@ -174,7 +174,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_authOnly.php b/examples/aim/createTransactionRequest_authOnly.php index f9fec21..c72fd49 100644 --- a/examples/aim/createTransactionRequest_authOnly.php +++ b/examples/aim/createTransactionRequest_authOnly.php @@ -147,7 +147,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_captureOnly.php b/examples/aim/createTransactionRequest_captureOnly.php index 7a308d1..582b527 100644 --- a/examples/aim/createTransactionRequest_captureOnly.php +++ b/examples/aim/createTransactionRequest_captureOnly.php @@ -65,7 +65,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalAuthCapture.php b/examples/aim/createTransactionRequest_paypalAuthCapture.php index 3d726ca..ce67eb3 100644 --- a/examples/aim/createTransactionRequest_paypalAuthCapture.php +++ b/examples/aim/createTransactionRequest_paypalAuthCapture.php @@ -79,7 +79,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php index facfd15..8548fd9 100644 --- a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php +++ b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php @@ -72,7 +72,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalAuthOnly.php b/examples/aim/createTransactionRequest_paypalAuthOnly.php index bd5013f..4c138db 100644 --- a/examples/aim/createTransactionRequest_paypalAuthOnly.php +++ b/examples/aim/createTransactionRequest_paypalAuthOnly.php @@ -71,7 +71,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php index 03b1357..1860f3a 100644 --- a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php +++ b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php @@ -72,7 +72,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->authOnlyContinueTransaction([ diff --git a/examples/aim/createTransactionRequest_paypalGetDetails.php b/examples/aim/createTransactionRequest_paypalGetDetails.php index d66dbbf..21d9c39 100644 --- a/examples/aim/createTransactionRequest_paypalGetDetails.php +++ b/examples/aim/createTransactionRequest_paypalGetDetails.php @@ -67,7 +67,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php index dc35c1c..3eda038 100644 --- a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php +++ b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php @@ -67,7 +67,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalRefund.php b/examples/aim/createTransactionRequest_paypalRefund.php index ad24030..30a47b6 100644 --- a/examples/aim/createTransactionRequest_paypalRefund.php +++ b/examples/aim/createTransactionRequest_paypalRefund.php @@ -62,7 +62,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalVoid.php b/examples/aim/createTransactionRequest_paypalVoid.php index 8d3e83f..fa96f3f 100644 --- a/examples/aim/createTransactionRequest_paypalVoid.php +++ b/examples/aim/createTransactionRequest_paypalVoid.php @@ -67,7 +67,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_priorAuthCapture.php b/examples/aim/createTransactionRequest_priorAuthCapture.php index 7271e50..56210b2 100644 --- a/examples/aim/createTransactionRequest_priorAuthCapture.php +++ b/examples/aim/createTransactionRequest_priorAuthCapture.php @@ -58,7 +58,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_refund.php b/examples/aim/createTransactionRequest_refund.php index 674abf7..1a10ce3 100644 --- a/examples/aim/createTransactionRequest_refund.php +++ b/examples/aim/createTransactionRequest_refund.php @@ -65,7 +65,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_visaCheckout.php b/examples/aim/createTransactionRequest_visaCheckout.php index d88a424..5d13c5f 100644 --- a/examples/aim/createTransactionRequest_visaCheckout.php +++ b/examples/aim/createTransactionRequest_visaCheckout.php @@ -76,7 +76,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_void.php b/examples/aim/createTransactionRequest_void.php index 0100c5c..1cb7e29 100644 --- a/examples/aim/createTransactionRequest_void.php +++ b/examples/aim/createTransactionRequest_void.php @@ -58,7 +58,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/decryptPaymentDataRequest.php b/examples/aim/decryptPaymentDataRequest.php index 0dce667..70039e6 100644 --- a/examples/aim/decryptPaymentDataRequest.php +++ b/examples/aim/decryptPaymentDataRequest.php @@ -73,7 +73,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->decryptPaymentDataRequest([ diff --git a/examples/aim/sendCustomerTransactionReceiptRequest.php b/examples/aim/sendCustomerTransactionReceiptRequest.php index 2a60553..9ad6c9e 100644 --- a/examples/aim/sendCustomerTransactionReceiptRequest.php +++ b/examples/aim/sendCustomerTransactionReceiptRequest.php @@ -43,7 +43,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->sendCustomerTransactionReceiptRequest([ diff --git a/examples/arb/ARBCancelSubscriptionRequest.php b/examples/arb/ARBCancelSubscriptionRequest.php index 9cff4e5..2592154 100644 --- a/examples/arb/ARBCancelSubscriptionRequest.php +++ b/examples/arb/ARBCancelSubscriptionRequest.php @@ -46,7 +46,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->ARBCancelSubscriptionRequest([ diff --git a/examples/arb/ARBCreateSubscriptionRequest.php b/examples/arb/ARBCreateSubscriptionRequest.php index 8a173da..2e32f03 100644 --- a/examples/arb/ARBCreateSubscriptionRequest.php +++ b/examples/arb/ARBCreateSubscriptionRequest.php @@ -70,7 +70,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->ARBCreateSubscriptionRequest([ diff --git a/examples/arb/ARBGetSubscriptionStatusRequest.php b/examples/arb/ARBGetSubscriptionStatusRequest.php index 4af650c..571e7f0 100644 --- a/examples/arb/ARBGetSubscriptionStatusRequest.php +++ b/examples/arb/ARBGetSubscriptionStatusRequest.php @@ -51,7 +51,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->ARBGetSubscriptionStatusRequest([ diff --git a/examples/arb/ARBUpdateSubscriptionRequest.php b/examples/arb/ARBUpdateSubscriptionRequest.php index 2853b55..9e0f4e5 100644 --- a/examples/arb/ARBUpdateSubscriptionRequest.php +++ b/examples/arb/ARBUpdateSubscriptionRequest.php @@ -54,7 +54,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->ARBUpdateSubscriptionRequest([ diff --git a/examples/cim/createCustomerPaymentProfileRequest.php b/examples/cim/createCustomerPaymentProfileRequest.php index ff27cbc..90a5e34 100644 --- a/examples/cim/createCustomerPaymentProfileRequest.php +++ b/examples/cim/createCustomerPaymentProfileRequest.php @@ -58,7 +58,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerPaymentProfileRequest([ diff --git a/examples/cim/createCustomerProfileRequest.php b/examples/cim/createCustomerProfileRequest.php index 19d60a0..5da99d4 100644 --- a/examples/cim/createCustomerProfileRequest.php +++ b/examples/cim/createCustomerProfileRequest.php @@ -84,7 +84,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileRequest([ diff --git a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php index d0e258e..20c7a58 100644 --- a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php +++ b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php @@ -107,7 +107,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php index 1770dd2..6804ad3 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php +++ b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php @@ -77,7 +77,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php index 9b60681..5f943b5 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php +++ b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php @@ -77,7 +77,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php index cb566c4..a1a3054 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php +++ b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php @@ -78,7 +78,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php index bd0fdc5..8d52b94 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php +++ b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php @@ -70,7 +70,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_refund.php b/examples/cim/createCustomerProfileTransactionRequest_refund.php index c0d79c6..6deeeb5 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_refund.php +++ b/examples/cim/createCustomerProfileTransactionRequest_refund.php @@ -76,7 +76,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_void.php b/examples/cim/createCustomerProfileTransactionRequest_void.php index 19c43db..31c3eee 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_void.php +++ b/examples/cim/createCustomerProfileTransactionRequest_void.php @@ -43,7 +43,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerShippingAddressRequest.php b/examples/cim/createCustomerShippingAddressRequest.php index 6dfff4a..c66299c 100644 --- a/examples/cim/createCustomerShippingAddressRequest.php +++ b/examples/cim/createCustomerShippingAddressRequest.php @@ -47,7 +47,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerShippingAddressRequest([ diff --git a/examples/cim/deleteCustomerPaymentProfileRequest.php b/examples/cim/deleteCustomerPaymentProfileRequest.php index 48d931c..9ce4ad3 100644 --- a/examples/cim/deleteCustomerPaymentProfileRequest.php +++ b/examples/cim/deleteCustomerPaymentProfileRequest.php @@ -35,7 +35,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->deleteCustomerPaymentProfileRequest([ diff --git a/examples/cim/deleteCustomerProfileRequest.php b/examples/cim/deleteCustomerProfileRequest.php index 6aa2d58..19bb5af 100644 --- a/examples/cim/deleteCustomerProfileRequest.php +++ b/examples/cim/deleteCustomerProfileRequest.php @@ -34,7 +34,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->deleteCustomerProfileRequest([ diff --git a/examples/cim/deleteCustomerShippingAddressRequest.php b/examples/cim/deleteCustomerShippingAddressRequest.php index 4a74d74..d0ccb60 100644 --- a/examples/cim/deleteCustomerShippingAddressRequest.php +++ b/examples/cim/deleteCustomerShippingAddressRequest.php @@ -35,7 +35,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->deleteCustomerShippingAddressRequest([ diff --git a/examples/cim/getCustomerPaymentProfileRequest.php b/examples/cim/getCustomerPaymentProfileRequest.php index 0faa204..d33ef8f 100644 --- a/examples/cim/getCustomerPaymentProfileRequest.php +++ b/examples/cim/getCustomerPaymentProfileRequest.php @@ -54,7 +54,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getCustomerPaymentProfileRequest([ diff --git a/examples/cim/getCustomerProfileIdsRequest.php b/examples/cim/getCustomerProfileIdsRequest.php index a7e5629..c15beb3 100644 --- a/examples/cim/getCustomerProfileIdsRequest.php +++ b/examples/cim/getCustomerProfileIdsRequest.php @@ -121,7 +121,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getCustomerProfileIdsRequest(); diff --git a/examples/cim/getCustomerProfileRequest.php b/examples/cim/getCustomerProfileRequest.php index d0fddab..a43bff9 100644 --- a/examples/cim/getCustomerProfileRequest.php +++ b/examples/cim/getCustomerProfileRequest.php @@ -85,7 +85,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getCustomerProfileRequest([ diff --git a/examples/cim/getCustomerShippingAddressRequest.php b/examples/cim/getCustomerShippingAddressRequest.php index 42df4ef..1626749 100644 --- a/examples/cim/getCustomerShippingAddressRequest.php +++ b/examples/cim/getCustomerShippingAddressRequest.php @@ -45,7 +45,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getCustomerShippingAddressRequest([ diff --git a/examples/cim/getHostedProfilePageRequest.php b/examples/cim/getHostedProfilePageRequest.php index cd905f6..8f69ab6 100644 --- a/examples/cim/getHostedProfilePageRequest.php +++ b/examples/cim/getHostedProfilePageRequest.php @@ -41,7 +41,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getHostedProfilePageRequest([ diff --git a/examples/cim/updateCustomerPaymentProfileRequest.php b/examples/cim/updateCustomerPaymentProfileRequest.php index b0adaca..dc3a24b 100644 --- a/examples/cim/updateCustomerPaymentProfileRequest.php +++ b/examples/cim/updateCustomerPaymentProfileRequest.php @@ -55,7 +55,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->updateCustomerPaymentProfileRequest([ diff --git a/examples/cim/updateCustomerProfileRequest.php b/examples/cim/updateCustomerProfileRequest.php index 763f238..ace75d3 100644 --- a/examples/cim/updateCustomerProfileRequest.php +++ b/examples/cim/updateCustomerProfileRequest.php @@ -39,7 +39,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->updateCustomerProfileRequest([ diff --git a/examples/cim/updateCustomerShippingAddressRequest.php b/examples/cim/updateCustomerShippingAddressRequest.php index 94e23a4..af69bd8 100644 --- a/examples/cim/updateCustomerShippingAddressRequest.php +++ b/examples/cim/updateCustomerShippingAddressRequest.php @@ -47,7 +47,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->updateCustomerShippingAddressRequest([ diff --git a/examples/cim/updateSplitTenderGroupRequest.php b/examples/cim/updateSplitTenderGroupRequest.php index 5c2cbde..42a8237 100644 --- a/examples/cim/updateSplitTenderGroupRequest.php +++ b/examples/cim/updateSplitTenderGroupRequest.php @@ -35,7 +35,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->updateSplitTenderGroupRequest([ diff --git a/examples/cim/validateCustomerPaymentProfileRequest.php b/examples/cim/validateCustomerPaymentProfileRequest.php index b022e7b..a16f205 100644 --- a/examples/cim/validateCustomerPaymentProfileRequest.php +++ b/examples/cim/validateCustomerPaymentProfileRequest.php @@ -38,7 +38,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->validateCustomerPaymentProfileRequest([ diff --git a/examples/reporting/getBatchStatisticsRequest.php b/examples/reporting/getBatchStatisticsRequest.php index 7bccf29..c754982 100644 --- a/examples/reporting/getBatchStatisticsRequest.php +++ b/examples/reporting/getBatchStatisticsRequest.php @@ -78,7 +78,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getBatchStatisticsRequest([ diff --git a/examples/reporting/getSettledBatchListRequest.php b/examples/reporting/getSettledBatchListRequest.php index 810aad4..93062e3 100644 --- a/examples/reporting/getSettledBatchListRequest.php +++ b/examples/reporting/getSettledBatchListRequest.php @@ -166,7 +166,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getSettledBatchListRequest([ diff --git a/examples/reporting/getTransactionDetailsRequest.php b/examples/reporting/getTransactionDetailsRequest.php index 2da0b31..02cd0ef 100644 --- a/examples/reporting/getTransactionDetailsRequest.php +++ b/examples/reporting/getTransactionDetailsRequest.php @@ -99,7 +99,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getTransactionDetailsRequest([ diff --git a/examples/reporting/getTransactionListRequest.php b/examples/reporting/getTransactionListRequest.php index eddd9e0..2e54672 100644 --- a/examples/reporting/getTransactionListRequest.php +++ b/examples/reporting/getTransactionListRequest.php @@ -61,7 +61,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getTransactionListRequest([ diff --git a/examples/reporting/getUnsettledTransactionListRequest.php b/examples/reporting/getUnsettledTransactionListRequest.php index 2580661..1083586 100644 --- a/examples/reporting/getUnsettledTransactionListRequest.php +++ b/examples/reporting/getUnsettledTransactionListRequest.php @@ -90,7 +90,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getUnsettledTransactionListRequest(); diff --git a/examples/sim/sim.php b/examples/sim/sim.php index 872bd9c..ab92868 100644 --- a/examples/sim/sim.php +++ b/examples/sim/sim.php @@ -18,7 +18,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); - require('../../src/autoload.php'); $sim = AuthnetApiFactory::getSimHandler(AUTHNET_LOGIN, AUTHNET_SIGNATURE, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $amount = 10.00; diff --git a/examples/webhooks/createWebhook.php b/examples/webhooks/createWebhook.php index 8c95190..ee793b1 100644 --- a/examples/webhooks/createWebhook.php +++ b/examples/webhooks/createWebhook.php @@ -54,7 +54,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $successful = false; $error = true; diff --git a/examples/webhooks/deleteWebhook.php b/examples/webhooks/deleteWebhook.php index 7e74783..c5fd445 100644 --- a/examples/webhooks/deleteWebhook.php +++ b/examples/webhooks/deleteWebhook.php @@ -29,7 +29,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $successful = false; $error = true; diff --git a/examples/webhooks/getEventTypes.php b/examples/webhooks/getEventTypes.php index bfe1699..b863772 100644 --- a/examples/webhooks/getEventTypes.php +++ b/examples/webhooks/getEventTypes.php @@ -92,7 +92,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $successful = false; $error = true; diff --git a/examples/webhooks/getWebhook.php b/examples/webhooks/getWebhook.php index 798c3ba..7b347b6 100644 --- a/examples/webhooks/getWebhook.php +++ b/examples/webhooks/getWebhook.php @@ -44,7 +44,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $successful = false; $error = true; diff --git a/examples/webhooks/listWebhooks.php b/examples/webhooks/listWebhooks.php index 78562be..2f00281 100644 --- a/examples/webhooks/listWebhooks.php +++ b/examples/webhooks/listWebhooks.php @@ -74,7 +74,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $successful = false; $error = true; diff --git a/examples/webhooks/notificationHistory.php b/examples/webhooks/notificationHistory.php index 6c1302b..3c36fbe 100644 --- a/examples/webhooks/notificationHistory.php +++ b/examples/webhooks/notificationHistory.php @@ -48,7 +48,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $successful = false; $error = true; diff --git a/examples/webhooks/ping.php b/examples/webhooks/ping.php index 520f25b..98a4724 100644 --- a/examples/webhooks/ping.php +++ b/examples/webhooks/ping.php @@ -40,7 +40,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $successful = false; $error = true; diff --git a/examples/webhooks/updateWebhook.php b/examples/webhooks/updateWebhook.php index 8aa3550..b724364 100644 --- a/examples/webhooks/updateWebhook.php +++ b/examples/webhooks/updateWebhook.php @@ -49,7 +49,6 @@ namespace JohnConde\Authnet; require('../../config.inc.php'); -require('../../src/autoload.php'); $successful = false; $error = true; diff --git a/phpdoc.xml b/phpdoc.xml index 668d3a0..eb1720e 100644 --- a/phpdoc.xml +++ b/phpdoc.xml @@ -1,14 +1,13 @@ - - - - build/docs - - - build/docs - - - src - src/autoload.php - tests/* - + + + + build/docs + + + build/docs + + + src + tests/* + \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index 15f0ca4..3da6faf 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,6 @@ ./src vendor - ./src/autoload.php diff --git a/src/autoload.php b/src/autoload.php deleted file mode 100644 index 216620f..0000000 --- a/src/autoload.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register( - function($class) { - static $classes = null; - if ($classes === null) { - $classes = array( - 'johnconde\\authnet\\authnetjson' => '/authnet/AuthnetJson.php', - 'johnconde\\authnet\\authnetapifactory' => '/authnet/AuthnetApiFactory.php', - 'johnconde\\authnet\\authnetjsonrequest' => '/authnet/AuthnetJsonRequest.php', - 'johnconde\\authnet\\authnetjsonresponse' => '/authnet/AuthnetJsonResponse.php', - 'johnconde\\authnet\\authnetsim' => '/authnet/AuthnetSim.php', - 'johnconde\\authnet\\authnetwebhook' => '/authnet/AuthnetWebhook.php', - 'johnconde\\authnet\\authnetwebhooksrequest' => '/authnet/AuthnetWebhooksRequest.php', - 'johnconde\\authnet\\authnetwebhooksresponse' => '/authnet/AuthnetWebhooksResponse.php', - 'johnconde\\authnet\\transactionresponse' => '/authnet/TransactionResponse.php', - 'johnconde\\authnet\\authnetcannotsetparamsexception' => '/exceptions/AuthnetCannotSetParamsException.php', - 'johnconde\\authnet\\authnetcurlexception' => '/exceptions/AuthnetCurlException.php', - 'johnconde\\authnet\\authnetexception' => '/exceptions/AuthnetException.php', - 'johnconde\\authnet\\authnetinvalidcredentialsexception' => '/exceptions/AuthnetInvalidCredentialsException.php', - 'johnconde\\authnet\\authnetinvalidamountexception' => '/exceptions/AuthnetInvalidAmountException.php', - 'johnconde\\authnet\\authnetinvalidjsonexception' => '/exceptions/AuthnetInvalidJsonException.php', - 'johnconde\\authnet\\authnetinvalidserverexception' => '/exceptions/AuthnetInvalidServerException.php', - 'johnconde\\authnet\\authnettransactionresponsecallexception' => '/exceptions/AuthnetTransactionResponseCallException.php' - ); - } - $cn = strtolower($class); - if (isset($classes[$cn])) { - require(__DIR__.$classes[$cn]); - } - } -); From e26d00f06a063ed06a271c4c487a273137bcfff0 Mon Sep 17 00:00:00 2001 From: John Conde Date: Sat, 16 Feb 2019 16:26:48 -0500 Subject: [PATCH 043/105] Added constructor to Authnet exceptions --- src/exceptions/AuthnetCannotSetParamsException.php | 9 +++++++-- src/exceptions/AuthnetCurlException.php | 5 ++++- src/exceptions/AuthnetException.php | 7 +++++-- src/exceptions/AuthnetInvalidAmountException.php | 7 +++++-- src/exceptions/AuthnetInvalidCredentialsException.php | 7 +++++-- src/exceptions/AuthnetInvalidJsonException.php | 7 +++++-- src/exceptions/AuthnetInvalidParameterException.php | 7 +++++-- src/exceptions/AuthnetInvalidServerException.php | 7 +++++-- .../AuthnetTransactionResponseCallException.php | 5 ++++- 9 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/exceptions/AuthnetCannotSetParamsException.php b/src/exceptions/AuthnetCannotSetParamsException.php index 8c88675..1db20ba 100644 --- a/src/exceptions/AuthnetCannotSetParamsException.php +++ b/src/exceptions/AuthnetCannotSetParamsException.php @@ -13,6 +13,8 @@ namespace JohnConde\Authnet; +use Throwable; + /** * Exception that is throw when when client code attempts to set a parameter directly (i.e. using __set()) * @@ -24,5 +26,8 @@ */ class AuthnetCannotSetParamsException extends AuthnetException { - -} \ No newline at end of file + public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} diff --git a/src/exceptions/AuthnetCurlException.php b/src/exceptions/AuthnetCurlException.php index ee33db2..20ef0d6 100644 --- a/src/exceptions/AuthnetCurlException.php +++ b/src/exceptions/AuthnetCurlException.php @@ -24,5 +24,8 @@ */ class AuthnetCurlException extends AuthnetException { - + public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } } diff --git a/src/exceptions/AuthnetException.php b/src/exceptions/AuthnetException.php index be2a4d4..8bf6db7 100644 --- a/src/exceptions/AuthnetException.php +++ b/src/exceptions/AuthnetException.php @@ -24,5 +24,8 @@ */ class AuthnetException extends \Exception { - -} \ No newline at end of file + public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} diff --git a/src/exceptions/AuthnetInvalidAmountException.php b/src/exceptions/AuthnetInvalidAmountException.php index f910bdf..e35ad64 100644 --- a/src/exceptions/AuthnetInvalidAmountException.php +++ b/src/exceptions/AuthnetInvalidAmountException.php @@ -24,5 +24,8 @@ */ class AuthnetInvalidAmountException extends AuthnetException { - -} \ No newline at end of file + public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} diff --git a/src/exceptions/AuthnetInvalidCredentialsException.php b/src/exceptions/AuthnetInvalidCredentialsException.php index 1f089b2..22f9903 100644 --- a/src/exceptions/AuthnetInvalidCredentialsException.php +++ b/src/exceptions/AuthnetInvalidCredentialsException.php @@ -24,5 +24,8 @@ */ class AuthnetInvalidCredentialsException extends AuthnetException { - -} \ No newline at end of file + public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} diff --git a/src/exceptions/AuthnetInvalidJsonException.php b/src/exceptions/AuthnetInvalidJsonException.php index 23114e5..20e9949 100644 --- a/src/exceptions/AuthnetInvalidJsonException.php +++ b/src/exceptions/AuthnetInvalidJsonException.php @@ -24,5 +24,8 @@ */ class AuthnetInvalidJsonException extends AuthnetException { - -} \ No newline at end of file + public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} diff --git a/src/exceptions/AuthnetInvalidParameterException.php b/src/exceptions/AuthnetInvalidParameterException.php index 63b912e..353a129 100644 --- a/src/exceptions/AuthnetInvalidParameterException.php +++ b/src/exceptions/AuthnetInvalidParameterException.php @@ -23,5 +23,8 @@ */ class AuthnetInvalidParameterException extends AuthnetException { - -} \ No newline at end of file + public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} diff --git a/src/exceptions/AuthnetInvalidServerException.php b/src/exceptions/AuthnetInvalidServerException.php index a249ac9..e2756d4 100644 --- a/src/exceptions/AuthnetInvalidServerException.php +++ b/src/exceptions/AuthnetInvalidServerException.php @@ -25,5 +25,8 @@ */ class AuthnetInvalidServerException extends AuthnetException { - -} \ No newline at end of file + public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} diff --git a/src/exceptions/AuthnetTransactionResponseCallException.php b/src/exceptions/AuthnetTransactionResponseCallException.php index 46eb780..c1c3843 100644 --- a/src/exceptions/AuthnetTransactionResponseCallException.php +++ b/src/exceptions/AuthnetTransactionResponseCallException.php @@ -24,5 +24,8 @@ */ class AuthnetTransactionResponseCallException extends AuthnetException { - + public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } } From 8b5c7076dba892bf08271c47f9e7337a6ea06b3e Mon Sep 17 00:00:00 2001 From: John Conde Date: Sat, 23 Feb 2019 11:07:33 -0500 Subject: [PATCH 044/105] Added missing words to make the sentence coherent --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b54441e..4ac6150 100644 --- a/README.md +++ b/README.md @@ -369,7 +369,7 @@ includes common problems and their solutions. If you need additional assistance, I can be found at Stack Overflow. Be sure when you [ask a question](http://stackoverflow.com/questions/ask?tags=php,authorize.net) pertaining to the usage of -this class to tag your question with the **PHP** and **Authorize.Net** tags. Make sure you follow their +this class be sure to tag your question with the **PHP** and **Authorize.Net** tags. Make sure you follow their [guide for asking a good question](http://stackoverflow.com/help/how-to-ask) as poorly asked questions will be closed and I will not be able to assist you. From 6208aa098c9b86915a04813530ad762794f2f40f Mon Sep 17 00:00:00 2001 From: John Conde Date: Sun, 24 Feb 2019 14:31:23 -0500 Subject: [PATCH 045/105] Removed blank line between Date: Thu, 11 Apr 2019 21:17:22 -0400 Subject: [PATCH 046/105] Changed AuthnetJson to AuthnetJSON in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ac6150..7bab1f7 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Library that abstracts [Authorize.Net](http://www.authorize.net/)'s [JSON APIs]( Simply add a dependency on `stymiee/authnetjson` to your project's `composer.json` file if you use [Composer](http://getcomposer.org/) to manage the dependencies of your project. -Here is a minimal example of a `composer.json` file that just defines a dependency on AuthnetJson: +Here is a minimal example of a `composer.json` file that just defines a dependency on AuthnetJSON: { "require": { @@ -348,7 +348,7 @@ If `apache_request_headers()`/`getallheaders()` are not available to you, you ca ## Debugging To assist with debugging the `__toString()` method has been overridden to output important elements pertaining to the -usage of this library. Simple `echo` your AuthnetJson object to see: +usage of this library. Simple `echo` your AuthnetJSON object to see: - The API Login ID used - The API transaction Key used From 5a2ac4b86dd601a8928e0c1e96a68957ed0dca6c Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 2 May 2019 21:48:28 -0400 Subject: [PATCH 047/105] Removed unused AuthnetInvalidParameterException class --- .../AuthnetInvalidParameterException.php | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 src/exceptions/AuthnetInvalidParameterException.php diff --git a/src/exceptions/AuthnetInvalidParameterException.php b/src/exceptions/AuthnetInvalidParameterException.php deleted file mode 100644 index 353a129..0000000 --- a/src/exceptions/AuthnetInvalidParameterException.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace JohnConde\Authnet; - -/** - * Exception that is throw when invalid parameters are passed to a method that are not otherwise throwing an exception - * - * @package AuthnetJSON - * @author John Conde - * @copyright John Conde - * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 - * @link https://github.com/stymiee/authnetjson - */ -class AuthnetInvalidParameterException extends AuthnetException -{ - public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - } -} From 5c93d2f71e6c37edb17504d47fc19d10a29008da Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 2 May 2019 21:48:47 -0400 Subject: [PATCH 048/105] Added phpunit to require-dev --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 52ccb2d..cde23ad 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ "ext-json": "*" }, "require-dev": { + "phpunit/phpunit": "^8", "squizlabs/php_codesniffer": "3.*", "phpmd/phpmd" : "@stable" }, From ab87c615c1fc6ca47709569182aa0aa7db4658d5 Mon Sep 17 00:00:00 2001 From: John Conde Date: Thu, 2 May 2019 21:49:08 -0400 Subject: [PATCH 049/105] Updated unit tests for phpunit 8 --- tests/AuthnetApiFactoryTest.php | 87 +++++++++++++++++---------- tests/AuthnetJsonAimPaypalTest.php | 24 ++++---- tests/AuthnetJsonAimTest.php | 28 ++++----- tests/AuthnetJsonArbTest.php | 20 +++--- tests/AuthnetJsonCimTest.php | 62 +++++++++---------- tests/AuthnetJsonReportingTest.php | 16 ++--- tests/AuthnetJsonRequestTest.php | 30 +++++---- tests/AuthnetJsonResponseTest.php | 53 ++++++++-------- tests/AuthnetSimTest.php | 23 +++---- tests/AuthnetWebhookTest.php | 30 ++++----- tests/AuthnetWebhooksRequestTest.php | 66 +++++++++++--------- tests/AuthnetWebhooksResponseTest.php | 29 ++++----- tests/TransactionResponseTest.php | 6 +- 13 files changed, 258 insertions(+), 216 deletions(-) diff --git a/tests/AuthnetApiFactoryTest.php b/tests/AuthnetApiFactoryTest.php index 1d2b364..ca127dd 100644 --- a/tests/AuthnetApiFactoryTest.php +++ b/tests/AuthnetApiFactoryTest.php @@ -20,7 +20,7 @@ class AuthnetApiFactoryTest extends TestCase private $login; private $transactionKey; - protected function setUp() + protected function setUp() : void { $this->login = 'test'; $this->transactionKey = 'test'; @@ -29,7 +29,7 @@ protected function setUp() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetWebServiceUrlProductionServer() + public function testGetWebServiceUrlProductionServer() : void { $server = AuthnetApiFactory::USE_PRODUCTION_SERVER; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebServiceURL'); @@ -42,7 +42,7 @@ public function testGetWebServiceUrlProductionServer() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetWebServiceUrlDevelopmentServer() + public function testGetWebServiceUrlDevelopmentServer() : void { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebServiceURL'); @@ -55,7 +55,7 @@ public function testGetWebServiceUrlDevelopmentServer() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetWebServiceUrlAkamaiServer() + public function testGetWebServiceUrlAkamaiServer() : void { $server = AuthnetApiFactory::USE_AKAMAI_SERVER; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebServiceURL'); @@ -67,10 +67,13 @@ public function testGetWebServiceUrlAkamaiServer() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL - * @expectedException \JohnConde\Authnet\AuthnetInvalidServerException + * @covers \JohnConde\Authnet\AuthnetException::__construct() + * @covers \JohnConde\Authnet\AuthnetInvalidServerException::__construct() */ - public function testGetWebServiceUrlBadServer() + public function testGetWebServiceUrlBadServer() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException'); + $server = 99; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebServiceURL'); $reflectionMethod->setAccessible(true); @@ -79,32 +82,38 @@ public function testGetWebServiceUrlBadServer() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler + * @covers \JohnConde\Authnet\AuthnetInvalidCredentialsException::__construct() * @uses \JohnConde\Authnet\AuthnetJsonRequest - * @expectedException \JohnConde\Authnet\AuthnetInvalidCredentialsException */ - public function testExceptionIsRaisedForInvalidCredentialsLogin() + public function testExceptionIsRaisedForInvalidCredentialsLogin() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException'); + $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; AuthnetApiFactory::getJsonApiHandler('', $this->transactionKey, $server); } /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler + * @covers \JohnConde\Authnet\AuthnetInvalidCredentialsException::__construct() * @uses \JohnConde\Authnet\AuthnetJsonRequest - * @expectedException \JohnConde\Authnet\AuthnetInvalidCredentialsException */ - public function testExceptionIsRaisedForInvalidCredentialsTransactionKey() + public function testExceptionIsRaisedForInvalidCredentialsTransactionKey() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException'); + $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; AuthnetApiFactory::getJsonApiHandler($this->login, '', $server); } /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler - * @expectedException \JohnConde\Authnet\AuthnetInvalidServerException + * @covers \JohnConde\Authnet\AuthnetInvalidServerException::__construct() */ - public function testExceptionIsRaisedForAuthnetInvalidServer() + public function testExceptionIsRaisedForAuthnetInvalidServer() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException'); + AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, 5); } @@ -112,7 +121,7 @@ public function testExceptionIsRaisedForAuthnetInvalidServer() * @covers \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetJsonRequest */ - public function testCurlWrapperProductionResponse() + public function testCurlWrapperProductionResponse() : void { $server = AuthnetApiFactory::USE_PRODUCTION_SERVER; $authnet = AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, $server); @@ -129,7 +138,7 @@ public function testCurlWrapperProductionResponse() * @covers \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetJsonRequest */ - public function testCurlWrapperDevelopmentResponse() + public function testCurlWrapperDevelopmentResponse() : void { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; $authnet = AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, $server); @@ -145,7 +154,7 @@ public function testCurlWrapperDevelopmentResponse() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getSimHandler */ - public function testGetSimHandler() + public function testGetSimHandler() : void { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; $sim = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $server); @@ -155,10 +164,12 @@ public function testGetSimHandler() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getSimHandler - * @expectedException \JohnConde\Authnet\AuthnetInvalidCredentialsException + * @covers \JohnConde\Authnet\AuthnetInvalidCredentialsException::__construct() */ - public function testExceptionIsRaisedForInvalidCredentialsSim() + public function testExceptionIsRaisedForInvalidCredentialsSim() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException'); + $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; AuthnetApiFactory::getSimHandler('', $this->transactionKey, $server); } @@ -166,7 +177,7 @@ public function testExceptionIsRaisedForInvalidCredentialsSim() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getSimURL */ - public function testGetSimServerTest() + public function testGetSimServerTest() : void { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getSimURL'); @@ -179,7 +190,7 @@ public function testGetSimServerTest() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getSimURL */ - public function testGetSimServerProduction() + public function testGetSimServerProduction() : void { $server = AuthnetApiFactory::USE_PRODUCTION_SERVER; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getSimURL'); @@ -191,41 +202,49 @@ public function testGetSimServerProduction() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getSimURL - * @expectedException \JohnConde\Authnet\AuthnetInvalidServerException + * @covers \JohnConde\Authnet\AuthnetInvalidServerException::__construct() */ - public function testExceptionIsRaisedForAuthnetInvalidSimServer() + public function testExceptionIsRaisedForAuthnetInvalidSimServer() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException'); + AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, 5); } /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksHandler + * @covers \JohnConde\Authnet\AuthnetInvalidCredentialsException::__construct() * @uses \JohnConde\Authnet\AuthnetWebhooksRequest - * @expectedException \JohnConde\Authnet\AuthnetInvalidCredentialsException */ - public function testExceptionIsRaisedForInvalidCredentialsLoginWebhooks() + public function testExceptionIsRaisedForInvalidCredentialsLoginWebhooks() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException'); + $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; AuthnetApiFactory::getWebhooksHandler('', $this->transactionKey, $server); } /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksHandler + * @covers \JohnConde\Authnet\AuthnetInvalidCredentialsException::__construct() * @uses \JohnConde\Authnet\AuthnetWebhooksRequest - * @expectedException \JohnConde\Authnet\AuthnetInvalidCredentialsException */ - public function testExceptionIsRaisedForInvalidCredentialsTransactionKeyWebhooks() + public function testExceptionIsRaisedForInvalidCredentialsTransactionKeyWebhooks() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException'); + $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; AuthnetApiFactory::getWebhooksHandler($this->login, '', $server); } /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksHandler - * @expectedException \JohnConde\Authnet\AuthnetInvalidServerException + * @covers \JohnConde\Authnet\AuthnetInvalidServerException::__construct() */ - public function testExceptionIsRaisedForAuthnetInvalidServerWebhooks() + public function testExceptionIsRaisedForAuthnetInvalidServerWebhooks() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException'); + AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, 5); } @@ -233,7 +252,7 @@ public function testExceptionIsRaisedForAuthnetInvalidServerWebhooks() * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksHandler * @uses \JohnConde\Authnet\AuthnetWebhooksRequest */ - public function testCurlWrapperProductionResponseWebhooks() + public function testCurlWrapperProductionResponseWebhooks() : void { $server = AuthnetApiFactory::USE_PRODUCTION_SERVER; $authnet = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, $server); @@ -250,7 +269,7 @@ public function testCurlWrapperProductionResponseWebhooks() * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksHandler * @uses \JohnConde\Authnet\AuthnetWebhooksRequest */ - public function testCurlWrapperDevelopmentResponseWebhooks() + public function testCurlWrapperDevelopmentResponseWebhooks() : void { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; $authnet = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, $server); @@ -266,7 +285,7 @@ public function testCurlWrapperDevelopmentResponseWebhooks() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksURL */ - public function testGetWebhooksUrlProductionServer() + public function testGetWebhooksUrlProductionServer() : void { $server = AuthnetApiFactory::USE_PRODUCTION_SERVER; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebhooksURL'); @@ -279,7 +298,7 @@ public function testGetWebhooksUrlProductionServer() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksURL */ - public function testGetWebhooksUrlDevelopmentServer() + public function testGetWebhooksUrlDevelopmentServer() : void { $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebhooksURL'); @@ -291,10 +310,12 @@ public function testGetWebhooksUrlDevelopmentServer() /** * @covers \JohnConde\Authnet\AuthnetApiFactory::getWebhooksURL - * @expectedException \JohnConde\Authnet\AuthnetInvalidServerException + * @covers \JohnConde\Authnet\AuthnetInvalidServerException::__construct() */ - public function testGetWebhooksUrlBadServer() + public function testGetWebhooksUrlBadServer() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException'); + $server = 99; $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebhooksURL'); $reflectionMethod->setAccessible(true); diff --git a/tests/AuthnetJsonAimPaypalTest.php b/tests/AuthnetJsonAimPaypalTest.php index edbfb36..cf024e4 100644 --- a/tests/AuthnetJsonAimPaypalTest.php +++ b/tests/AuthnetJsonAimPaypalTest.php @@ -22,7 +22,7 @@ class AuthnetJsonAimPaypalTest extends TestCase private $server; private $http; - protected function setUp() + protected function setUp() : void { $this->login = 'test'; $this->transactionKey = 'test'; @@ -40,7 +40,7 @@ protected function setUp() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestAuthCapture() + public function testCreateTransactionRequestAuthCapture() : void { $requestJson = array( "transactionRequest" => array( @@ -111,7 +111,7 @@ public function testCreateTransactionRequestAuthCapture() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestAuthCaptureContinue() + public function testCreateTransactionRequestAuthCaptureContinue() : void { $requestJson = array( "transactionRequest" => array( @@ -175,7 +175,7 @@ public function testCreateTransactionRequestAuthCaptureContinue() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestAuthOnly() + public function testCreateTransactionRequestAuthOnly() : void { $requestJson = array( "transactionRequest" => array( @@ -243,7 +243,7 @@ public function testCreateTransactionRequestAuthOnly() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestAuthOnlyContinue() + public function testCreateTransactionRequestAuthOnlyContinue() : void { $requestJson = array( "transactionRequest" => array( @@ -307,7 +307,7 @@ public function testCreateTransactionRequestAuthOnlyContinue() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestGetDetails() + public function testCreateTransactionRequestGetDetails() : void { $requestJson = array( "transactionRequest" => array( @@ -366,7 +366,7 @@ public function testCreateTransactionRequestGetDetails() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestPriorAuthCapture() + public function testCreateTransactionRequestPriorAuthCapture() : void { $requestJson = array( "transactionRequest" => array( @@ -425,7 +425,7 @@ public function testCreateTransactionRequestPriorAuthCapture() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestRefund() + public function testCreateTransactionRequestRefund() : void { $requestJson = array( "transactionRequest" => array( @@ -479,7 +479,7 @@ public function testCreateTransactionRequestRefund() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestVoid() + public function testCreateTransactionRequestVoid() : void { $requestJson = array( "transactionRequest" => array( @@ -539,7 +539,7 @@ public function testCreateTransactionRequestVoid() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestAuthCaptureError() + public function testCreateTransactionRequestAuthCaptureError() : void { $requestJson = array( "transactionRequest" => array( @@ -615,7 +615,7 @@ public function testCreateTransactionRequestAuthCaptureError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestGetDetailsError() + public function testCreateTransactionRequestGetDetailsError() : void { $requestJson = array( "transactionRequest" => array( @@ -678,7 +678,7 @@ public function testCreateTransactionRequestGetDetailsError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestRefundError() + public function testCreateTransactionRequestRefundError() : void { $requestJson = array( "transactionRequest" => array( diff --git a/tests/AuthnetJsonAimTest.php b/tests/AuthnetJsonAimTest.php index 8c7da60..50d1558 100644 --- a/tests/AuthnetJsonAimTest.php +++ b/tests/AuthnetJsonAimTest.php @@ -22,7 +22,7 @@ class AuthnetJsonAimTest extends TestCase private $server; private $http; - protected function setUp() + protected function setUp() : void { $this->login = 'test'; $this->transactionKey = 'test'; @@ -40,7 +40,7 @@ protected function setUp() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestAuthCaptureSuccess() + public function testCreateTransactionRequestAuthCaptureSuccess() : void { $requestJson = array( 'refId' => '94564789', @@ -225,7 +225,7 @@ public function testCreateTransactionRequestAuthCaptureSuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestAuthOnlySuccess() + public function testCreateTransactionRequestAuthOnlySuccess() : void { $requestJson = array( 'refId' => '65376587', @@ -399,7 +399,7 @@ public function testCreateTransactionRequestAuthOnlySuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestAuthOnlyError() + public function testCreateTransactionRequestAuthOnlyError() : void { $requestJson = array( 'refId' => '14290435', @@ -586,7 +586,7 @@ public function testCreateTransactionRequestAuthOnlyError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestCaptureOnly() + public function testCreateTransactionRequestCaptureOnly() : void { $requestJson = array( 'refId' => '99120820', @@ -651,7 +651,7 @@ public function testCreateTransactionRequestCaptureOnly() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestPriorAuthCapture() + public function testCreateTransactionRequestPriorAuthCapture() : void { $requestJson = array( 'refId' => '34913421', @@ -723,7 +723,7 @@ public function testCreateTransactionRequestPriorAuthCapture() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestPriorAuthCaptureError() + public function testCreateTransactionRequestPriorAuthCaptureError() : void { $requestJson = array( 'refId' => '14254181', @@ -796,7 +796,7 @@ public function testCreateTransactionRequestPriorAuthCaptureError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestRefund() + public function testCreateTransactionRequestRefund() : void { $requestJson = array( 'refId' => '95063294', @@ -877,7 +877,7 @@ public function testCreateTransactionRequestRefund() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestVoid() + public function testCreateTransactionRequestVoid() : void { $requestJson = array( 'refId' => '35481415', @@ -951,7 +951,7 @@ public function testCreateTransactionRequestVoid() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestVoidError() + public function testCreateTransactionRequestVoidError() : void { $requestJson = array( 'refId' => '23039947', @@ -1025,7 +1025,7 @@ public function testCreateTransactionRequestVoidError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testSendCustomerTransactionReceiptRequest() + public function testSendCustomerTransactionReceiptRequest() : void { $requestJson = array( 'refId' => "2241729", @@ -1076,7 +1076,7 @@ public function testSendCustomerTransactionReceiptRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateTransactionRequestVisaCheckout() + public function testCreateTransactionRequestVisaCheckout() : void { $requestJson = array( "refId" => rand(1000000, 100000000), @@ -1154,7 +1154,7 @@ public function testCreateTransactionRequestVisaCheckout() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testDecryptPaymentDataRequest() + public function testDecryptPaymentDataRequest() : void { $requestJson = array( "opaqueData" => array( @@ -1251,7 +1251,7 @@ public function testDecryptPaymentDataRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testDecryptPaymentDataRequestError() + public function testDecryptPaymentDataRequestError() : void { $requestJson = array( "opaqueData" => array( diff --git a/tests/AuthnetJsonArbTest.php b/tests/AuthnetJsonArbTest.php index fb0ddfa..a613164 100644 --- a/tests/AuthnetJsonArbTest.php +++ b/tests/AuthnetJsonArbTest.php @@ -22,7 +22,7 @@ class AuthnetJsonArbTest extends TestCase private $server; private $http; - protected function setUp() + protected function setUp() : void { $this->login = 'test'; $this->transactionKey = 'test'; @@ -40,7 +40,7 @@ protected function setUp() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testARBCreateSubscriptionRequestSuccess() + public function testARBCreateSubscriptionRequestSuccess() : void { $requestJson = array( 'refId' => 'Sample', @@ -102,7 +102,7 @@ public function testARBCreateSubscriptionRequestSuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testARBCreateSubscriptionRequestDuplicateRequestError() + public function testARBCreateSubscriptionRequestDuplicateRequestError() : void { $requestJson = array( 'refId' => 'Sample', @@ -163,7 +163,7 @@ public function testARBCreateSubscriptionRequestDuplicateRequestError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testARBCreateSubscriptionRequestInvalidStartDateError() + public function testARBCreateSubscriptionRequestInvalidStartDateError() : void { $requestJson = array( 'refId' => 'Sample', @@ -223,7 +223,7 @@ public function testARBCreateSubscriptionRequestInvalidStartDateError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testARBGetSubscriptionStatusRequestActive() + public function testARBGetSubscriptionStatusRequestActive() : void { $requestJson = array( 'refId' => 'Sample', @@ -267,7 +267,7 @@ public function testARBGetSubscriptionStatusRequestActive() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testARBGetSubscriptionStatusRequestCancelled() + public function testARBGetSubscriptionStatusRequestCancelled() : void { $requestJson = array( 'refId' => 'Sample', @@ -311,7 +311,7 @@ public function testARBGetSubscriptionStatusRequestCancelled() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testARBCancelSubscriptionRequestSuccess() + public function testARBCancelSubscriptionRequestSuccess() : void { $requestJson = array( 'refId' => 'Sample', @@ -348,7 +348,7 @@ public function testARBCancelSubscriptionRequestSuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testARBCancelSubscriptionRequestAlreadyCancelled() + public function testARBCancelSubscriptionRequestAlreadyCancelled() : void { $requestJson = array( 'refId' => 'Sample', @@ -385,7 +385,7 @@ public function testARBCancelSubscriptionRequestAlreadyCancelled() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testARBUpdateSubscriptionRequestSuccess() + public function testARBUpdateSubscriptionRequestSuccess() : void { $requestJson = array( 'refId' => 'Sample', @@ -430,7 +430,7 @@ public function testARBUpdateSubscriptionRequestSuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testARBUpdateSubscriptionRequestError() + public function testARBUpdateSubscriptionRequestError() : void { $requestJson = array( 'refId' => 'Sample', diff --git a/tests/AuthnetJsonCimTest.php b/tests/AuthnetJsonCimTest.php index 53a477c..3187b6b 100644 --- a/tests/AuthnetJsonCimTest.php +++ b/tests/AuthnetJsonCimTest.php @@ -22,7 +22,7 @@ class AuthnetJsonCimTest extends TestCase private $server; private $http; - protected function setUp() + protected function setUp() : void { $this->login = 'test'; $this->transactionKey = 'test'; @@ -41,7 +41,7 @@ protected function setUp() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileRequestSuccess() + public function testCreateCustomerProfileRequestSuccess() : void { $requestJson = array( 'profile' => array( @@ -121,7 +121,7 @@ public function testCreateCustomerProfileRequestSuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileRequestDuplicateRecordError() + public function testCreateCustomerProfileRequestDuplicateRecordError() : void { $requestJson = array( 'profile' => array( @@ -197,7 +197,7 @@ public function testCreateCustomerProfileRequestDuplicateRecordError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerPaymentProfileRequest() + public function testCreateCustomerPaymentProfileRequest() : void { $requestJson = array( 'customerProfileId' => '30582495', @@ -258,7 +258,7 @@ public function testCreateCustomerPaymentProfileRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileTransactionAuthCaptureRequest() + public function testCreateCustomerProfileTransactionAuthCaptureRequest() : void { $requestJson = array( 'transaction' => array( @@ -339,7 +339,7 @@ public function testCreateCustomerProfileTransactionAuthCaptureRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileTransactionRequestAuthCaptureError() + public function testCreateCustomerProfileTransactionRequestAuthCaptureError() : void { $requestJson = array ( 'createCustomerProfileTransactionRequest' => array ( @@ -424,7 +424,7 @@ public function testCreateCustomerProfileTransactionRequestAuthCaptureError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileTransactionRequestAuthOnly() + public function testCreateCustomerProfileTransactionRequestAuthOnly() : void { $requestJson = array( 'transaction' => array( @@ -505,7 +505,7 @@ public function testCreateCustomerProfileTransactionRequestAuthOnly() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileTransactionRequestCaptureOnly() + public function testCreateCustomerProfileTransactionRequestCaptureOnly() : void { $requestJson = array( 'transaction' => array( @@ -587,7 +587,7 @@ public function testCreateCustomerProfileTransactionRequestCaptureOnly() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileTransactionRequestPriorAuthCapture() + public function testCreateCustomerProfileTransactionRequestPriorAuthCapture() : void { $requestJson = array( 'transaction' => array( @@ -661,7 +661,7 @@ public function testCreateCustomerProfileTransactionRequestPriorAuthCapture() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileTransactionRequestPriorAuthCaptureError() + public function testCreateCustomerProfileTransactionRequestPriorAuthCaptureError() : void { $requestJson = array ( 'createCustomerProfileTransactionRequest' => array ( @@ -740,7 +740,7 @@ public function testCreateCustomerProfileTransactionRequestPriorAuthCaptureError * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileTransactionRequestRefund() + public function testCreateCustomerProfileTransactionRequestRefund() : void { $requestJson = array( 'transaction' => array( @@ -820,7 +820,7 @@ public function testCreateCustomerProfileTransactionRequestRefund() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileTransactionRequestRefundError() + public function testCreateCustomerProfileTransactionRequestRefundError() : void { $requestJson = array ( 'createCustomerProfileTransactionRequest' => array ( @@ -905,7 +905,7 @@ public function testCreateCustomerProfileTransactionRequestRefundError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerProfileTransactionRequestVoid() + public function testCreateCustomerProfileTransactionRequestVoid() : void { $requestJson = array( 'transaction' => array( @@ -952,7 +952,7 @@ public function testCreateCustomerProfileTransactionRequestVoid() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testCreateCustomerShippingAddressRequest() + public function testCreateCustomerShippingAddressRequest() : void { $requestJson = array( 'customerProfileId' => '31390172', @@ -1003,7 +1003,7 @@ public function testCreateCustomerShippingAddressRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testUpdateCustomerProfileRequest() + public function testUpdateCustomerProfileRequest() : void { $requestJson = array( 'profile' => array( @@ -1045,7 +1045,7 @@ public function testUpdateCustomerProfileRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testUpdateCustomerProfileRequestError() + public function testUpdateCustomerProfileRequestError() : void { $requestJson = array ( 'updateCustomerPaymentProfileRequest' => array ( @@ -1109,7 +1109,7 @@ public function testUpdateCustomerProfileRequestError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testUpdateCustomerPaymentProfileRequest() + public function testUpdateCustomerPaymentProfileRequest() : void { $requestJson = array( 'customerProfileId' => '31390172', @@ -1167,7 +1167,7 @@ public function testUpdateCustomerPaymentProfileRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testUpdateCustomerShippingAddressRequest() + public function testUpdateCustomerShippingAddressRequest() : void { $requestJson = array( 'customerProfileId' => '31390172', @@ -1217,7 +1217,7 @@ public function testUpdateCustomerShippingAddressRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testUpdateCustomerShippingAddressRequestError() + public function testUpdateCustomerShippingAddressRequestError() : void { $requestJson = array ( 'updateCustomerShippingAddressRequest' => array ( @@ -1273,7 +1273,7 @@ public function testUpdateCustomerShippingAddressRequestError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testUpdateSplitTenderGroupRequest() + public function testUpdateSplitTenderGroupRequest() : void { $requestJson = array ( 'splitTenderId' => '123456', @@ -1311,7 +1311,7 @@ public function testUpdateSplitTenderGroupRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testUpdateSplitTenderGroupRequestError() + public function testUpdateSplitTenderGroupRequestError() : void { $requestJson = array ( 'updateSplitTenderGroupRequest' => array ( @@ -1355,7 +1355,7 @@ public function testUpdateSplitTenderGroupRequestError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testDeleteCustomerProfileRequest() + public function testDeleteCustomerProfileRequest() : void { $requestJson = array( 'customerProfileId' => '31390172' @@ -1392,7 +1392,7 @@ public function testDeleteCustomerProfileRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testDeleteCustomerProfileRequestError() + public function testDeleteCustomerProfileRequestError() : void { $requestJson = array ( 'deleteCustomerProfileRequest' => array ( @@ -1435,7 +1435,7 @@ public function testDeleteCustomerProfileRequestError() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testDeleteCustomerPaymentProfileRequest() + public function testDeleteCustomerPaymentProfileRequest() : void { $requestJson = array( 'customerProfileId' => '31390172', @@ -1473,7 +1473,7 @@ public function testDeleteCustomerPaymentProfileRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testDeleteCustomerShippingAddressRequest() + public function testDeleteCustomerShippingAddressRequest() : void { $requestJson = array( 'customerProfileId' => '31390172', @@ -1511,7 +1511,7 @@ public function testDeleteCustomerShippingAddressRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testValidateCustomerPaymentProfileRequest() + public function testValidateCustomerPaymentProfileRequest() : void { $requestJson = array( 'customerProfileId' => '31390172', @@ -1553,7 +1553,7 @@ public function testValidateCustomerPaymentProfileRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetCustomerPaymentProfileRequest() + public function testGetCustomerPaymentProfileRequest() : void { $requestJson = array( 'customerProfileId' => '31390172', @@ -1621,7 +1621,7 @@ public function testGetCustomerPaymentProfileRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetCustomerProfileIdsRequest() + public function testGetCustomerProfileIdsRequest() : void { $responseJson = '{ "ids":[ @@ -1745,7 +1745,7 @@ public function testGetCustomerProfileIdsRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetCustomerProfileRequest() + public function testGetCustomerProfileRequest() : void { $requestJson = array( 'customerProfileId' => '31390172' @@ -1866,7 +1866,7 @@ public function testGetCustomerProfileRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetCustomerShippingAddressRequest() + public function testGetCustomerShippingAddressRequest() : void { $requestJson = array( 'customerProfileId' => '31390172', @@ -1922,7 +1922,7 @@ public function testGetCustomerShippingAddressRequest() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetHostedProfilePageRequest() + public function testGetHostedProfilePageRequest() : void { $requestJson = array( 'customerProfileId' => '31390172', diff --git a/tests/AuthnetJsonReportingTest.php b/tests/AuthnetJsonReportingTest.php index 3ebbb46..3168c7b 100644 --- a/tests/AuthnetJsonReportingTest.php +++ b/tests/AuthnetJsonReportingTest.php @@ -22,7 +22,7 @@ class AuthnetJsonReportingTest extends TestCase private $server; private $http; - protected function setUp() + protected function setUp() : void { $this->login = 'test'; $this->transactionKey = 'test'; @@ -40,7 +40,7 @@ protected function setUp() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetUnsettledTransactionListRequestSuccess() + public function testGetUnsettledTransactionListRequestSuccess() : void { $responseJson = '{ "transactions":[ @@ -158,7 +158,7 @@ public function testGetUnsettledTransactionListRequestSuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetTransactionListRequestSuccess() + public function testGetTransactionListRequestSuccess() : void { $requestJson = array( 'batchId' => '1221577' @@ -223,7 +223,7 @@ public function testGetTransactionListRequestSuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetSettledBatchListRequestSuccess() + public function testGetSettledBatchListRequestSuccess() : void { $requestJson = array( 'includeStatistics' => 'true', @@ -398,7 +398,7 @@ public function testGetSettledBatchListRequestSuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetSettledBatchListRequestNoRecords() + public function testGetSettledBatchListRequestNoRecords() : void { $requestJson = array( 'includeStatistics' => 'true', @@ -434,7 +434,7 @@ public function testGetSettledBatchListRequestNoRecords() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetBatchStatisticsRequestSuccess() + public function testGetBatchStatisticsRequestSuccess() : void { $requestJson = array( 'batchId' => '1221577' @@ -531,7 +531,7 @@ public function testGetBatchStatisticsRequestSuccess() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetBatchStatisticsRequestNoRecords() + public function testGetBatchStatisticsRequestNoRecords() : void { $requestJson = array( 'batchId' => '999999999' @@ -565,7 +565,7 @@ public function testGetBatchStatisticsRequestNoRecords() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL */ - public function testGetTransactionDetailsRequestSuccess() + public function testGetTransactionDetailsRequestSuccess() : void { $requestJson = array( 'transId' => '2162566217' diff --git a/tests/AuthnetJsonRequestTest.php b/tests/AuthnetJsonRequestTest.php index 4dd8a7d..58cdebc 100644 --- a/tests/AuthnetJsonRequestTest.php +++ b/tests/AuthnetJsonRequestTest.php @@ -20,7 +20,7 @@ class AuthnetJsonRequestTest extends TestCase /** * @covers \JohnConde\Authnet\AuthnetJsonRequest::__construct() */ - public function testConstructor() + public function testConstructor() : void { $apiLogin = 'apiLogin'; $apiTransKey = 'apiTransKey'; @@ -40,10 +40,12 @@ public function testConstructor() /** * @covers \JohnConde\Authnet\AuthnetJsonRequest::__set() - * @expectedException \JohnConde\Authnet\AuthnetCannotSetParamsException + * @covers \JohnConde\Authnet\AuthnetCannotSetParamsException::__construct() */ - public function testExceptionIsRaisedForCannotSetParamsException() + public function testExceptionIsRaisedForCannotSetParamsException() : void { + $this->expectException('\JohnConde\Authnet\AuthnetCannotSetParamsException'); + $request = new AuthnetJsonRequest('', '', AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $request->login = 'test'; } @@ -51,12 +53,14 @@ public function testExceptionIsRaisedForCannotSetParamsException() /** * @covers \JohnConde\Authnet\AuthnetJsonRequest::process() + * @covers \JohnConde\Authnet\AuthnetCurlException::__construct() * @uses \JohnConde\Authnet\AuthnetApiFactory::getJsonApiHandler * @uses \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL - * @expectedException \JohnConde\Authnet\AuthnetCurlException */ - public function testExceptionIsRaisedForInvalidJsonException() + public function testExceptionIsRaisedForInvalidJsonException() : void { + $this->expectException('\JohnConde\Authnet\AuthnetCurlException'); + $requestJson = array( 'customerProfileId' => '123456789' ); @@ -75,7 +79,7 @@ public function testExceptionIsRaisedForInvalidJsonException() /** * @covers \JohnConde\Authnet\AuthnetJsonRequest::setProcessHandler() */ - public function testProcessorIsInstanceOfCurlWrapper() + public function testProcessorIsInstanceOfCurlWrapper() : void { $request = new AuthnetJsonRequest('', '', AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $request->setProcessHandler(new \Curl\Curl()); @@ -92,7 +96,7 @@ public function testProcessorIsInstanceOfCurlWrapper() * @covers \JohnConde\Authnet\AuthnetJsonRequest::__toString() * @covers \JohnConde\Authnet\AuthnetJsonRequest::__call() */ - public function testToString() + public function testToString() : void { $requestJson = array( 'refId' => '94564789', @@ -260,14 +264,14 @@ public function testToString() echo $request; $string = ob_get_clean(); - $this->assertContains($apiLogin, $string); - $this->assertContains($apiTransKey, $string); + $this->assertStringContainsString($apiLogin, $string); + $this->assertStringContainsString($apiTransKey, $string); } /** * @covers \JohnConde\Authnet\AuthnetJsonRequest::getRawRequest() */ - public function testGetRawRequest() + public function testGetRawRequest() : void { $requestJson = array( 'refId' => '94564789', @@ -303,10 +307,12 @@ public function testGetRawRequest() /** * @covers \JohnConde\Authnet\AuthnetJsonRequest::process() - * @expectedException \JohnConde\Authnet\AuthnetCurlException + * @covers \JohnConde\Authnet\AuthnetCurlException::__construct() */ - public function testProcessError() + public function testProcessError() : void { + $this->expectException('\JohnConde\Authnet\AuthnetCurlException'); + $apiLogin = 'apiLogin'; $apiTransKey = 'apiTransKey'; diff --git a/tests/AuthnetJsonResponseTest.php b/tests/AuthnetJsonResponseTest.php index 6810a05..e256d26 100644 --- a/tests/AuthnetJsonResponseTest.php +++ b/tests/AuthnetJsonResponseTest.php @@ -17,20 +17,24 @@ class AuthnetJsonResponseTest extends TestCase { /** * @covers \JohnConde\Authnet\AuthnetJsonRequest::__set() - * @expectedException \JohnConde\Authnet\AuthnetCannotSetParamsException + * @covers \JohnConde\Authnet\AuthnetCannotSetParamsException::__construct() */ - public function testExceptionIsRaisedForCannotSetParamsException() + public function testExceptionIsRaisedForCannotSetParamsException() : void { + $this->expectException('\JohnConde\Authnet\AuthnetCannotSetParamsException'); + $request = new AuthnetJsonRequest('', '', AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $request->login = 'test'; } /** * @covers \JohnConde\Authnet\AuthnetJsonResponse::__construct() - * @expectedException \JohnConde\Authnet\AuthnetInvalidJsonException + * @covers \JohnConde\Authnet\AuthnetInvalidJsonException::__construct() */ - public function testExceptionIsRaisedForInvalidJsonException() + public function testExceptionIsRaisedForInvalidJsonException() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidJsonException'); + $responseJson = 'I am invalid'; new AuthnetJsonResponse($responseJson); } @@ -39,7 +43,7 @@ public function testExceptionIsRaisedForInvalidJsonException() * @covers \JohnConde\Authnet\AuthnetJsonResponse::isSuccessful() * @covers \JohnConde\Authnet\AuthnetJsonResponse::isError() */ - public function testSuccessfulApiCall() + public function testSuccessfulApiCall() : void { $responseJson = '{ "messages":{ @@ -66,7 +70,7 @@ public function testSuccessfulApiCall() * @covers \JohnConde\Authnet\AuthnetJsonResponse::isSuccessful() * @covers \JohnConde\Authnet\AuthnetJsonResponse::isError() */ - public function testFailedApiCall() + public function testFailedApiCall() : void { $responseJson = '{ "messages":{ @@ -93,7 +97,7 @@ public function testFailedApiCall() * @covers \JohnConde\Authnet\AuthnetJsonResponse::getTransactionResponseField() * @covers \JohnConde\Authnet\TransactionResponse::getTransactionResponseField() */ - public function testTransactionResponse() + public function testTransactionResponse() : void { $responseJson = '{ "directResponse":"1,1,1,This transaction has been approved.,902R0T,Y,2230582306,INV000001,description of transaction,10.95,CC,auth_capture,12345,John,Smith,,123 Main Street,Townsville,NJ,12345,,800-555-1234,,user@example.com,John,Smith,,123 Main Street,Townsville,NJ,12345,,1.00,,2.00,FALSE,PONUM000001,D3B20D6194B0E86C03A18987300E781C,P,2,,,,,,,,,,,XXXX1111,Visa,,,,,,,,,,,,,,,,,29366174", @@ -117,7 +121,7 @@ public function testTransactionResponse() /** * @covers \JohnConde\Authnet\AuthnetJsonResponse::isApproved() */ - public function testIsApproved() + public function testIsApproved() : void { $responseJson = '{ "customerPaymentProfileId":"28821903", @@ -143,7 +147,7 @@ public function testIsApproved() /** * @covers \JohnConde\Authnet\AuthnetJsonResponse::isDeclined() */ - public function testIsDeclined() + public function testIsDeclined() : void { $responseJson = '{ "customerPaymentProfileId":"28821903", @@ -169,7 +173,7 @@ public function testIsDeclined() /** * @covers \JohnConde\Authnet\AuthnetJsonResponse::__toString() */ - public function testToString() + public function testToString() : void { $responseJson = '{ "customerPaymentProfileId":"28821903", @@ -191,16 +195,16 @@ public function testToString() echo $response; $string = ob_get_clean(); - $this->assertContains('validationDirectResponse":"2,2,205,This transaction has been declined,902R0T,Y,2230582306,INV000001,description of transaction,10.95,CC,auth_capture,12345,John,Smith,Company Name,123 Main Street,Townsville,NJ,12345,United States,800-555-1234,800-555-1235,user@example.com,John,Smith,Other Company Name,123 Main Street,Townsville,NJ,12345,United States,1.00,2.00,3.00,FALSE,PONUM000001,D3B20D6194B0E86C03A18987300E781C,P,2,,,,,,,,,,,XXXX1111,Visa,,,,,,,,,,,,,,,,,29366174', $string); - $this->assertContains('28821903', $string); - $this->assertContains('I00001', $string); - $this->assertContains('Successful', $string); + $this->assertStringContainsString('validationDirectResponse":"2,2,205,This transaction has been declined,902R0T,Y,2230582306,INV000001,description of transaction,10.95,CC,auth_capture,12345,John,Smith,Company Name,123 Main Street,Townsville,NJ,12345,United States,800-555-1234,800-555-1235,user@example.com,John,Smith,Other Company Name,123 Main Street,Townsville,NJ,12345,United States,1.00,2.00,3.00,FALSE,PONUM000001,D3B20D6194B0E86C03A18987300E781C,P,2,,,,,,,,,,,XXXX1111,Visa,,,,,,,,,,,,,,,,,29366174', $string); + $this->assertStringContainsString('28821903', $string); + $this->assertStringContainsString('I00001', $string); + $this->assertStringContainsString('Successful', $string); } /** * @covers \JohnConde\Authnet\AuthnetJsonResponse::getRawResponse() */ - public function testGetRawResponse() + public function testGetRawResponse() : void { $responseJson = '{ "customerPaymentProfileId":"28821903", @@ -225,7 +229,7 @@ public function testGetRawResponse() /** * @covers \JohnConde\Authnet\AuthnetJsonResponse::__get() */ - public function testGet() + public function testGet() : void { $responseJson = '{ "customerPaymentProfileId":"28821903", @@ -246,12 +250,13 @@ public function testGet() $this->assertEquals(28821903, $response->customerPaymentProfileId); } - /** - * @expectedException \JohnConde\Authnet\AuthnetTransactionResponseCallException + * @covers \JohnConde\Authnet\AuthnetTransactionResponseCallException::__construct() */ - public function testExceptionIsRaisedForTransactionResponseCall() + public function testExceptionIsRaisedForTransactionResponseCall() : void { + $this->expectException('\JohnConde\Authnet\AuthnetTransactionResponseCallException'); + $responseJson = '{ "refId":"2241729", "messages":{ @@ -272,7 +277,7 @@ public function testExceptionIsRaisedForTransactionResponseCall() /** * @covers \JohnConde\Authnet\AuthnetJsonResponse::checkTransactionStatus() */ - public function testCheckTransactionStatusCim() + public function testCheckTransactionStatusCim() : void { $responseJson = '{ "customerPaymentProfileId":"28821903", @@ -299,7 +304,7 @@ public function testCheckTransactionStatusCim() /** * @covers \JohnConde\Authnet\AuthnetJsonResponse::checkTransactionStatus() */ - public function testCheckTransactionStatusAim() + public function testCheckTransactionStatusAim() : void { $responseJson = '{ "transactionResponse":{ @@ -351,7 +356,7 @@ public function testCheckTransactionStatusAim() * @covers \JohnConde\Authnet\AuthnetJsonResponse::getErrorText() * @covers \JohnConde\Authnet\AuthnetJsonResponse::getErrorCode() */ - public function testGetErrorMethods() + public function testGetErrorMethods() : void { $responseJson = '{ "messages":{ @@ -377,7 +382,7 @@ public function testGetErrorMethods() * @covers \JohnConde\Authnet\AuthnetJsonResponse::getErrorCode() * @covers \JohnConde\Authnet\AuthnetJsonResponse::getError() */ - public function testGetErrorTextAim() + public function testGetErrorTextAim() : void { $responseJson = '{ "transactionResponse":{ @@ -428,7 +433,7 @@ public function testGetErrorTextAim() * @covers \JohnConde\Authnet\AuthnetJsonResponse::getErrorMessage() * @covers \JohnConde\Authnet\AuthnetJsonResponse::getError() */ - public function testGetErrorMessage() + public function testGetErrorMessage() : void { $responseJson = '{ "messages":{ diff --git a/tests/AuthnetSimTest.php b/tests/AuthnetSimTest.php index b6f1252..07b8b17 100644 --- a/tests/AuthnetSimTest.php +++ b/tests/AuthnetSimTest.php @@ -20,7 +20,7 @@ class AuthnetJsonSimTest extends TestCase private $signature; private $server; - protected function setUp() + protected function setUp() : void { $this->login = 'test'; $this->transactionKey = 'test'; @@ -31,7 +31,7 @@ protected function setUp() /** * @covers \JohnConde\Authnet\AuthnetSim::__construct() */ - public function testConstructor() + public function testConstructor() : void { $request = AuthnetApiFactory::getSimHandler($this->login, $this->signature, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); @@ -48,7 +48,7 @@ public function testConstructor() /** * @covers \JohnConde\Authnet\AuthnetSim::getFingerprint() */ - public function testGetFingerprint() + public function testGetFingerprint() : void { $amount = 9.01; @@ -67,10 +67,12 @@ public function testGetFingerprint() /** * @covers \JohnConde\Authnet\AuthnetSim::getFingerprint() - * @expectedException \JohnConde\Authnet\AuthnetInvalidAmountException + * @covers \JohnConde\Authnet\AuthnetInvalidAmountException::__construct() */ - public function testGetFingerprintException() + public function testGetFingerprintException() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidAmountException'); + $amount = 0; $sim = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $this->server); $hash = $sim->getFingerprint($amount); @@ -79,7 +81,7 @@ public function testGetFingerprintException() /** * @covers \JohnConde\Authnet\AuthnetSim::getSequence() */ - public function testGetSequence() + public function testGetSequence() : void { $sim = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $this->server); $sequence = $sim->getSequence(); @@ -94,7 +96,7 @@ public function testGetSequence() /** * @covers \JohnConde\Authnet\AuthnetSim::getTimestamp() */ - public function testGetTimestamp() + public function testGetTimestamp() : void { $sim = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $this->server); $timestamp = $sim->getTimestamp(); @@ -109,7 +111,7 @@ public function testGetTimestamp() /** * @covers \JohnConde\Authnet\AuthnetSim::getLogin() */ - public function testGetLogin() + public function testGetLogin() : void { $sim = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $this->server); $login = $sim->getLogin(); @@ -124,7 +126,7 @@ public function testGetLogin() /** * @covers \JohnConde\Authnet\AuthnetSim::getEndpoint() */ - public function testGetEndpoint() + public function testGetEndpoint() : void { $sim = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $this->server); $url = $sim->getEndpoint(); @@ -139,11 +141,10 @@ public function testGetEndpoint() /** * @covers \JohnConde\Authnet\AuthnetSim::resetParameters() */ - public function testResetParameters() + public function testResetParameters() : void { $sim = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $this->server); - $sequence = $sim->getSequence(); $timestamp = $sim->getTimestamp(); sleep(1); $sim->resetParameters(); diff --git a/tests/AuthnetWebhookTest.php b/tests/AuthnetWebhookTest.php index 0487c40..5a27ff7 100644 --- a/tests/AuthnetWebhookTest.php +++ b/tests/AuthnetWebhookTest.php @@ -18,7 +18,7 @@ class AuthnetWebhookTest extends TestCase /** * @covers \JohnConde\Authnet\AuthnetWebhook::__construct() */ - public function testConstructor() + public function testConstructor() : void { $signatureKey = '52CB4A002C634B84E397DC8A218E1A160BA7CAB7CBE4C05B35E9CBB05E14FE4A2385812E980CCF97D177F17863CE214D1BE6CE8E1E894487AACF3609C1A5FE17'; $webhookJson = '{"notificationId":"182cbbff-cab2-4080-931d-80e5d818f23a","eventType":"net.authorize.payment.authcapture.created","eventDate":"2017-08-18T20:40:52.7722007Z","webhookId":"849eb87e-078a-4169-a34b-c0bded5019a8","payload":{"responseCode":0,"authCode":"Z3PV5H","avsResponse":"Y","authAmount":0.0,"entityName":"transaction","id":"40005915599"}}'; @@ -38,26 +38,28 @@ public function testConstructor() /** * @covers \JohnConde\Authnet\AuthnetWebhook::__construct() - * @expectedException \JohnConde\Authnet\AuthnetInvalidCredentialsException + * @covers \JohnConde\Authnet\AuthnetInvalidCredentialsException::__construct() */ - public function testExceptionIsRaisedForNoSignature() + public function testExceptionIsRaisedForNoSignature() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException'); new AuthnetWebhook('', 'Not JSON', []); } /** * @covers \JohnConde\Authnet\AuthnetWebhook::__construct() - * @expectedException \JohnConde\Authnet\AuthnetInvalidJsonException + * @covers \JohnConde\Authnet\AuthnetInvalidJsonException::__construct() */ - public function testExceptionIsRaisedForCannotSetParamsException() + public function testExceptionIsRaisedForCannotSetParamsException() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidJsonException'); new AuthnetWebhook('a', 'Not JSON', []); } /** * @covers \JohnConde\Authnet\AuthnetWebhook::__toString() */ - public function testToString() + public function testToString() : void { $signatureKey = '52CB4A002C634B84E397DC8A218E1A160BA7CAB7CBE4C05B35E9CBB05E14FE4A2385812E980CCF97D177F17863CE214D1BE6CE8E1E894487AACF3609C1A5FE17'; $webhookJson = '{"notificationId":"182cbbff-cab2-4080-931d-80e5d818f23a","eventType":"net.authorize.payment.authcapture.created","eventDate":"2017-08-18T20:40:52.7722007Z","webhookId":"849eb87e-078a-4169-a34b-c0bded5019a8","payload":{"responseCode":0,"authCode":"Z3PV5H","avsResponse":"Y","authAmount":0.0,"entityName":"transaction","id":"40005915599"}}'; @@ -72,14 +74,14 @@ public function testToString() echo $webhook; $string = ob_get_clean(); - $this->assertContains('{"notificationId":"182cbbff-cab2-4080-931d-80e5d818f23a",', $string); - $this->assertContains('ae3b39b1-c58e-4a78-859b-1b4e6c62c5b7', $string); + $this->assertStringContainsString('{"notificationId":"182cbbff-cab2-4080-931d-80e5d818f23a",', $string); + $this->assertStringContainsString('ae3b39b1-c58e-4a78-859b-1b4e6c62c5b7', $string); } /** * @covers \JohnConde\Authnet\AuthnetWebhook::__get() */ - public function testGet() + public function testGet() : void { $signatureKey = '52CB4A002C634B84E397DC8A218E1A160BA7CAB7CBE4C05B35E9CBB05E14FE4A2385812E980CCF97D177F17863CE214D1BE6CE8E1E894487AACF3609C1A5FE17'; $webhookJson = '{"notificationId":"182cbbff-cab2-4080-931d-80e5d818f23a","eventType":"net.authorize.payment.authcapture.created","eventDate":"2017-08-18T20:40:52.7722007Z","webhookId":"849eb87e-078a-4169-a34b-c0bded5019a8","payload":{"responseCode":0,"authCode":"Z3PV5H","avsResponse":"Y","authAmount":0.0,"entityName":"transaction","id":"40005915599"}}'; @@ -96,7 +98,7 @@ public function testGet() /** * @covers \JohnConde\Authnet\AuthnetWebhook::isValid() */ - public function testIsValidCamelCase() + public function testIsValidCamelCase() : void { $signatureKey = '52CB4A002C634B84E397DC8A218E1A160BA7CAB7CBE4C05B35E9CBB05E14FE4A2385812E980CCF97D177F17863CE214D1BE6CE8E1E894487AACF3609C1A5FE17'; $webhookJson = '{"notificationId":"182cbbff-cab2-4080-931d-80e5d818f23a","eventType":"net.authorize.payment.authcapture.created","eventDate":"2017-08-18T20:40:52.7722007Z","webhookId":"849eb87e-078a-4169-a34b-c0bded5019a8","payload":{"responseCode":0,"authCode":"Z3PV5H","avsResponse":"Y","authAmount":0.0,"entityName":"transaction","id":"40005915599"}}'; @@ -112,7 +114,7 @@ public function testIsValidCamelCase() /** * @covers \JohnConde\Authnet\AuthnetWebhook::isValid() */ - public function testIsValidUpperCase() + public function testIsValidUpperCase() : void { $signatureKey = '52CB4A002C634B84E397DC8A218E1A160BA7CAB7CBE4C05B35E9CBB05E14FE4A2385812E980CCF97D177F17863CE214D1BE6CE8E1E894487AACF3609C1A5FE17'; $webhookJson = '{"notificationId":"182cbbff-cab2-4080-931d-80e5d818f23a","eventType":"net.authorize.payment.authcapture.created","eventDate":"2017-08-18T20:40:52.7722007Z","webhookId":"849eb87e-078a-4169-a34b-c0bded5019a8","payload":{"responseCode":0,"authCode":"Z3PV5H","avsResponse":"Y","authAmount":0.0,"entityName":"transaction","id":"40005915599"}}'; @@ -128,7 +130,7 @@ public function testIsValidUpperCase() /** * @covers \JohnConde\Authnet\AuthnetWebhook::isValid() */ - public function testIsValidFailure() + public function testIsValidFailure() : void { $signatureKey = '52CB4A002C634B84E397DC8A218E1A160BA7CAB7CBE4C05B35E9CBB05E14FE4A2385812E980CCF97D177F17863CE214D1BE6CE8E1E894487AACF3609C1A5FE17'; $webhookJson = '{"notificationId":"182cbbff-cab2-4080-931d-80e5d818f23a","eventType":"net.authorize.payment.authcapture.created","eventDate":"2017-08-18T20:40:52.7722007Z","webhookId":"849eb87e-078a-4169-a34b-c0bded5019a8","payload":{"responseCode":0,"authCode":"Z3PV5H","avsResponse":"Y","authAmount":0.0,"entityName":"transaction","id":"40005915599"}}'; @@ -144,7 +146,7 @@ public function testIsValidFailure() /** * @covers \JohnConde\Authnet\AuthnetWebhook::getRequestId() */ - public function testGetRequestId() + public function testGetRequestId() : void { $signatureKey = '52CB4A002C634B84E397DC8A218E1A160BA7CAB7CBE4C05B35E9CBB05E14FE4A2385812E980CCF97D177F17863CE214D1BE6CE8E1E894487AACF3609C1A5FE17'; $webhookJson = '{"notificationId":"182cbbff-cab2-4080-931d-80e5d818f23a","eventType":"net.authorize.payment.authcapture.created","eventDate":"2017-08-18T20:40:52.7722007Z","webhookId":"849eb87e-078a-4169-a34b-c0bded5019a8","payload":{"responseCode":0,"authCode":"Z3PV5H","avsResponse":"Y","authAmount":0.0,"entityName":"transaction","id":"40005915599"}}'; @@ -161,7 +163,7 @@ public function testGetRequestId() /** * @covers \JohnConde\Authnet\AuthnetWebhook::getAllHeaders() */ - public function testGetAllHeaders() + public function testGetAllHeaders() : void { $_SERVER += [ 'HTTP_TEST' => 'test' diff --git a/tests/AuthnetWebhooksRequestTest.php b/tests/AuthnetWebhooksRequestTest.php index 2a50f27..e01999d 100644 --- a/tests/AuthnetWebhooksRequestTest.php +++ b/tests/AuthnetWebhooksRequestTest.php @@ -22,7 +22,7 @@ class AuthnetWebhooksRequestTest extends TestCase private $server; private $http; - protected function setUp() + protected function setUp() : void { $this->login = 'test'; $this->transactionKey = 'test'; @@ -37,7 +37,7 @@ protected function setUp() /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::__construct() */ - public function testConstructor() + public function testConstructor() : void { $request = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); @@ -51,7 +51,7 @@ public function testConstructor() /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::__toString() */ - public function testToString() + public function testToString() : void { $this->http->error = false; $this->http->response = '[{ @@ -66,14 +66,14 @@ public function testToString() echo $request; $string = ob_get_clean(); - $this->assertContains('https://apitest.authorize.net/rest/v1/webhooks/871a6a11-b654-45af-b97d-da72a490d0fd', $string); - $this->assertContains('{"url":"http:\/\/www.example.com\/webhook","eventTypes":["net.authorize.customer.subscription.expiring"],"status":"inactive"}', $string); + $this->assertStringContainsString('https://apitest.authorize.net/rest/v1/webhooks/871a6a11-b654-45af-b97d-da72a490d0fd', $string); + $this->assertStringContainsString('{"url":"http:\/\/www.example.com\/webhook","eventTypes":["net.authorize.customer.subscription.expiring"],"status":"inactive"}', $string); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::__toString() */ - public function testToStringNA() + public function testToStringNA() : void { $this->http->error = false; $this->http->response = '[{ @@ -88,14 +88,14 @@ public function testToStringNA() echo $request; $string = ob_get_clean(); - $this->assertContains('N/A', $string); + $this->assertStringContainsString('N/A', $string); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::getEventTypes() * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::getByUrl() */ - public function testGetEventTypes() + public function testGetEventTypes() : void { $this->http->error = false; $this->http->response = $responseJson = '[ @@ -168,13 +168,13 @@ public function testGetEventTypes() $request->setProcessHandler($this->http); $response = $request->getEventTypes(); - $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response); + $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::createWebhooks() */ - public function testCreateWebhooks() + public function testCreateWebhooks() : void { $this->http->error = false; $this->http->response = '{ @@ -202,13 +202,13 @@ public function testCreateWebhooks() 'net.authorize.customer.subscription.expiring' ], 'http://requestb.in/', 'active'); - $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response); + $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::testWebhook() */ - public function testTestWebhook() + public function testTestWebhook() : void { $this->http->error = false; $this->http->response = ''; @@ -223,7 +223,7 @@ public function testTestWebhook() /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::deleteWebhook() */ - public function testDeleteWebhook() + public function testDeleteWebhook() : void { $this->http->error = false; $this->http->response = ''; @@ -239,7 +239,7 @@ public function testDeleteWebhook() * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::getWebhooks() * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::getByUrl() */ - public function testGetWebhooks() + public function testGetWebhooks() : void { $this->http->error = false; $this->http->response = '[{ @@ -293,14 +293,14 @@ public function testGetWebhooks() $request->setProcessHandler($this->http); $response = $request->getWebhooks(); - $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response); + $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::getWebhook() * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::getByUrl() */ - public function testGetWebhook() + public function testGetWebhook() : void { $this->http->error = false; $this->http->response = '{ @@ -324,13 +324,13 @@ public function testGetWebhook() $request->setProcessHandler($this->http); $response = $request->getWebhook('cd2c262f-2723-4848-ae92-5d317902441c'); - $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response); + $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::updateWebhook() */ - public function testUpdateWebhook() + public function testUpdateWebhook() : void { $this->http->error = false; $this->http->response = '{ @@ -353,13 +353,13 @@ public function testUpdateWebhook() 'net.authorize.customer.created' ], 'active'); - $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response); + $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::getNotificationHistory() */ - public function testGetNotificationHistory() + public function testGetNotificationHistory() : void { $this->http->error = false; $this->http->response = '{ @@ -387,13 +387,13 @@ public function testGetNotificationHistory() $request->setProcessHandler($this->http); $response = $request->getNotificationHistory(); - $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response); + $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::handleResponse() */ - public function testHandleResponse() + public function testHandleResponse() : void { $this->http->error = false; $this->http->response = '{"error"}'; @@ -411,10 +411,12 @@ public function testHandleResponse() /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::handleResponse() - * @expectedException \JohnConde\Authnet\AuthnetCurlException + * @covers \JohnConde\Authnet\AuthnetCurlException::__construct() */ - public function testHandleResponseWithErrorMessage() + public function testHandleResponseWithErrorMessage() : void { + $this->expectException('\JohnConde\Authnet\AuthnetCurlException'); + $this->http->error = true; $this->http->error_message = 'Error Message'; $this->http->error_code = 100; @@ -431,10 +433,12 @@ public function testHandleResponseWithErrorMessage() /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::handleResponse() - * @expectedException \JohnConde\Authnet\AuthnetCurlException + * @covers \JohnConde\Authnet\AuthnetCurlException::__construct() */ - public function testHandleResponseWithErrorMessageTestMessage() + public function testHandleResponseWithErrorMessageTestMessage() : void { + $this->expectException('\JohnConde\Authnet\AuthnetCurlException'); + $this->http->error = true; $this->http->error_message = 'Error Message'; $this->http->error_code = 100; @@ -456,10 +460,12 @@ public function testHandleResponseWithErrorMessageTestMessage() /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::handleResponse() - * @expectedException \JohnConde\Authnet\AuthnetCurlException + * @covers \JohnConde\Authnet\AuthnetCurlException::__construct() */ - public function testHandleResponseWithErrorMessageNoMessage() + public function testHandleResponseWithErrorMessageNoMessage() : void { + $this->expectException('\JohnConde\Authnet\AuthnetCurlException'); + $this->http->error = true; $this->http->error_code = 100; $this->http->response = json_encode([ @@ -486,7 +492,7 @@ public function testHandleResponseWithErrorMessageNoMessage() /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::setProcessHandler() */ - public function testProcessorIsInstanceOfCurlWrapper() + public function testProcessorIsInstanceOfCurlWrapper() : void { $request = new AuthnetWebhooksRequest(null, null, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $request->setProcessHandler(new \Curl\Curl()); @@ -501,7 +507,7 @@ public function testProcessorIsInstanceOfCurlWrapper() /** * @covers \JohnConde\Authnet\AuthnetWebhooksRequest::getRawRequest() */ - public function testGetRawRequest() + public function testGetRawRequest() : void { $this->http->response = $responseJson = '[{ "name": "test" diff --git a/tests/AuthnetWebhooksResponseTest.php b/tests/AuthnetWebhooksResponseTest.php index 9ea1659..1d5444c 100644 --- a/tests/AuthnetWebhooksResponseTest.php +++ b/tests/AuthnetWebhooksResponseTest.php @@ -17,17 +17,18 @@ class AuthnetWebhooksResponseTest extends TestCase { /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::__construct() - * @expectedException \JohnConde\Authnet\AuthnetInvalidJsonException + * @covers \JohnConde\Authnet\AuthnetInvalidJsonException::__construct() */ - public function testExceptionIsRaisedForInvalidJsonException() + public function testExceptionIsRaisedForInvalidJsonException() : void { + $this->expectException('\JohnConde\Authnet\AuthnetInvalidJsonException'); new AuthnetWebhooksResponse(''); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::__construct() */ - public function testConstruct() + public function testConstruct() : void { $responseJson = '{ "url": "http://example.com", @@ -48,7 +49,7 @@ public function testConstruct() /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::__toString() */ - public function testToString() + public function testToString() : void { $responseJson = '{ "url": "http://example.com", @@ -64,15 +65,15 @@ public function testToString() echo $response; $string = ob_get_clean(); - $this->assertContains('example.com', $string); - $this->assertContains('net.authorize.payment.authorization.created', $string); - $this->assertContains('active', $string); + $this->assertStringContainsString('example.com', $string); + $this->assertStringContainsString('net.authorize.payment.authorization.created', $string); + $this->assertStringContainsString('active', $string); } /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::getEventTypes() */ - public function testGetEventTypes() + public function testGetEventTypes() : void { $responseJson = '[{ "name": "net.authorize.payment.authcapture.created" @@ -93,7 +94,7 @@ public function testGetEventTypes() /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::getEventTypes() */ - public function testGetEventTypesFromWebhooks() + public function testGetEventTypesFromWebhooks() : void { $responseJson = '{ "_links": { @@ -124,7 +125,7 @@ public function testGetEventTypesFromWebhooks() /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::getWebhooksId() */ - public function testGetWebhooksId() + public function testGetWebhooksId() : void { $responseJson = '{ "_links": { @@ -151,7 +152,7 @@ public function testGetWebhooksId() /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::getStatus() */ - public function testGetStatus() + public function testGetStatus() : void { $responseJson = '{ "_links": { @@ -178,7 +179,7 @@ public function testGetStatus() /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::getUrl() */ - public function testGetUrl() + public function testGetUrl() : void { $responseJson = '{ "_links": { @@ -205,7 +206,7 @@ public function testGetUrl() /** * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::getWebhooks() */ - public function testGetWebhooks() + public function testGetWebhooks() : void { $responseJson = '[{ "_links": { @@ -271,7 +272,7 @@ public function testGetWebhooks() * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::getEventType() * @covers \JohnConde\Authnet\AuthnetWebhooksResponse::getEventDate() */ - public function testGetNotificationHistory() + public function testGetNotificationHistory() : void { $responseJson = '{ "_links": { diff --git a/tests/TransactionResponseTest.php b/tests/TransactionResponseTest.php index 30ac7cd..8233658 100644 --- a/tests/TransactionResponseTest.php +++ b/tests/TransactionResponseTest.php @@ -20,7 +20,7 @@ class TransactionResponseTest extends TestCase * @covers \JohnConde\Authnet\TransactionResponse::getTransactionResponseField() * @covers \JohnConde\Authnet\AuthnetJsonResponse::getTransactionResponseField() */ - public function testTransactionResponse() + public function testTransactionResponse() : void { $transactionIfo = '1,1,1,This transaction has been approved.,902R0T,Y,2230582306,INV000001,description of transaction,10.95,CC,auth_capture,12345,John,Smith,Company Name,123 Main Street,Townsville,NJ,12345,United States,800-555-1234,800-555-1235,user@example.com,John,Smith,Other Company Name,123 Main Street,Townsville,NJ,12345,United States,1.00,2.00,3.00,FALSE,PONUM000001,D3B20D6194B0E86C03A18987300E781C,P,2,,,,,,,,,,,XXXX1111,Visa,,,,,,,,,,,,,,,,,29366174'; @@ -117,7 +117,7 @@ public function testTransactionResponse() * @covers \JohnConde\Authnet\TransactionResponse::getTransactionResponseField() * @covers \JohnConde\Authnet\AuthnetJsonResponse::__construct() */ - public function testDirectResponse() + public function testDirectResponse() : void { $responseJson = '{ "directResponse":"1,1,1,This transaction has been approved.,902R0T,Y,2230582306,INV000001,description of transaction,10.95,CC,auth_capture,12345,John,Smith,Company Name,123 Main Street,Townsville,NJ,12345,United States,800-555-1234,800-555-1235,user@example.com,John,Smith,Other Company Name,123 Main Street,Townsville,NJ,12345,United States,1.00,2.00,3.00,FALSE,PONUM000001,D3B20D6194B0E86C03A18987300E781C,P,2,,,,,,,,,,,XXXX1111,Visa,,,,,,,,,,,,,,,,,29366174", @@ -182,7 +182,7 @@ public function testDirectResponse() * @covers \JohnConde\Authnet\TransactionResponse::getTransactionResponseField() * @covers \JohnConde\Authnet\AuthnetJsonResponse::__construct() */ - public function testValidationDirectResponse() + public function testValidationDirectResponse() : void { $responseJson = '{ "customerPaymentProfileId":"28821903", From 58431f2b5365c117e6e0ec05f01fc50d84310a78 Mon Sep 17 00:00:00 2001 From: John Conde Date: Sun, 5 May 2019 09:57:02 -0400 Subject: [PATCH 050/105] Added access modifier for class constants --- src/authnet/AuthnetApiFactory.php | 6 +++--- src/authnet/AuthnetJson.php | 2 +- src/authnet/AuthnetJsonResponse.php | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index 907f4d4..24a700f 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -30,17 +30,17 @@ class AuthnetApiFactory /** * @const Indicates use of Authorize.Net's production server */ - const USE_PRODUCTION_SERVER = 0; + public const USE_PRODUCTION_SERVER = 0; /** * @const Indicates use of the development server */ - const USE_DEVELOPMENT_SERVER = 1; + public const USE_DEVELOPMENT_SERVER = 1; /** * @const Indicates use of the Akamai endpoint */ - const USE_AKAMAI_SERVER = 2; + public const USE_AKAMAI_SERVER = 2; /** Validates the Authorize.Net credentials and returns a Request object to be used to make an API call diff --git a/src/authnet/AuthnetJson.php b/src/authnet/AuthnetJson.php index 754ea35..daec498 100644 --- a/src/authnet/AuthnetJson.php +++ b/src/authnet/AuthnetJson.php @@ -27,5 +27,5 @@ class AuthnetJson /** * @var int Subscription of endless length. */ - const BOUNDLESS_OCCURRENCES = 9999; + public const BOUNDLESS_OCCURRENCES = 9999; } diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php index 60bfb6d..205325c 100644 --- a/src/authnet/AuthnetJsonResponse.php +++ b/src/authnet/AuthnetJsonResponse.php @@ -66,27 +66,27 @@ class AuthnetJsonResponse /** * @const Indicates the status code of an approved transaction */ - const STATUS_APPROVED = 1; + public const STATUS_APPROVED = 1; /** * @const Indicates the status code of an declined transaction */ - const STATUS_DECLINED = 2; + public const STATUS_DECLINED = 2; /** * @const Indicates the status code of an transaction which has encountered an error */ - const STATUS_ERROR = 3; + public const STATUS_ERROR = 3; /** * @const Indicates the status code of a transaction held for review */ - const STATUS_HELD = 4; + public const STATUS_HELD = 4; /** * @const Indicates the status code of a transaction held for review */ - const STATUS_PAYPAL_NEED_CONSENT = 5; + public const STATUS_PAYPAL_NEED_CONSENT = 5; /** * @var object SimpleXML object representing the API response From 1b49439f20576e8eb08d4391ff8f9418bc5aad03 Mon Sep 17 00:00:00 2001 From: John Conde Date: Sun, 5 May 2019 10:47:14 -0400 Subject: [PATCH 051/105] Code clean up --- src/authnet/AuthnetApiFactory.php | 29 +++++------ src/authnet/AuthnetJsonRequest.php | 15 +++--- src/authnet/AuthnetJsonResponse.php | 14 +++--- src/authnet/AuthnetSim.php | 10 ++-- src/authnet/AuthnetWebhook.php | 13 ++--- src/authnet/AuthnetWebhooksRequest.php | 67 +++++++++++++------------ src/authnet/AuthnetWebhooksResponse.php | 11 ++-- src/authnet/TransactionResponse.php | 17 +++---- 8 files changed, 94 insertions(+), 82 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index 24a700f..ba3de15 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -13,6 +13,7 @@ namespace JohnConde\Authnet; use \Curl\Curl; +use \ErrorException; /** * Factory to instantiate an instance of an AuthnetJson object with the proper endpoint @@ -48,10 +49,10 @@ class AuthnetApiFactory * @param string $login Authorize.Net API Login ID * @param string $transaction_key Authorize.Net API Transaction Key * @param integer $server ID of which server to use (optional) - * @return \JohnConde\Authnet\AuthnetJsonRequest - * @throws \ErrorException - * @throws \JohnConde\Authnet\AuthnetInvalidCredentialsException - * @throws \JohnConde\Authnet\AuthnetInvalidServerException + * @return AuthnetJsonRequest + * @throws ErrorException + * @throws AuthnetInvalidCredentialsException + * @throws AuthnetInvalidServerException */ public static function getJsonApiHandler(string $login, string $transaction_key, ?int $server) : object { @@ -81,7 +82,7 @@ public static function getJsonApiHandler(string $login, string $transaction_key, * * @param integer $server ID of which server to use * @return string The URL endpoint the request is to be sent to - * @throws \JohnConde\Authnet\AuthnetInvalidServerException + * @throws AuthnetInvalidServerException */ protected static function getWebServiceURL(int $server) : string { @@ -102,9 +103,9 @@ protected static function getWebServiceURL(int $server) : string * @param string $login Authorize.Net API Login ID * @param string $transaction_key Authorize.Net API Transaction Key * @param integer $server ID of which server to use (optional) - * @return \JohnConde\Authnet\AuthnetSim - * @throws \JohnConde\Authnet\AuthnetInvalidCredentialsException - * @throws \JohnConde\Authnet\AuthnetInvalidServerException + * @return AuthnetSim + * @throws AuthnetInvalidCredentialsException + * @throws AuthnetInvalidServerException */ public static function getSimHandler(string $login, string $transaction_key, $server = self::USE_PRODUCTION_SERVER) : object { @@ -124,7 +125,7 @@ public static function getSimHandler(string $login, string $transaction_key, $se * * @param integer $server ID of which server to use * @return string The URL endpoint the request is to be sent to - * @throws \JohnConde\Authnet\AuthnetInvalidServerException + * @throws AuthnetInvalidServerException */ protected static function getSimURL(int $server) : string { @@ -144,10 +145,10 @@ protected static function getSimURL(int $server) : string * @param string $login Authorize.Net API Login ID * @param string $transaction_key Authorize.Net API Transaction Key * @param integer $server ID of which server to use (optional) - * @throws \ErrorException - * @return \JohnConde\Authnet\AuthnetWebhooksRequest - * @throws \JohnConde\Authnet\AuthnetInvalidCredentialsException - * @throws \JohnConde\Authnet\AuthnetInvalidServerException + * @throws ErrorException + * @return AuthnetWebhooksRequest + * @throws AuthnetInvalidCredentialsException + * @throws AuthnetInvalidServerException */ public static function getWebhooksHandler(string $login, string $transaction_key, $server = self::USE_PRODUCTION_SERVER) : object { @@ -179,7 +180,7 @@ public static function getWebhooksHandler(string $login, string $transaction_key * * @param integer $server ID of which server to use * @return string The URL endpoint the request is to be sent to - * @throws \JohnConde\Authnet\AuthnetInvalidServerException + * @throws AuthnetInvalidServerException */ protected static function getWebhooksURL(int $server) : string { diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php index db42eab..241668f 100644 --- a/src/authnet/AuthnetJsonRequest.php +++ b/src/authnet/AuthnetJsonRequest.php @@ -105,7 +105,8 @@ public function __construct(string $login, string $transactionKey, string $api_u */ public function __toString() { - $output = '
Response JSON
Webhook Response JSON
'."\n";
         $output .= $this->responseJson."\n";
         $output .= '
'."\n"; + $output = '
'."\n"; + $output .= ''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; @@ -126,7 +127,7 @@ public function __toString() * * @param string $name unused * @param mixed $value unused - * @throws \JohnConde\Authnet\AuthnetCannotSetParamsException + * @throws AuthnetCannotSetParamsException */ public function __set($name, $value) { @@ -139,9 +140,9 @@ public function __set($name, $value) * * @param string $api_call name of the API call to be made * @param array $args the array to be passed to the API - * @return \JohnConde\Authnet\AuthnetJsonResponse - * @throws \JohnConde\Authnet\AuthnetCurlException - * @throws \JohnConde\Authnet\AuthnetInvalidJsonException + * @return AuthnetJsonResponse + * @throws AuthnetCurlException + * @throws AuthnetInvalidJsonException */ public function __call($api_call, Array $args) { @@ -168,7 +169,7 @@ public function __call($api_call, Array $args) * Tells the handler to make the API call to Authorize.Net * * @return string JSON string containing API response - * @throws \JohnConde\Authnet\AuthnetCurlException + * @throws AuthnetCurlException */ private function process() : string { @@ -191,7 +192,7 @@ private function process() : string * * @param object $processor */ - public function setProcessHandler($processor) + public function setProcessHandler($processor) : void { $this->processor = $processor; } diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php index 205325c..2e24f9a 100644 --- a/src/authnet/AuthnetJsonResponse.php +++ b/src/authnet/AuthnetJsonResponse.php @@ -107,16 +107,15 @@ class AuthnetJsonResponse * Creates the response object with the response json returned from the API call * * @param string $responseJson Response from Authorize.Net - * @throws \JohnConde\Authnet\AuthnetInvalidJsonException + * @throws AuthnetInvalidJsonException */ public function __construct(string $responseJson) { $this->responseJson = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $responseJson); - if (($this->response = json_decode($this->responseJson)) === null) { + if (($this->response = json_decode($this->responseJson, false)) === null) { throw new AuthnetInvalidJsonException('Invalid JSON returned by the API'); } - $this->transactionInfo = null; if (@$this->directResponse || @$this->validationDirectResponse) { $dr = (@$this->directResponse) ? $this->directResponse : $this->validationDirectResponse; $this->transactionInfo = new TransactionResponse($dr); @@ -130,7 +129,8 @@ public function __construct(string $responseJson) */ public function __toString() { - $output = '
Authorize.Net Request
Class Parameters
API Login ID'.$this->login.'
Transaction Key'.$this->transactionKey.'
'."\n"; + $output = '
'."\n"; + $output .= ''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ' - + - + diff --git a/examples/cim/createCustomerProfileRequest.php b/examples/cim/createCustomerProfileRequest.php index e5f93de..037e7b8 100644 --- a/examples/cim/createCustomerProfileRequest.php +++ b/examples/cim/createCustomerProfileRequest.php @@ -147,11 +147,11 @@ - + - + diff --git a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php index 5a93c03..117ef9a 100644 --- a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php +++ b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php @@ -191,11 +191,11 @@ - + - + diff --git a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php index 3b62bfd..07ce654 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php +++ b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php @@ -156,11 +156,11 @@ - + - + diff --git a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php index 2ed985e..64f4857 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php +++ b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php @@ -156,11 +156,11 @@ - + - +
Authorize.Net Response
Response JSON
'."\n";
         $output .= $this->responseJson."\n";
@@ -200,9 +200,9 @@ public function isDeclined() : bool
     protected function checkTransactionStatus(int $status) : bool
     {
         if ($this->transactionInfo instanceof TransactionResponse) {
-            $match = $this->transactionInfo->getTransactionResponseField('ResponseCode') == $status;
+            $match = (int) $this->transactionInfo->getTransactionResponseField('ResponseCode') === $status;
         } else {
-            $match = $this->transactionResponse->responseCode == $status;
+            $match = (int) $this->transactionResponse->responseCode === $status;
         }
         return $match;
     }
@@ -212,7 +212,7 @@ protected function checkTransactionStatus(int $status) : bool
      *
      * @param   mixed  $field  Name or key of the transaction field to be retrieved
      * @return  string Transaction field to be retrieved
-     * @throws  \JohnConde\Authnet\AuthnetTransactionResponseCallException
+     * @throws  AuthnetTransactionResponseCallException
      */
     public function getTransactionResponseField($field) : string
     {
diff --git a/src/authnet/AuthnetSim.php b/src/authnet/AuthnetSim.php
index 8760783..f7b5a07 100644
--- a/src/authnet/AuthnetSim.php
+++ b/src/authnet/AuthnetSim.php
@@ -12,6 +12,8 @@
 
 namespace JohnConde\Authnet;
 
+use Exception;
+
 /**
  * Wrapper to simplify the creation of SIM data
  *
@@ -56,6 +58,7 @@ class AuthnetSim
      * @param   string  $login         Authorize.Net API login ID
      * @param   string  $signature     Authorize.Net API Transaction Key
      * @param   string  $api_url       URL endpoint for processing a transaction
+     * @throws  Exception
      */
     public function __construct($login, $signature, $api_url)
     {
@@ -70,7 +73,7 @@ public function __construct($login, $signature, $api_url)
      *
      * @param   float  $amount   The amount of the transaction
      * @return  string           Hash of five different unique transaction parameters
-     * @throws  \JohnConde\Authnet\AuthnetInvalidAmountException
+     * @throws  AuthnetInvalidAmountException
      */
     public function getFingerprint(float $amount) : string
     {
@@ -135,10 +138,11 @@ public function getEndpoint() : string
 
     /**
      * Resets the sequence and timestamp
+     * @throws Exception
      */
-    public function resetParameters()
+    public function resetParameters() : void
     {
-        $this->sequence  = rand(1, 1000);
+        $this->sequence  = random_int(1, 1000);
         $this->timestamp = time();
     }
 }
diff --git a/src/authnet/AuthnetWebhook.php b/src/authnet/AuthnetWebhook.php
index 2403d95..2325a65 100644
--- a/src/authnet/AuthnetWebhook.php
+++ b/src/authnet/AuthnetWebhook.php
@@ -50,8 +50,8 @@ class AuthnetWebhook
      * @param   string   $signature    Authorize.Net Signature Key
      * @param   string   $payload      Webhook Notification sent by Authorize.Net
      * @param   array    $headers      HTTP headers sent with Webhook. Optional if PHP is run as an Apache module
-     * @throws  \JohnConde\Authnet\AuthnetInvalidCredentialsException
-     * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
+     * @throws  AuthnetInvalidCredentialsException
+     * @throws  AuthnetInvalidJsonException
      */
     public function __construct(string $signature, string $payload, array $headers = [])
     {
@@ -64,7 +64,7 @@ public function __construct(string $signature, string $payload, array $headers =
         if (empty($this->signature)) {
             throw new AuthnetInvalidCredentialsException('You have not configured your signature properly.');
         }
-        if (($this->webhook = json_decode($this->webhookJson)) === null) {
+        if (($this->webhook = json_decode($this->webhookJson, false)) === null) {
             throw new AuthnetInvalidJsonException('Invalid JSON sent in the Webhook notification');
         }
         $this->headers = array_change_key_case($this->headers, CASE_UPPER);
@@ -77,7 +77,8 @@ public function __construct(string $signature, string $payload, array $headers =
      */
     public function __toString()
     {
-        $output  = ''."\n";
+        $output  = '
'."\n"; + $output .= ''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ' - + - + diff --git a/examples/arb/ARBGetSubscriptionStatusRequest.php b/examples/arb/ARBGetSubscriptionStatusRequest.php index b25a112..19f9b31 100644 --- a/examples/arb/ARBGetSubscriptionStatusRequest.php +++ b/examples/arb/ARBGetSubscriptionStatusRequest.php @@ -89,11 +89,11 @@ - + - + diff --git a/examples/arb/ARBUpdateSubscriptionRequest.php b/examples/arb/ARBUpdateSubscriptionRequest.php index a6ba41a..9d82e7b 100644 --- a/examples/arb/ARBUpdateSubscriptionRequest.php +++ b/examples/arb/ARBUpdateSubscriptionRequest.php @@ -100,11 +100,11 @@ - + - +
Authorize.Net Webhook
Response HTTP Headers
'."\n";
         $output .= var_export($this->headers)."\n";
@@ -121,7 +122,7 @@ public function isValid() : bool
      */
     public function getRequestId() : ?string
     {
-        return (isset($this->headers['X-REQUEST-ID'])) ? $this->headers['X-REQUEST-ID'] : null;
+        return $this->headers['X-REQUEST-ID'] ?? null;
     }
 
     /**
@@ -136,7 +137,7 @@ protected function getAllHeaders() : array
         } else {
             $headers = array_filter(
                 $_SERVER,
-                function ($key) {
+                static function ($key) {
                     return strpos($key, 'HTTP_') === 0;
                 },
                 ARRAY_FILTER_USE_KEY
diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php
index e0fd54e..d511119 100644
--- a/src/authnet/AuthnetWebhooksRequest.php
+++ b/src/authnet/AuthnetWebhooksRequest.php
@@ -12,6 +12,8 @@
 
 namespace JohnConde\Authnet;
 
+use \Curl\Curl;
+
 /**
  * Creates a request to the Authorize.Net Webhooks endpoints
  *
@@ -62,7 +64,8 @@ public function __construct($api_url)
      */
     public function __toString()
     {
-        $output  = ''."\n";
+        $output  = '
'."\n"; + $output .= ''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; @@ -84,9 +87,9 @@ public function __toString() * @param array $webhooks Array of webhooks to be created or modified * @param string $webhookUrl URL of where webhook notifications will be sent * @param string $status Status of webhooks to be created or modified [active/inactive] - * @return \JohnConde\Authnet\AuthnetWebhooksResponse - * @throws \JohnConde\Authnet\AuthnetInvalidJsonException - * @throws \JohnConde\Authnet\AuthnetCurlException + * @return AuthnetWebhooksResponse + * @throws AuthnetInvalidJsonException + * @throws AuthnetCurlException */ public function createWebhooks(array $webhooks, string $webhookUrl, string $status = 'active') : object { @@ -106,9 +109,9 @@ public function createWebhooks(array $webhooks, string $webhookUrl, string $stat * Sends a test ping to a URL for (a) designated webhook(s) * * @param string $webhookId Webhook ID to be tested - * @throws \JohnConde\Authnet\AuthnetCurlException + * @throws AuthnetCurlException */ - public function testWebhook(string $webhookId) + public function testWebhook(string $webhookId) : void { $this->endpoint = 'webhooks'; $this->url = sprintf('%s%s/%s/pings', $this->url, $this->endpoint, $webhookId); @@ -119,7 +122,9 @@ public function testWebhook(string $webhookId) /** * Gets all of the available event types * - * @return \JohnConde\Authnet\AuthnetWebhooksResponse + * @return AuthnetWebhooksResponse + * @throws AuthnetCurlException + * @throws AuthnetInvalidJsonException */ public function getEventTypes() : object { @@ -131,9 +136,9 @@ public function getEventTypes() : object /** * List all of your webhooks * - * @return \JohnConde\Authnet\AuthnetWebhooksResponse - * @throws \JohnConde\Authnet\AuthnetCurlException - * @throws \JohnConde\Authnet\AuthnetInvalidJsonException + * @return AuthnetWebhooksResponse + * @throws AuthnetCurlException + * @throws AuthnetInvalidJsonException */ public function getWebhooks() : object { @@ -146,9 +151,9 @@ public function getWebhooks() : object * Get a webhook * * @param string $webhookId Webhook ID to be retrieved - * @return \JohnConde\Authnet\AuthnetWebhooksResponse - * @throws \JohnConde\Authnet\AuthnetCurlException - * @throws \JohnConde\Authnet\AuthnetInvalidJsonException + * @return AuthnetWebhooksResponse + * @throws AuthnetCurlException + * @throws AuthnetInvalidJsonException */ public function getWebhook(string $webhookId) : object { @@ -162,8 +167,8 @@ public function getWebhook(string $webhookId) : object * * @param string $url API endpoint to hit * @return object - * @throws \JohnConde\Authnet\AuthnetCurlException - * @throws \JohnConde\Authnet\AuthnetInvalidJsonException + * @throws AuthnetCurlException + * @throws AuthnetInvalidJsonException */ private function getByUrl(string $url) : object { @@ -178,9 +183,9 @@ private function getByUrl(string $url) : object * @param string $webhookUrl URL of where webhook notifications will be sent * @param array $eventTypes Array of event types to be added/removed * @param string $status Status of webhooks to be modified [active/inactive] - * @return \JohnConde\Authnet\AuthnetWebhooksResponse - * @throws \JohnConde\Authnet\AuthnetInvalidJsonException - * @throws \JohnConde\Authnet\AuthnetCurlException + * @return AuthnetWebhooksResponse + * @throws AuthnetInvalidJsonException + * @throws AuthnetCurlException */ public function updateWebhook(string $webhookId, string $webhookUrl, array $eventTypes, string $status = 'active') : object { @@ -200,9 +205,9 @@ public function updateWebhook(string $webhookId, string $webhookUrl, array $even * Delete a webhook * * @param string $webhookId Webhook ID to be deleted - * @throws \JohnConde\Authnet\AuthnetCurlException + * @throws AuthnetCurlException */ - public function deleteWebhook(string $webhookId) + public function deleteWebhook(string $webhookId) : void { $this->endpoint = 'webhooks'; $this->url = sprintf('%s%s/%s', $this->url, $this->endpoint, $webhookId); @@ -214,9 +219,9 @@ public function deleteWebhook(string $webhookId) * * @param integer $limit Default: 1000 * @param integer $offset Default: 0 - * @return \JohnConde\Authnet\AuthnetWebhooksResponse - * @throws \JohnConde\Authnet\AuthnetInvalidJsonException - * @throws \JohnConde\Authnet\AuthnetCurlException + * @return AuthnetWebhooksResponse + * @throws AuthnetInvalidJsonException + * @throws AuthnetCurlException */ public function getNotificationHistory(int $limit = 1000, int $offset = 0) : object { @@ -233,7 +238,7 @@ public function getNotificationHistory(int $limit = 1000, int $offset = 0) : obj * Tells the handler to make the API call to Authorize.Net * * @return string - * @throws \JohnConde\Authnet\AuthnetCurlException + * @throws AuthnetCurlException */ private function handleResponse() : string { @@ -246,7 +251,7 @@ private function handleResponse() : string $error_message = $this->processor->error_message; $error_code = $this->processor->error_code; if (empty($error_message)) { - $response = json_decode($this->processor->response); + $response = json_decode($this->processor->response, false); $error_message = sprintf('(%u) %s: %s', $response->status, $response->reason, $response->message); } } @@ -259,7 +264,7 @@ private function handleResponse() : string * @param string $url * @param array $params * @return string - * @throws \JohnConde\Authnet\AuthnetCurlException + * @throws AuthnetCurlException * * @codeCoverageIgnore */ @@ -275,7 +280,7 @@ private function get(string $url, array $params = []) : string * @param string $url API endpoint * @param string $request JSON request payload * @return string - * @throws \JohnConde\Authnet\AuthnetCurlException + * @throws AuthnetCurlException * * @codeCoverageIgnore */ @@ -291,7 +296,7 @@ private function post(string $url, string $request) : string * @param string $url API endpoint * @param string $request JSON request payload * @return string - * @throws \JohnConde\Authnet\AuthnetCurlException + * @throws AuthnetCurlException * * @codeCoverageIgnore */ @@ -306,7 +311,7 @@ private function put(string $url, string $request) : string * * @param string $url API endpoint * @return string - * @throws \JohnConde\Authnet\AuthnetCurlException + * @throws AuthnetCurlException * * @codeCoverageIgnore */ @@ -319,9 +324,9 @@ private function delete(string $url) : string /** * Sets the handler to be used to handle our API call. Mainly used for unit testing as Curl is used by default. * - * @param \Curl\Curl $processor + * @param Curl $processor */ - public function setProcessHandler(\Curl\Curl $processor) + public function setProcessHandler(Curl $processor) : void { $this->processor = $processor; } diff --git a/src/authnet/AuthnetWebhooksResponse.php b/src/authnet/AuthnetWebhooksResponse.php index 64582c4..b9b6521 100644 --- a/src/authnet/AuthnetWebhooksResponse.php +++ b/src/authnet/AuthnetWebhooksResponse.php @@ -38,12 +38,12 @@ class AuthnetWebhooksResponse * Creates the response object with the response json returned from the API call * * @param string $responseJson Response from Authorize.Net - * @throws \JohnConde\Authnet\AuthnetInvalidJsonException + * @throws AuthnetInvalidJsonException */ public function __construct(string $responseJson) { $this->responseJson = $responseJson; - if (($this->response = json_decode($this->responseJson)) === null) { + if (($this->response = json_decode($this->responseJson, false)) === null) { throw new AuthnetInvalidJsonException('Invalid JSON returned by the API'); } } @@ -55,7 +55,8 @@ public function __construct(string $responseJson) */ public function __toString() { - $output = '
Authorize.Net Request
Class Parameters
Authnet Server URL'.$this->url.'
Request JSON
'."\n"; + $output = '
'."\n"; + $output .= ''."\n"; $output .= ''."\n\t\t".''."\n".''."\n"; $output .= ' - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_authOnly.php b/examples/aim/createTransactionRequest_authOnly.php index c2e8922..541bdeb 100644 --- a/examples/aim/createTransactionRequest_authOnly.php +++ b/examples/aim/createTransactionRequest_authOnly.php @@ -277,11 +277,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_captureOnly.php b/examples/aim/createTransactionRequest_captureOnly.php index 6a6a142..32d3709 100644 --- a/examples/aim/createTransactionRequest_captureOnly.php +++ b/examples/aim/createTransactionRequest_captureOnly.php @@ -113,11 +113,11 @@ - + - + diff --git a/examples/aim/createTransactionRequest_partialAuth.php b/examples/aim/createTransactionRequest_partialAuth.php index 2e8b595..45932a3 100644 --- a/examples/aim/createTransactionRequest_partialAuth.php +++ b/examples/aim/createTransactionRequest_partialAuth.php @@ -204,11 +204,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_paypalAuthCapture.php b/examples/aim/createTransactionRequest_paypalAuthCapture.php index 10fe8ba..e6efb81 100644 --- a/examples/aim/createTransactionRequest_paypalAuthCapture.php +++ b/examples/aim/createTransactionRequest_paypalAuthCapture.php @@ -132,11 +132,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php index 643b1b0..19535c8 100644 --- a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php +++ b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php @@ -113,11 +113,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_paypalAuthOnly.php b/examples/aim/createTransactionRequest_paypalAuthOnly.php index f03db5c..36e6439 100644 --- a/examples/aim/createTransactionRequest_paypalAuthOnly.php +++ b/examples/aim/createTransactionRequest_paypalAuthOnly.php @@ -113,11 +113,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php index f4e1831..a76a54c 100644 --- a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php +++ b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php @@ -113,11 +113,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_paypalGetDetails.php b/examples/aim/createTransactionRequest_paypalGetDetails.php index 29b50b0..eb41f5a 100644 --- a/examples/aim/createTransactionRequest_paypalGetDetails.php +++ b/examples/aim/createTransactionRequest_paypalGetDetails.php @@ -103,11 +103,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php index ec4fbb6..df4232d 100644 --- a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php +++ b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php @@ -103,11 +103,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_paypalRefund.php b/examples/aim/createTransactionRequest_paypalRefund.php index 549678d..c2cd327 100644 --- a/examples/aim/createTransactionRequest_paypalRefund.php +++ b/examples/aim/createTransactionRequest_paypalRefund.php @@ -98,11 +98,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_paypalVoid.php b/examples/aim/createTransactionRequest_paypalVoid.php index f3b8d52..cbe2a26 100644 --- a/examples/aim/createTransactionRequest_paypalVoid.php +++ b/examples/aim/createTransactionRequest_paypalVoid.php @@ -103,11 +103,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_priorAuthCapture.php b/examples/aim/createTransactionRequest_priorAuthCapture.php index 85f86da..61051bd 100644 --- a/examples/aim/createTransactionRequest_priorAuthCapture.php +++ b/examples/aim/createTransactionRequest_priorAuthCapture.php @@ -99,11 +99,11 @@ - + - + diff --git a/examples/aim/createTransactionRequest_refund.php b/examples/aim/createTransactionRequest_refund.php index 2667734..f196018 100644 --- a/examples/aim/createTransactionRequest_refund.php +++ b/examples/aim/createTransactionRequest_refund.php @@ -113,11 +113,11 @@ - + - + diff --git a/examples/aim/createTransactionRequest_visaCheckout.php b/examples/aim/createTransactionRequest_visaCheckout.php index fe312cc..5c20204 100644 --- a/examples/aim/createTransactionRequest_visaCheckout.php +++ b/examples/aim/createTransactionRequest_visaCheckout.php @@ -121,11 +121,11 @@ - + - + isSuccessful()) : ?> diff --git a/examples/aim/createTransactionRequest_void.php b/examples/aim/createTransactionRequest_void.php index 4c88ff2..9195378 100644 --- a/examples/aim/createTransactionRequest_void.php +++ b/examples/aim/createTransactionRequest_void.php @@ -99,11 +99,11 @@ - + - + diff --git a/examples/arb/ARBCancelSubscriptionRequest.php b/examples/arb/ARBCancelSubscriptionRequest.php index 93221be..b16bf59 100644 --- a/examples/arb/ARBCancelSubscriptionRequest.php +++ b/examples/arb/ARBCancelSubscriptionRequest.php @@ -84,11 +84,11 @@ - + - +
Authorize.Net Webhook Response
Webhook Response JSON
'."\n";
         $output .= $this->responseJson."\n";
@@ -139,7 +140,7 @@ public function getUrl() : string
      * Gets a list of webhooks
      *
      * @return  array
-     * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
+     * @throws  AuthnetInvalidJsonException
      */
     public function getWebhooks() : array
     {
@@ -154,7 +155,7 @@ public function getWebhooks() : array
      * Gets a list of webhooks
      *
      * @return  array
-     * @throws  \JohnConde\Authnet\AuthnetInvalidJsonException
+     * @throws  AuthnetInvalidJsonException
      */
     public function getNotificationHistory() : array
     {
diff --git a/src/authnet/TransactionResponse.php b/src/authnet/TransactionResponse.php
index 5181c0f..e9ce639 100644
--- a/src/authnet/TransactionResponse.php
+++ b/src/authnet/TransactionResponse.php
@@ -22,11 +22,12 @@
  * @link        https://github.com/stymiee/authnetjson
  * @see         https://developer.authorize.net/api/reference/
  */
-class TransactionResponse {
+class TransactionResponse
+{
     /**
      * @var     array Transaction response fields to map to values parsed from a transaction response string
      */
-    private $fieldMap = [
+    private static $fieldMap = [
         1 => 'ResponseCode',
         2 => 'ResponseSubcode',
         3 => 'ResponseReasonCode',
@@ -77,7 +78,7 @@ class TransactionResponse {
     /**
      * @var     array Transaction response fields to map to values parsed from a transaction response string
      */
-    private $responseArray = [];
+    private $responseArray;
 
     /**
      * Creates out TransactionResponse object and assigns the response variables to an array
@@ -97,15 +98,13 @@ public function __construct(string $response)
      * @param   mixed  $field  Name or key of the transaction field to be retrieved
      * @return  string Transaction field to be retrieved
      */
-    public function getTransactionResponseField($field) : string
+    public function getTransactionResponseField($field) : ?string
     {
         $value = null;
         if (is_int($field)) {
-            $value = (isset($this->responseArray[$field])) ? $this->responseArray[$field] : $value;
-        } else {
-            if ($key = array_search($field, $this->fieldMap)) {
-                $value = $this->responseArray[$key];
-            }
+            $value = $this->responseArray[$field] ?? $value;
+        } elseif ($key = array_search($field, self::$fieldMap, true)) {
+            $value = $this->responseArray[$key];
         }
         return $value;
     }

From 611686a32dceaeda901efb3469015782ca7de808 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 5 May 2019 10:55:46 -0400
Subject: [PATCH 052/105] Code clean up

---
 CHANGELOG                              | 5 ++++-
 src/authnet/AuthnetApiFactory.php      | 7 ++++---
 src/authnet/AuthnetWebhooksRequest.php | 2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 03773c2..487300d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,11 +1,14 @@
 CHANGE LOG
 
-2019-XX-XX - Version 4.0.0
+2019-XX-XX - Version 4.0.0-beta
 --------------------------------------------
 Bumped minimum supported version of PHP to 7.2
 If trying to retrieve non-existent response value, NULL is returned in AuthnetJsonResponse::__get()
 Added AuthnetJson::BOUNDLESS_OCCURRENCES to indicate an endless subscription
 Added constructor to Authnet exceptions
+Removed unused AuthnetInvalidParameterException class
+Updated unit tests for phpunit 8
+Added phpunit to require-dev
 Shiny badges for the README
 Cleaned up HTML and CSS in examples
 Minor formatting changes
diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php
index ba3de15..d1bf4fb 100644
--- a/src/authnet/AuthnetApiFactory.php
+++ b/src/authnet/AuthnetApiFactory.php
@@ -12,17 +12,18 @@
 
 namespace JohnConde\Authnet;
 
-use \Curl\Curl;
-use \ErrorException;
+use Curl\Curl;
+use ErrorException;
 
 /**
  * Factory to instantiate an instance of an AuthnetJson object with the proper endpoint
- * URL and Processor Class
+ * URL and Processor Class.
  *
  * @package    AuthnetJSON
  * @author     John Conde 
  * @copyright  John Conde 
  * @license    http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
+ *
  * @link       https://github.com/stymiee/authnetjson
  */
 
diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php
index d511119..66ab687 100644
--- a/src/authnet/AuthnetWebhooksRequest.php
+++ b/src/authnet/AuthnetWebhooksRequest.php
@@ -12,7 +12,7 @@
 
 namespace JohnConde\Authnet;
 
-use \Curl\Curl;
+use Curl\Curl;
 
 /**
  * Creates a request to the Authorize.Net Webhooks endpoints

From 88a2d0e4f4980e9c4e20ca0e88265dfc2b1a354a Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Mon, 27 May 2019 08:58:29 -0400
Subject: [PATCH 053/105] Updated Curl\Curl dependency to 2.2

---
 composer.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/composer.json b/composer.json
index cde23ad..8c8d54e 100644
--- a/composer.json
+++ b/composer.json
@@ -27,7 +27,7 @@
     ],
     "require": {
         "php": ">=7.2.0",
-        "curl/curl": "^1.5",
+        "curl/curl": "^2.2",
         "ext-curl": "*",
         "ext-json": "*"
     },

From bb3fa224eefd3bf23a65a2c9915f3060a3389b44 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Mon, 27 May 2019 10:40:53 -0400
Subject: [PATCH 054/105] Added retry logic for JSON requests

---
 src/authnet/AuthnetJsonRequest.php | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php
index 241668f..2bda07d 100644
--- a/src/authnet/AuthnetJsonRequest.php
+++ b/src/authnet/AuthnetJsonRequest.php
@@ -58,6 +58,11 @@
  */
 class AuthnetJsonRequest
 {
+    /**
+     * @var     int     Maximum number of retires making HTTP request before failure
+     */
+    private const MAX_RETRIES = 3;
+
     /**
      * @var     string  Authorize.Net API login ID
      */
@@ -123,7 +128,7 @@ public function __toString()
     }
 
     /**
-     * The __set() method should never be used as all values to ba made in the APi call must be passed as an array
+     * The __set() method should never be used as all values to be made in the APi call must be passed as an array
      *
      * @param   string  $name       unused
      * @param   mixed   $value      unused
@@ -173,14 +178,20 @@ public function __call($api_call, Array $args)
      */
     private function process() : string
     {
-        $this->processor->post($this->url, $this->requestJson);
-
+        $retries = 0;
+        while ($retries < self::MAX_RETRIES) {
+            $this->processor->post($this->url, $this->requestJson);
+            if (!$this->processor->error) {
+                break;
+            }
+            $retries++;
+        }
         if (!$this->processor->error && isset($this->processor->response)) {
             return $this->processor->response;
         }
         $error_message = null;
         $error_code    = null;
-        if ($this->processor->error_code) {
+        if ($this->processor->error_code || $this->processor->error_message) {
             $error_message = $this->processor->error_message;
             $error_code    = $this->processor->error_code;
         }

From f8d8a2cc3968884a715ecafcd7051874ccaa1f97 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Mon, 27 May 2019 17:08:31 -0400
Subject: [PATCH 055/105] Added .editorconfig file to project

---
 .editorconfig | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 .editorconfig

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..f055e1c
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,12 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_style = space
+indent_size = 4
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+trim_trailing_whitespace = false

From 44f0263027e3600096e9c3429d21999fdf7e0f40 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Mon, 27 May 2019 17:13:50 -0400
Subject: [PATCH 056/105] Added missing @throws for self::getSimHandler()

---
 src/authnet/AuthnetApiFactory.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php
index d1bf4fb..d5f9db2 100644
--- a/src/authnet/AuthnetApiFactory.php
+++ b/src/authnet/AuthnetApiFactory.php
@@ -14,6 +14,7 @@
 
 use Curl\Curl;
 use ErrorException;
+use Exception;
 
 /**
  * Factory to instantiate an instance of an AuthnetJson object with the proper endpoint
@@ -107,6 +108,7 @@ protected static function getWebServiceURL(int $server) : string
      * @return  AuthnetSim
      * @throws  AuthnetInvalidCredentialsException
      * @throws  AuthnetInvalidServerException
+     * @throws  Exception
      */
     public static function getSimHandler(string $login, string $transaction_key, $server = self::USE_PRODUCTION_SERVER) : object
     {

From 158604a6bd258ce5a5972292093dbeb4a4074fbc Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Mon, 27 May 2019 17:19:36 -0400
Subject: [PATCH 057/105] Minor tweak to require version example

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 7bab1f7..f848377 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ Here is a minimal example of a `composer.json` file that just defines a dependen
 
     {
         "require": {
-            "stymiee/authnetjson": "4.0.*"
+            "stymiee/authnetjson": "~4.0"
         }
     }
 

From 32cd15bda087d6c1340c030d8a0247008f11fb4b Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 2 Jun 2019 12:37:49 -0400
Subject: [PATCH 058/105] Returned better error message when creating Webhook

---
 src/authnet/AuthnetWebhooksRequest.php | 15 ++++-----------
 tests/AuthnetWebhooksRequestTest.php   | 16 +++++++++++++---
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php
index 66ab687..7c1b8a4 100644
--- a/src/authnet/AuthnetWebhooksRequest.php
+++ b/src/authnet/AuthnetWebhooksRequest.php
@@ -245,17 +245,10 @@ private function handleResponse() : string
         if (!$this->processor->error) {
             return $this->processor->response;
         }
-        $error_message = null;
-        $error_code    = null;
-        if ($this->processor->error_code) {
-            $error_message = $this->processor->error_message;
-            $error_code    = $this->processor->error_code;
-            if (empty($error_message)) {
-                $response = json_decode($this->processor->response, false);
-                $error_message = sprintf('(%u) %s: %s', $response->status, $response->reason, $response->message);
-            }
-        }
-        throw new AuthnetCurlException(sprintf('Connection error: %s (%s)', $error_message, $error_code));
+        $response = json_decode($this->processor->response, false);
+        $error_message = sprintf('(%u) %s: %s', $response->status, $response->reason, $response->message);
+
+        throw new AuthnetCurlException(sprintf('Connection error: %s', $error_message));
     }
 
     /**
diff --git a/tests/AuthnetWebhooksRequestTest.php b/tests/AuthnetWebhooksRequestTest.php
index e01999d..6042178 100644
--- a/tests/AuthnetWebhooksRequestTest.php
+++ b/tests/AuthnetWebhooksRequestTest.php
@@ -420,7 +420,12 @@ public function testHandleResponseWithErrorMessage() : void
         $this->http->error          = true;
         $this->http->error_message  = 'Error Message';
         $this->http->error_code     = 100;
-        $this->http->response       = '{"error"}';
+        $this->http->response       = '{
+  "status": 400,
+  "reason": "MISSING_DATA",
+  "message": "The specified event type could not be found or is invalid: net.authorize.customer.create",
+  "correlationId": "dc4816ae-e753-491f-9ae1-ab56768748f5"
+}';
 
         $request = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler($this->http);
@@ -442,7 +447,12 @@ public function testHandleResponseWithErrorMessageTestMessage() : void
         $this->http->error          = true;
         $this->http->error_message  = 'Error Message';
         $this->http->error_code     = 100;
-        $this->http->response       = '{"error"}';
+        $this->http->response       = '{
+  "status": 400,
+  "reason": "MISSING_DATA",
+  "message": "The specified event type could not be found or is invalid: net.authorize.customer.create",
+  "correlationId": "dc4816ae-e753-491f-9ae1-ab56768748f5"
+}';
 
         $request = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler($this->http);
@@ -519,4 +529,4 @@ public function testGetRawRequest() : void
 
         $this->assertEquals('{"url":"http:\/\/www.example.com\/webhook","eventTypes":["net.authorize.customer.subscription.expiring"],"status":"inactive"}', $request->getRawRequest());
     }
-}
\ No newline at end of file
+}

From ce455d5ee51afc796938ec243e0074a1aa17fac2 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 2 Jun 2019 12:43:19 -0400
Subject: [PATCH 059/105] Fixed tests for "returned better error message when
 creating Webhook"

---
 tests/AuthnetWebhooksRequestTest.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/AuthnetWebhooksRequestTest.php b/tests/AuthnetWebhooksRequestTest.php
index 6042178..67675ba 100644
--- a/tests/AuthnetWebhooksRequestTest.php
+++ b/tests/AuthnetWebhooksRequestTest.php
@@ -423,8 +423,8 @@ public function testHandleResponseWithErrorMessage() : void
         $this->http->response       = '{
   "status": 400,
   "reason": "MISSING_DATA",
-  "message": "The specified event type could not be found or is invalid: net.authorize.customer.create",
-  "correlationId": "dc4816ae-e753-491f-9ae1-ab56768748f5"
+  "message": "error",
+  "correlationId": "xxxxxxx"
 }';
 
         $request = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
@@ -450,8 +450,8 @@ public function testHandleResponseWithErrorMessageTestMessage() : void
         $this->http->response       = '{
   "status": 400,
   "reason": "MISSING_DATA",
-  "message": "The specified event type could not be found or is invalid: net.authorize.customer.create",
-  "correlationId": "dc4816ae-e753-491f-9ae1-ab56768748f5"
+  "message": "error",
+  "correlationId": "xxxxxxx"
 }';
 
         $request = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);

From 389361bfb9c8a489a57a58dc8c0f83d7995956b2 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Mon, 3 Jun 2019 20:11:30 -0400
Subject: [PATCH 060/105] Removed unnecessary suppression operators and
 shortened the code with the Elvis operator

---
 src/authnet/AuthnetJsonResponse.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php
index 2e24f9a..48365d8 100644
--- a/src/authnet/AuthnetJsonResponse.php
+++ b/src/authnet/AuthnetJsonResponse.php
@@ -116,8 +116,8 @@ public function __construct(string $responseJson)
             throw new AuthnetInvalidJsonException('Invalid JSON returned by the API');
         }
 
-        if (@$this->directResponse || @$this->validationDirectResponse) {
-            $dr = (@$this->directResponse) ? $this->directResponse : $this->validationDirectResponse;
+        if ($this->directResponse || $this->validationDirectResponse) {
+            $dr = $this->directResponse ?: $this->validationDirectResponse;
             $this->transactionInfo = new TransactionResponse($dr);
         }
     }

From b97fb2acb343c889628df196bafd9c68ad3d385c Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Fri, 21 Jun 2019 10:26:05 -0400
Subject: [PATCH 061/105] Added "Helpful Links" to HELP.md

---
 HELP.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/HELP.md b/HELP.md
index 752916a..586eae1 100644
--- a/HELP.md
+++ b/HELP.md
@@ -38,3 +38,9 @@ this class to tag your question with the **PHP** and **Authorize.Net** tags. Mak
 and I will not be able to assist you.
 
 **Do not use Stack Overflow to report bugs.** Bugs may be reported [here](https://github.com/stymiee/authnetjson/issues/new).
+
+## Helpful Links
+
+* [Authorize.Net Developer Guides](https://developer.authorize.net/api/)
+* [Authorize.Net Testing Guide](https://developer.authorize.net/hello_world/testing_guide/)
+* [Response Codes](https://developer.authorize.net/api/reference/responseCodes.html)

From 5252682e30b750fb7efc4c540d1842e1780f5428 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Fri, 21 Jun 2019 10:26:33 -0400
Subject: [PATCH 062/105] Added support for prepaid cards

---
 CHANGELOG                                     |   1 +
 .../createTransactionRequest_partialAuth.php  | 244 ++++++++++++++++++
 src/authnet/AuthnetJsonResponse.php           |  10 +
 tests/AuthnetJsonResponseTest.php             |  53 +++-
 4 files changed, 306 insertions(+), 2 deletions(-)
 create mode 100644 examples/aim/createTransactionRequest_partialAuth.php

diff --git a/CHANGELOG b/CHANGELOG
index 642b14b..0506ef4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,6 +5,7 @@ CHANGE LOG
 Bumped minimum supported version of PHP to 7.2
 If trying to retrieve non-existent response value, NULL is returned in AuthnetJsonResponse::__get()
 Added AuthnetJson::BOUNDLESS_OCCURRENCES to indicate an endless subscription
+Added support for prepaid cards
 Added constructor to Authnet exceptions
 Removed unused AuthnetInvalidParameterException class
 Updated unit tests for phpunit 8
diff --git a/examples/aim/createTransactionRequest_partialAuth.php b/examples/aim/createTransactionRequest_partialAuth.php
new file mode 100644
index 0000000..fc98f4d
--- /dev/null
+++ b/examples/aim/createTransactionRequest_partialAuth.php
@@ -0,0 +1,244 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/*************************************************************************************************
+
+Use the AIM JSON API to process a partial auth transaction
+
+SAMPLE REQUEST
+--------------------------------------------------------------------------------------------------
+
+{
+   "createTransactionRequest":{
+      "merchantAuthentication":{
+         "name":"8zY2zT32",
+         "transactionKey":"4WDx9a97v5DKY67a"
+      },
+      "refId":47222105,
+      "transactionRequest":{
+         "transactionType":"authCaptureTransaction",
+         "amount":5,
+         "payment":{
+            "creditCard":{
+               "cardNumber":"4111111111111111",
+               "expirationDate":"122020",
+               "cardCode":"999"
+            }
+         },
+         "order":{
+            "invoiceNumber":"1324567890",
+            "description":"this is a test transaction"
+         },
+         "billTo":{
+            "firstName":"Ellen",
+            "lastName":"Johnson",
+            "company":"Souveniropolis",
+            "address":"14 Main Street",
+            "city":"Pecan Springs",
+            "state":"TX",
+            "zip":"46226",
+            "country":"USA"
+         },
+         "transactionSettings":{
+            "setting":[
+               {
+                  "settingName":"allowPartialAuth",
+                  "settingValue":"true"
+               },
+               {
+                  "settingName":"duplicateWindow",
+                  "settingValue":"0"
+               },
+               {
+                  "settingName":"emailCustomer",
+                  "settingValue":"false"
+               },
+               {
+                  "settingName":"recurringBilling",
+                  "settingValue":"false"
+               },
+               {
+                  "settingName":"testRequest",
+                  "settingValue":"false"
+               }
+            ]
+         }
+      }
+   }
+}
+
+SAMPLE RESPONSE
+--------------------------------------------------------------------------------------------------
+
+{
+   "transactionResponse":{
+      "responseCode":"1",
+      "authCode":"LYTVH0",
+      "avsResultCode":"Y",
+      "cvvResultCode":"P",
+      "cavvResultCode":"2",
+      "transId":"40033638873",
+      "refTransID":"",
+      "transHash":"",
+      "testRequest":"0",
+      "accountNumber":"XXXX1111",
+      "accountType":"Visa",
+      "prePaidCard":{
+         "requestedAmount":"5.00",
+         "approvedAmount":"5.00",
+         "balanceOnCard":"1.23"
+      },
+      "messages":[
+         {
+            "code":"1",
+            "description":"This transaction has been approved."
+         }
+      ],
+      "transHashSha2":"5B69E7D68DE994D9A60A0F684BEBA11EE5C97DC22A45BEF70C558D0D9A3476597566EAB841A7B7A63F7768B3458C0E345BACE75AA97462220E16A6DC94F6361C",
+      "SupplementalDataQualificationIndicator":0
+   },
+   "refId":"47222105",
+   "messages":{
+      "resultCode":"Ok",
+      "message":[
+         {
+            "code":"I00001",
+            "text":"Successful."
+         }
+      ]
+   }
+}
+
+*************************************************************************************************/
+
+    namespace JohnConde\Authnet;
+
+    require('../../config.inc.php');
+
+    $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
+    $response = $request->createTransactionRequest([
+        'refId' => rand(1000000, 100000000),
+        'transactionRequest' => [
+            'transactionType' => 'authCaptureTransaction',
+            'amount' => 5,
+            'payment' => [
+                'creditCard' => [
+                    'cardNumber' => '4111111111111111',
+                    'expirationDate' => '122020',
+                    'cardCode' => '999',
+                ],
+            ],
+            'order' => [
+                'invoiceNumber' => '1324567890',
+                'description' => 'this is a test transaction',
+            ],
+            'billTo' => [
+               'firstName' => 'Ellen',
+               'lastName' => 'Johnson',
+               'company' => 'Souveniropolis',
+               'address' => '14 Main Street',
+               'city' => 'Pecan Springs',
+               'state' => 'TX',
+               'zip' => '46226',
+               'country' => 'USA',
+            ],
+            'transactionSettings' => [
+                'setting' => [
+                    0 => [
+                        'settingName' =>'allowPartialAuth',
+                        'settingValue' => 'true'
+                    ],
+                    1 => [
+                        'settingName' => 'duplicateWindow',
+                        'settingValue' => '0'
+                    ],
+                    2 => [
+                        'settingName' => 'emailCustomer',
+                        'settingValue' => 'false'
+                    ],
+                    3 => [
+                        'settingName' => 'recurringBilling',
+                        'settingValue' => 'false'
+                    ],
+                    4 => [
+                        'settingName' => 'testRequest',
+                        'settingValue' => 'false'
+                    ]
+                ]
+            ],
+        ],
+    ]);
+?>
+
+
+
+    
+        AIM :: Authorize and Capture
+    
+    
+    
+        

+ AIM :: Partial Auth +

+

+ Results +

+ + + + + + + + + + + + + + isSuccessful()) : ?> + + + + + + + + + + + + + isError()) : ?> + + + + + + + + + +
Responsemessages->resultCode; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>
Is Prepaid Card?isPrePaidCard() ? 'yes' : 'no' ; ?>
Remaining BalancetransactionResponse->prePaidCard->balanceOnCard; ?>
Approved AmounttransactionResponse->prePaidCard->approvedAmount; ?>
Error CodegetErrorCode(); ?>
Error MessagegetErrorText(); ?>
+

+ Raw Input/Output +

+ + + diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php index 48365d8..f2f0b96 100644 --- a/src/authnet/AuthnetJsonResponse.php +++ b/src/authnet/AuthnetJsonResponse.php @@ -181,6 +181,16 @@ public function isApproved() : bool return $this->isSuccessful() && $this->checkTransactionStatus(self::STATUS_APPROVED); } + /** + * Checks if a transaction was completed using a prepaid card + * + * @return bool true if the transaction was completed using a prepaid card + */ + public function isPrePaidCard() : bool + { + return isset($this->transactionResponse->prePaidCard); + } + /** * Checks if a transaction was declined * diff --git a/tests/AuthnetJsonResponseTest.php b/tests/AuthnetJsonResponseTest.php index e256d26..a68926c 100644 --- a/tests/AuthnetJsonResponseTest.php +++ b/tests/AuthnetJsonResponseTest.php @@ -169,6 +169,55 @@ public function testIsDeclined() : void $this->assertTrue($response->isDeclined()); } + /** + * @covers \JohnConde\Authnet\AuthnetJsonResponse::isPrePaidCard() + */ + public function testIsPrePaidCard() : void + { + $responseJson = '{ + "transactionResponse":{ + "responseCode":"1", + "authCode":"LYTVH0", + "avsResultCode":"Y", + "cvvResultCode":"P", + "cavvResultCode":"2", + "transId":"40033638873", + "refTransID":"", + "transHash":"", + "testRequest":"0", + "accountNumber":"XXXX1111", + "accountType":"Visa", + "prePaidCard":{ + "requestedAmount":"5.00", + "approvedAmount":"5.00", + "balanceOnCard":"1.23" + }, + "messages":[ + { + "code":"1", + "description":"This transaction has been approved." + } + ], + "transHashSha2":"5B69E7D68DE994D9A60A0F684BEBA11EE5C97DC22A45BEF70C558D0D9A3476597566EAB841A7B7A63F7768B3458C0E345BACE75AA97462220E16A6DC94F6361C", + "SupplementalDataQualificationIndicator":0 + }, + "refId":"47222105", + "messages":{ + "resultCode":"Ok", + "message":[ + { + "code":"I00001", + "text":"Successful." + } + ] + } + }'; + + $response = new AuthnetJsonResponse($responseJson); + + $this->assertTrue($response->isPrePaidCard()); + } + /** * @covers \JohnConde\Authnet\AuthnetJsonResponse::__toString() @@ -222,7 +271,7 @@ public function testGetRawResponse() : void $response = new AuthnetJsonResponse($responseJson); - $this->assertSame(str_replace("\r\n", '', $responseJson), $response->getRawResponse()); + $this->assertSame(str_replace("\n", '', $responseJson), $response->getRawResponse()); } @@ -451,4 +500,4 @@ public function testGetErrorMessage() : void $this->assertEquals($response->getErrorText(), $response->getErrorMessage()); } -} \ No newline at end of file +} From cf55cb36ee2d82f3906b6d48e253d2d6c8dbc57a Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 10:28:05 -0400 Subject: [PATCH 063/105] Removed unnecessary parenthesis around require() statements --- examples/aim/createTransactionRequest_authCapture.php | 2 +- examples/aim/createTransactionRequest_authOnly.php | 2 +- examples/aim/createTransactionRequest_captureOnly.php | 2 +- examples/aim/createTransactionRequest_partialAuth.php | 2 +- examples/aim/createTransactionRequest_paypalAuthCapture.php | 2 +- .../createTransactionRequest_paypalAuthCaptureContinue.php | 2 +- examples/aim/createTransactionRequest_paypalAuthOnly.php | 2 +- .../aim/createTransactionRequest_paypalAuthOnlyContinue.php | 2 +- examples/aim/createTransactionRequest_paypalGetDetails.php | 2 +- .../aim/createTransactionRequest_paypalPriorAuthCapture.php | 2 +- examples/aim/createTransactionRequest_paypalRefund.php | 2 +- examples/aim/createTransactionRequest_paypalVoid.php | 2 +- examples/aim/createTransactionRequest_priorAuthCapture.php | 2 +- examples/aim/createTransactionRequest_refund.php | 2 +- examples/aim/createTransactionRequest_visaCheckout.php | 2 +- examples/aim/createTransactionRequest_void.php | 2 +- examples/aim/decryptPaymentDataRequest.php | 2 +- examples/aim/sendCustomerTransactionReceiptRequest.php | 2 +- examples/arb/ARBCancelSubscriptionRequest.php | 2 +- examples/arb/ARBCreateSubscriptionRequest.php | 2 +- examples/arb/ARBGetSubscriptionStatusRequest.php | 2 +- examples/arb/ARBUpdateSubscriptionRequest.php | 2 +- examples/cim/createCustomerPaymentProfileRequest.php | 2 +- examples/cim/createCustomerProfileRequest.php | 2 +- .../cim/createCustomerProfileRequestMultiplePayAccounts.php | 2 +- .../createCustomerProfileTransactionRequest_authCapture.php | 2 +- .../cim/createCustomerProfileTransactionRequest_authOnly.php | 2 +- .../createCustomerProfileTransactionRequest_captureOnly.php | 2 +- ...eateCustomerProfileTransactionRequest_priorAuthCapture.php | 2 +- .../cim/createCustomerProfileTransactionRequest_refund.php | 2 +- examples/cim/createCustomerProfileTransactionRequest_void.php | 2 +- examples/cim/createCustomerShippingAddressRequest.php | 2 +- examples/cim/deleteCustomerPaymentProfileRequest.php | 2 +- examples/cim/deleteCustomerProfileRequest.php | 2 +- examples/cim/deleteCustomerShippingAddressRequest.php | 2 +- examples/cim/getCustomerPaymentProfileRequest.php | 2 +- examples/cim/getCustomerProfileIdsRequest.php | 2 +- examples/cim/getCustomerProfileRequest.php | 2 +- examples/cim/getCustomerShippingAddressRequest.php | 2 +- examples/cim/getHostedProfilePageRequest.php | 2 +- examples/cim/updateCustomerPaymentProfileRequest.php | 2 +- examples/cim/updateCustomerProfileRequest.php | 2 +- examples/cim/updateCustomerShippingAddressRequest.php | 2 +- examples/cim/updateSplitTenderGroupRequest.php | 2 +- examples/cim/validateCustomerPaymentProfileRequest.php | 2 +- examples/reporting/getBatchStatisticsRequest.php | 2 +- examples/reporting/getSettledBatchListRequest.php | 2 +- examples/reporting/getTransactionDetailsRequest.php | 2 +- examples/reporting/getTransactionListRequest.php | 2 +- examples/reporting/getUnsettledTransactionListRequest.php | 2 +- examples/sim/sim.php | 2 +- examples/webhooks/createWebhook.php | 4 ++-- examples/webhooks/deleteWebhook.php | 4 ++-- examples/webhooks/getEventTypes.php | 4 ++-- examples/webhooks/getWebhook.php | 4 ++-- examples/webhooks/listWebhooks.php | 4 ++-- examples/webhooks/notificationHistory.php | 4 ++-- examples/webhooks/ping.php | 4 ++-- examples/webhooks/updateWebhook.php | 4 ++-- 59 files changed, 67 insertions(+), 67 deletions(-) diff --git a/examples/aim/createTransactionRequest_authCapture.php b/examples/aim/createTransactionRequest_authCapture.php index 193e421..e9b3822 100644 --- a/examples/aim/createTransactionRequest_authCapture.php +++ b/examples/aim/createTransactionRequest_authCapture.php @@ -173,7 +173,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_authOnly.php b/examples/aim/createTransactionRequest_authOnly.php index c72fd49..2f7d17c 100644 --- a/examples/aim/createTransactionRequest_authOnly.php +++ b/examples/aim/createTransactionRequest_authOnly.php @@ -146,7 +146,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_captureOnly.php b/examples/aim/createTransactionRequest_captureOnly.php index 582b527..3454a1d 100644 --- a/examples/aim/createTransactionRequest_captureOnly.php +++ b/examples/aim/createTransactionRequest_captureOnly.php @@ -64,7 +64,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_partialAuth.php b/examples/aim/createTransactionRequest_partialAuth.php index fc98f4d..733b034 100644 --- a/examples/aim/createTransactionRequest_partialAuth.php +++ b/examples/aim/createTransactionRequest_partialAuth.php @@ -121,7 +121,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalAuthCapture.php b/examples/aim/createTransactionRequest_paypalAuthCapture.php index ce67eb3..10fe8ba 100644 --- a/examples/aim/createTransactionRequest_paypalAuthCapture.php +++ b/examples/aim/createTransactionRequest_paypalAuthCapture.php @@ -78,7 +78,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php index 8548fd9..643b1b0 100644 --- a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php +++ b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php @@ -71,7 +71,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalAuthOnly.php b/examples/aim/createTransactionRequest_paypalAuthOnly.php index 4c138db..f03db5c 100644 --- a/examples/aim/createTransactionRequest_paypalAuthOnly.php +++ b/examples/aim/createTransactionRequest_paypalAuthOnly.php @@ -70,7 +70,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php index 1860f3a..f4e1831 100644 --- a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php +++ b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php @@ -71,7 +71,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->authOnlyContinueTransaction([ diff --git a/examples/aim/createTransactionRequest_paypalGetDetails.php b/examples/aim/createTransactionRequest_paypalGetDetails.php index 21d9c39..29b50b0 100644 --- a/examples/aim/createTransactionRequest_paypalGetDetails.php +++ b/examples/aim/createTransactionRequest_paypalGetDetails.php @@ -66,7 +66,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php index 3eda038..ec4fbb6 100644 --- a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php +++ b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php @@ -66,7 +66,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalRefund.php b/examples/aim/createTransactionRequest_paypalRefund.php index 30a47b6..549678d 100644 --- a/examples/aim/createTransactionRequest_paypalRefund.php +++ b/examples/aim/createTransactionRequest_paypalRefund.php @@ -61,7 +61,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_paypalVoid.php b/examples/aim/createTransactionRequest_paypalVoid.php index fa96f3f..f3b8d52 100644 --- a/examples/aim/createTransactionRequest_paypalVoid.php +++ b/examples/aim/createTransactionRequest_paypalVoid.php @@ -66,7 +66,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_priorAuthCapture.php b/examples/aim/createTransactionRequest_priorAuthCapture.php index 56210b2..f1df80a 100644 --- a/examples/aim/createTransactionRequest_priorAuthCapture.php +++ b/examples/aim/createTransactionRequest_priorAuthCapture.php @@ -57,7 +57,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_refund.php b/examples/aim/createTransactionRequest_refund.php index 1a10ce3..a6452ab 100644 --- a/examples/aim/createTransactionRequest_refund.php +++ b/examples/aim/createTransactionRequest_refund.php @@ -64,7 +64,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_visaCheckout.php b/examples/aim/createTransactionRequest_visaCheckout.php index 5d13c5f..7daf9b1 100644 --- a/examples/aim/createTransactionRequest_visaCheckout.php +++ b/examples/aim/createTransactionRequest_visaCheckout.php @@ -75,7 +75,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/createTransactionRequest_void.php b/examples/aim/createTransactionRequest_void.php index 1cb7e29..5333bda 100644 --- a/examples/aim/createTransactionRequest_void.php +++ b/examples/aim/createTransactionRequest_void.php @@ -57,7 +57,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ diff --git a/examples/aim/decryptPaymentDataRequest.php b/examples/aim/decryptPaymentDataRequest.php index 70039e6..e11472b 100644 --- a/examples/aim/decryptPaymentDataRequest.php +++ b/examples/aim/decryptPaymentDataRequest.php @@ -72,7 +72,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->decryptPaymentDataRequest([ diff --git a/examples/aim/sendCustomerTransactionReceiptRequest.php b/examples/aim/sendCustomerTransactionReceiptRequest.php index 9ad6c9e..946f1b2 100644 --- a/examples/aim/sendCustomerTransactionReceiptRequest.php +++ b/examples/aim/sendCustomerTransactionReceiptRequest.php @@ -42,7 +42,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->sendCustomerTransactionReceiptRequest([ diff --git a/examples/arb/ARBCancelSubscriptionRequest.php b/examples/arb/ARBCancelSubscriptionRequest.php index 2592154..93221be 100644 --- a/examples/arb/ARBCancelSubscriptionRequest.php +++ b/examples/arb/ARBCancelSubscriptionRequest.php @@ -45,7 +45,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->ARBCancelSubscriptionRequest([ diff --git a/examples/arb/ARBCreateSubscriptionRequest.php b/examples/arb/ARBCreateSubscriptionRequest.php index 2e32f03..d8d66a5 100644 --- a/examples/arb/ARBCreateSubscriptionRequest.php +++ b/examples/arb/ARBCreateSubscriptionRequest.php @@ -69,7 +69,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->ARBCreateSubscriptionRequest([ diff --git a/examples/arb/ARBGetSubscriptionStatusRequest.php b/examples/arb/ARBGetSubscriptionStatusRequest.php index 571e7f0..b25a112 100644 --- a/examples/arb/ARBGetSubscriptionStatusRequest.php +++ b/examples/arb/ARBGetSubscriptionStatusRequest.php @@ -50,7 +50,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->ARBGetSubscriptionStatusRequest([ diff --git a/examples/arb/ARBUpdateSubscriptionRequest.php b/examples/arb/ARBUpdateSubscriptionRequest.php index 9e0f4e5..a6ba41a 100644 --- a/examples/arb/ARBUpdateSubscriptionRequest.php +++ b/examples/arb/ARBUpdateSubscriptionRequest.php @@ -53,7 +53,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->ARBUpdateSubscriptionRequest([ diff --git a/examples/cim/createCustomerPaymentProfileRequest.php b/examples/cim/createCustomerPaymentProfileRequest.php index 90a5e34..ee3b8d1 100644 --- a/examples/cim/createCustomerPaymentProfileRequest.php +++ b/examples/cim/createCustomerPaymentProfileRequest.php @@ -57,7 +57,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerPaymentProfileRequest([ diff --git a/examples/cim/createCustomerProfileRequest.php b/examples/cim/createCustomerProfileRequest.php index 5da99d4..e5f93de 100644 --- a/examples/cim/createCustomerProfileRequest.php +++ b/examples/cim/createCustomerProfileRequest.php @@ -83,7 +83,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileRequest([ diff --git a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php index 20c7a58..5a93c03 100644 --- a/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php +++ b/examples/cim/createCustomerProfileRequestMultiplePayAccounts.php @@ -106,7 +106,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php index 6804ad3..3b62bfd 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php +++ b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php @@ -76,7 +76,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php index 5f943b5..2ed985e 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php +++ b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php @@ -76,7 +76,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php index a1a3054..7153432 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php +++ b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php @@ -77,7 +77,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php index 8d52b94..bae970d 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php +++ b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php @@ -69,7 +69,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_refund.php b/examples/cim/createCustomerProfileTransactionRequest_refund.php index 6deeeb5..5db65c0 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_refund.php +++ b/examples/cim/createCustomerProfileTransactionRequest_refund.php @@ -75,7 +75,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerProfileTransactionRequest_void.php b/examples/cim/createCustomerProfileTransactionRequest_void.php index 31c3eee..30fc089 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_void.php +++ b/examples/cim/createCustomerProfileTransactionRequest_void.php @@ -42,7 +42,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerProfileTransactionRequest([ diff --git a/examples/cim/createCustomerShippingAddressRequest.php b/examples/cim/createCustomerShippingAddressRequest.php index c66299c..ae5d65a 100644 --- a/examples/cim/createCustomerShippingAddressRequest.php +++ b/examples/cim/createCustomerShippingAddressRequest.php @@ -46,7 +46,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createCustomerShippingAddressRequest([ diff --git a/examples/cim/deleteCustomerPaymentProfileRequest.php b/examples/cim/deleteCustomerPaymentProfileRequest.php index 9ce4ad3..6390a9b 100644 --- a/examples/cim/deleteCustomerPaymentProfileRequest.php +++ b/examples/cim/deleteCustomerPaymentProfileRequest.php @@ -34,7 +34,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->deleteCustomerPaymentProfileRequest([ diff --git a/examples/cim/deleteCustomerProfileRequest.php b/examples/cim/deleteCustomerProfileRequest.php index 19bb5af..e3bacac 100644 --- a/examples/cim/deleteCustomerProfileRequest.php +++ b/examples/cim/deleteCustomerProfileRequest.php @@ -33,7 +33,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->deleteCustomerProfileRequest([ diff --git a/examples/cim/deleteCustomerShippingAddressRequest.php b/examples/cim/deleteCustomerShippingAddressRequest.php index d0ccb60..3e3e479 100644 --- a/examples/cim/deleteCustomerShippingAddressRequest.php +++ b/examples/cim/deleteCustomerShippingAddressRequest.php @@ -34,7 +34,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->deleteCustomerShippingAddressRequest([ diff --git a/examples/cim/getCustomerPaymentProfileRequest.php b/examples/cim/getCustomerPaymentProfileRequest.php index d33ef8f..be80db8 100644 --- a/examples/cim/getCustomerPaymentProfileRequest.php +++ b/examples/cim/getCustomerPaymentProfileRequest.php @@ -53,7 +53,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getCustomerPaymentProfileRequest([ diff --git a/examples/cim/getCustomerProfileIdsRequest.php b/examples/cim/getCustomerProfileIdsRequest.php index c15beb3..f392b60 100644 --- a/examples/cim/getCustomerProfileIdsRequest.php +++ b/examples/cim/getCustomerProfileIdsRequest.php @@ -120,7 +120,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getCustomerProfileIdsRequest(); diff --git a/examples/cim/getCustomerProfileRequest.php b/examples/cim/getCustomerProfileRequest.php index a43bff9..04bf3a7 100644 --- a/examples/cim/getCustomerProfileRequest.php +++ b/examples/cim/getCustomerProfileRequest.php @@ -84,7 +84,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getCustomerProfileRequest([ diff --git a/examples/cim/getCustomerShippingAddressRequest.php b/examples/cim/getCustomerShippingAddressRequest.php index 1626749..3018013 100644 --- a/examples/cim/getCustomerShippingAddressRequest.php +++ b/examples/cim/getCustomerShippingAddressRequest.php @@ -44,7 +44,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getCustomerShippingAddressRequest([ diff --git a/examples/cim/getHostedProfilePageRequest.php b/examples/cim/getHostedProfilePageRequest.php index 8f69ab6..a212fd5 100644 --- a/examples/cim/getHostedProfilePageRequest.php +++ b/examples/cim/getHostedProfilePageRequest.php @@ -40,7 +40,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getHostedProfilePageRequest([ diff --git a/examples/cim/updateCustomerPaymentProfileRequest.php b/examples/cim/updateCustomerPaymentProfileRequest.php index dc3a24b..581fec0 100644 --- a/examples/cim/updateCustomerPaymentProfileRequest.php +++ b/examples/cim/updateCustomerPaymentProfileRequest.php @@ -54,7 +54,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->updateCustomerPaymentProfileRequest([ diff --git a/examples/cim/updateCustomerProfileRequest.php b/examples/cim/updateCustomerProfileRequest.php index ace75d3..04603dc 100644 --- a/examples/cim/updateCustomerProfileRequest.php +++ b/examples/cim/updateCustomerProfileRequest.php @@ -38,7 +38,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->updateCustomerProfileRequest([ diff --git a/examples/cim/updateCustomerShippingAddressRequest.php b/examples/cim/updateCustomerShippingAddressRequest.php index af69bd8..8dbe236 100644 --- a/examples/cim/updateCustomerShippingAddressRequest.php +++ b/examples/cim/updateCustomerShippingAddressRequest.php @@ -46,7 +46,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->updateCustomerShippingAddressRequest([ diff --git a/examples/cim/updateSplitTenderGroupRequest.php b/examples/cim/updateSplitTenderGroupRequest.php index 42a8237..8285025 100644 --- a/examples/cim/updateSplitTenderGroupRequest.php +++ b/examples/cim/updateSplitTenderGroupRequest.php @@ -34,7 +34,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->updateSplitTenderGroupRequest([ diff --git a/examples/cim/validateCustomerPaymentProfileRequest.php b/examples/cim/validateCustomerPaymentProfileRequest.php index a16f205..e32fd50 100644 --- a/examples/cim/validateCustomerPaymentProfileRequest.php +++ b/examples/cim/validateCustomerPaymentProfileRequest.php @@ -37,7 +37,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->validateCustomerPaymentProfileRequest([ diff --git a/examples/reporting/getBatchStatisticsRequest.php b/examples/reporting/getBatchStatisticsRequest.php index c754982..1ad6388 100644 --- a/examples/reporting/getBatchStatisticsRequest.php +++ b/examples/reporting/getBatchStatisticsRequest.php @@ -77,7 +77,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getBatchStatisticsRequest([ diff --git a/examples/reporting/getSettledBatchListRequest.php b/examples/reporting/getSettledBatchListRequest.php index 93062e3..730a815 100644 --- a/examples/reporting/getSettledBatchListRequest.php +++ b/examples/reporting/getSettledBatchListRequest.php @@ -165,7 +165,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getSettledBatchListRequest([ diff --git a/examples/reporting/getTransactionDetailsRequest.php b/examples/reporting/getTransactionDetailsRequest.php index 02cd0ef..0132d98 100644 --- a/examples/reporting/getTransactionDetailsRequest.php +++ b/examples/reporting/getTransactionDetailsRequest.php @@ -98,7 +98,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getTransactionDetailsRequest([ diff --git a/examples/reporting/getTransactionListRequest.php b/examples/reporting/getTransactionListRequest.php index 2e54672..fe1a35d 100644 --- a/examples/reporting/getTransactionListRequest.php +++ b/examples/reporting/getTransactionListRequest.php @@ -60,7 +60,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getTransactionListRequest([ diff --git a/examples/reporting/getUnsettledTransactionListRequest.php b/examples/reporting/getUnsettledTransactionListRequest.php index 1083586..ab4cd2f 100644 --- a/examples/reporting/getUnsettledTransactionListRequest.php +++ b/examples/reporting/getUnsettledTransactionListRequest.php @@ -89,7 +89,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->getUnsettledTransactionListRequest(); diff --git a/examples/sim/sim.php b/examples/sim/sim.php index ab92868..39a01d2 100644 --- a/examples/sim/sim.php +++ b/examples/sim/sim.php @@ -17,7 +17,7 @@ namespace JohnConde\Authnet; - require('../../config.inc.php'); + require '../../config.inc.php'; $sim = AuthnetApiFactory::getSimHandler(AUTHNET_LOGIN, AUTHNET_SIGNATURE, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $amount = 10.00; diff --git a/examples/webhooks/createWebhook.php b/examples/webhooks/createWebhook.php index ee793b1..568566a 100644 --- a/examples/webhooks/createWebhook.php +++ b/examples/webhooks/createWebhook.php @@ -53,7 +53,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $successful = false; $error = true; @@ -158,4 +158,4 @@ echo $request, $response; ?> - \ No newline at end of file + diff --git a/examples/webhooks/deleteWebhook.php b/examples/webhooks/deleteWebhook.php index c5fd445..fcf5984 100644 --- a/examples/webhooks/deleteWebhook.php +++ b/examples/webhooks/deleteWebhook.php @@ -28,7 +28,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $successful = false; $error = true; @@ -85,4 +85,4 @@ echo $request; ?> - \ No newline at end of file + diff --git a/examples/webhooks/getEventTypes.php b/examples/webhooks/getEventTypes.php index b863772..bb26fd3 100644 --- a/examples/webhooks/getEventTypes.php +++ b/examples/webhooks/getEventTypes.php @@ -91,7 +91,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $successful = false; $error = true; @@ -162,4 +162,4 @@ echo $request, $response; ?> - \ No newline at end of file + diff --git a/examples/webhooks/getWebhook.php b/examples/webhooks/getWebhook.php index 7b347b6..e38c1d5 100644 --- a/examples/webhooks/getWebhook.php +++ b/examples/webhooks/getWebhook.php @@ -43,7 +43,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $successful = false; $error = true; @@ -126,4 +126,4 @@ echo $request, $response; ?> - \ No newline at end of file + diff --git a/examples/webhooks/listWebhooks.php b/examples/webhooks/listWebhooks.php index 2f00281..e8b717b 100644 --- a/examples/webhooks/listWebhooks.php +++ b/examples/webhooks/listWebhooks.php @@ -73,7 +73,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $successful = false; $error = true; @@ -163,4 +163,4 @@ echo $request, $response; ?> - \ No newline at end of file + diff --git a/examples/webhooks/notificationHistory.php b/examples/webhooks/notificationHistory.php index 3c36fbe..299738e 100644 --- a/examples/webhooks/notificationHistory.php +++ b/examples/webhooks/notificationHistory.php @@ -47,7 +47,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $successful = false; $error = true; @@ -131,4 +131,4 @@ echo $request, $response; ?> - \ No newline at end of file + diff --git a/examples/webhooks/ping.php b/examples/webhooks/ping.php index 98a4724..fdd8e2e 100644 --- a/examples/webhooks/ping.php +++ b/examples/webhooks/ping.php @@ -39,7 +39,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $successful = false; $error = true; @@ -95,4 +95,4 @@ echo $request; ?> - \ No newline at end of file + diff --git a/examples/webhooks/updateWebhook.php b/examples/webhooks/updateWebhook.php index b724364..dbc6bf7 100644 --- a/examples/webhooks/updateWebhook.php +++ b/examples/webhooks/updateWebhook.php @@ -48,7 +48,7 @@ namespace JohnConde\Authnet; -require('../../config.inc.php'); +require '../../config.inc.php'; $successful = false; $error = true; @@ -153,4 +153,4 @@ echo $request, $response; ?> - \ No newline at end of file + From e1586f9956db2857cabae0e0a171b97691752750 Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 10:30:55 -0400 Subject: [PATCH 064/105] Replaced rand() with random_int() in examples --- examples/aim/createTransactionRequest_authCapture.php | 2 +- examples/aim/createTransactionRequest_authOnly.php | 2 +- examples/aim/createTransactionRequest_captureOnly.php | 2 +- examples/aim/createTransactionRequest_partialAuth.php | 2 +- examples/aim/createTransactionRequest_priorAuthCapture.php | 2 +- examples/aim/createTransactionRequest_refund.php | 2 +- examples/aim/createTransactionRequest_visaCheckout.php | 2 +- examples/aim/createTransactionRequest_void.php | 2 +- examples/aim/sendCustomerTransactionReceiptRequest.php | 2 +- tests/AuthnetJsonAimTest.php | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/aim/createTransactionRequest_authCapture.php b/examples/aim/createTransactionRequest_authCapture.php index e9b3822..493cee1 100644 --- a/examples/aim/createTransactionRequest_authCapture.php +++ b/examples/aim/createTransactionRequest_authCapture.php @@ -177,7 +177,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ - 'refId' => rand(1000000, 100000000), + 'refId' => random_int(1000000, 100000000), 'transactionRequest' => [ 'transactionType' => 'authCaptureTransaction', 'amount' => 5, diff --git a/examples/aim/createTransactionRequest_authOnly.php b/examples/aim/createTransactionRequest_authOnly.php index 2f7d17c..c2e8922 100644 --- a/examples/aim/createTransactionRequest_authOnly.php +++ b/examples/aim/createTransactionRequest_authOnly.php @@ -150,7 +150,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ - 'refId' => rand(1000000, 100000000), + 'refId' => random_int(1000000, 100000000), 'transactionRequest' => [ 'transactionType' => 'authOnlyTransaction', 'amount' => 5, diff --git a/examples/aim/createTransactionRequest_captureOnly.php b/examples/aim/createTransactionRequest_captureOnly.php index 3454a1d..6a6a142 100644 --- a/examples/aim/createTransactionRequest_captureOnly.php +++ b/examples/aim/createTransactionRequest_captureOnly.php @@ -68,7 +68,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ - 'refId' => rand(1000000, 100000000), + 'refId' => random_int(1000000, 100000000), 'transactionRequest' => [ 'transactionType' => 'captureOnlyTransaction', 'amount' => 5, diff --git a/examples/aim/createTransactionRequest_partialAuth.php b/examples/aim/createTransactionRequest_partialAuth.php index 733b034..2e8b595 100644 --- a/examples/aim/createTransactionRequest_partialAuth.php +++ b/examples/aim/createTransactionRequest_partialAuth.php @@ -125,7 +125,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ - 'refId' => rand(1000000, 100000000), + 'refId' => random_int(1000000, 100000000), 'transactionRequest' => [ 'transactionType' => 'authCaptureTransaction', 'amount' => 5, diff --git a/examples/aim/createTransactionRequest_priorAuthCapture.php b/examples/aim/createTransactionRequest_priorAuthCapture.php index f1df80a..85f86da 100644 --- a/examples/aim/createTransactionRequest_priorAuthCapture.php +++ b/examples/aim/createTransactionRequest_priorAuthCapture.php @@ -61,7 +61,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ - 'refId' => rand(1000000, 100000000), + 'refId' => random_int(1000000, 100000000), 'transactionRequest' => [ 'transactionType' => 'priorAuthCaptureTransaction', 'refTransId' => '2230581333' diff --git a/examples/aim/createTransactionRequest_refund.php b/examples/aim/createTransactionRequest_refund.php index a6452ab..2667734 100644 --- a/examples/aim/createTransactionRequest_refund.php +++ b/examples/aim/createTransactionRequest_refund.php @@ -68,7 +68,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ - 'refId' => rand(1000000, 100000000), + 'refId' => random_int(1000000, 100000000), 'transactionRequest' => [ 'transactionType' => 'refundTransaction', 'amount' => 5, diff --git a/examples/aim/createTransactionRequest_visaCheckout.php b/examples/aim/createTransactionRequest_visaCheckout.php index 7daf9b1..fe312cc 100644 --- a/examples/aim/createTransactionRequest_visaCheckout.php +++ b/examples/aim/createTransactionRequest_visaCheckout.php @@ -79,7 +79,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ - "refId" => rand(1000000, 100000000), + "refId" => random_int(1000000, 100000000), "transactionRequest" => [ "transactionType" => "authCaptureTransaction", "amount" => "5", diff --git a/examples/aim/createTransactionRequest_void.php b/examples/aim/createTransactionRequest_void.php index 5333bda..4c88ff2 100644 --- a/examples/aim/createTransactionRequest_void.php +++ b/examples/aim/createTransactionRequest_void.php @@ -61,7 +61,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->createTransactionRequest([ - 'refId' => rand(1000000, 100000000), + 'refId' => random_int(1000000, 100000000), 'transactionRequest' => [ 'transactionType' => 'voidTransaction', 'refTransId' => '2230581408' diff --git a/examples/aim/sendCustomerTransactionReceiptRequest.php b/examples/aim/sendCustomerTransactionReceiptRequest.php index 946f1b2..7d0bb41 100644 --- a/examples/aim/sendCustomerTransactionReceiptRequest.php +++ b/examples/aim/sendCustomerTransactionReceiptRequest.php @@ -46,7 +46,7 @@ $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER); $response = $request->sendCustomerTransactionReceiptRequest([ - 'refId' => rand(1000000, 100000000), + 'refId' => random_int(1000000, 100000000), 'transId' => '2165665581', 'customerEmail' => 'user@example.com', 'emailSettings' => [ diff --git a/tests/AuthnetJsonAimTest.php b/tests/AuthnetJsonAimTest.php index 50d1558..416efad 100644 --- a/tests/AuthnetJsonAimTest.php +++ b/tests/AuthnetJsonAimTest.php @@ -1079,7 +1079,7 @@ public function testSendCustomerTransactionReceiptRequest() : void public function testCreateTransactionRequestVisaCheckout() : void { $requestJson = array( - "refId" => rand(1000000, 100000000), + "refId" => random_int(1000000, 100000000), "transactionRequest" => array( "transactionType" => "authCaptureTransaction", "amount" => "5", @@ -1284,4 +1284,4 @@ public function testDecryptPaymentDataRequestError() : void $this->assertTrue($response->isError()); $this->assertEquals('Unable to process decryption', $response->messages->message[0]->text); } -} \ No newline at end of file +} From 009b60162ac0df4789a6b61dd390808412054bed Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 10:33:44 -0400 Subject: [PATCH 065/105] Removed unnecessary parenthesis in ternary operations --- examples/aim/createTransactionRequest_authCapture.php | 4 ++-- examples/aim/createTransactionRequest_authOnly.php | 4 ++-- examples/aim/createTransactionRequest_captureOnly.php | 4 ++-- examples/aim/createTransactionRequest_partialAuth.php | 4 ++-- examples/aim/createTransactionRequest_paypalAuthCapture.php | 4 ++-- .../createTransactionRequest_paypalAuthCaptureContinue.php | 4 ++-- examples/aim/createTransactionRequest_paypalAuthOnly.php | 4 ++-- .../aim/createTransactionRequest_paypalAuthOnlyContinue.php | 4 ++-- examples/aim/createTransactionRequest_paypalGetDetails.php | 4 ++-- .../aim/createTransactionRequest_paypalPriorAuthCapture.php | 4 ++-- examples/aim/createTransactionRequest_paypalRefund.php | 4 ++-- examples/aim/createTransactionRequest_paypalVoid.php | 4 ++-- examples/aim/createTransactionRequest_priorAuthCapture.php | 4 ++-- examples/aim/createTransactionRequest_refund.php | 4 ++-- examples/aim/createTransactionRequest_visaCheckout.php | 4 ++-- examples/aim/createTransactionRequest_void.php | 4 ++-- examples/arb/ARBCancelSubscriptionRequest.php | 4 ++-- examples/arb/ARBCreateSubscriptionRequest.php | 4 ++-- examples/arb/ARBGetSubscriptionStatusRequest.php | 4 ++-- examples/arb/ARBUpdateSubscriptionRequest.php | 4 ++-- examples/cim/createCustomerPaymentProfileRequest.php | 4 ++-- examples/cim/createCustomerProfileRequest.php | 4 ++-- .../cim/createCustomerProfileRequestMultiplePayAccounts.php | 4 ++-- .../createCustomerProfileTransactionRequest_authCapture.php | 4 ++-- .../cim/createCustomerProfileTransactionRequest_authOnly.php | 4 ++-- .../createCustomerProfileTransactionRequest_captureOnly.php | 4 ++-- ...eateCustomerProfileTransactionRequest_priorAuthCapture.php | 4 ++-- .../cim/createCustomerProfileTransactionRequest_refund.php | 4 ++-- examples/cim/createCustomerProfileTransactionRequest_void.php | 4 ++-- examples/cim/createCustomerShippingAddressRequest.php | 4 ++-- examples/cim/deleteCustomerPaymentProfileRequest.php | 4 ++-- examples/cim/deleteCustomerProfileRequest.php | 4 ++-- examples/cim/deleteCustomerShippingAddressRequest.php | 4 ++-- examples/cim/getCustomerPaymentProfileRequest.php | 4 ++-- examples/cim/getCustomerProfileIdsRequest.php | 4 ++-- examples/cim/getCustomerProfileRequest.php | 4 ++-- examples/cim/getCustomerShippingAddressRequest.php | 4 ++-- examples/cim/getHostedProfilePageRequest.php | 4 ++-- examples/cim/updateCustomerPaymentProfileRequest.php | 4 ++-- examples/cim/updateCustomerProfileRequest.php | 4 ++-- examples/cim/updateCustomerShippingAddressRequest.php | 4 ++-- examples/cim/updateSplitTenderGroupRequest.php | 4 ++-- examples/cim/validateCustomerPaymentProfileRequest.php | 4 ++-- examples/reporting/getBatchStatisticsRequest.php | 4 ++-- examples/reporting/getSettledBatchListRequest.php | 4 ++-- examples/reporting/getTransactionDetailsRequest.php | 4 ++-- examples/reporting/getTransactionListRequest.php | 4 ++-- examples/reporting/getUnsettledTransactionListRequest.php | 4 ++-- 48 files changed, 96 insertions(+), 96 deletions(-) diff --git a/examples/aim/createTransactionRequest_authCapture.php b/examples/aim/createTransactionRequest_authCapture.php index 493cee1..e67197f 100644 --- a/examples/aim/createTransactionRequest_authCapture.php +++ b/examples/aim/createTransactionRequest_authCapture.php @@ -315,11 +315,11 @@
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
transId
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
transId
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
transId
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
transId
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>

diff --git a/examples/arb/ARBCreateSubscriptionRequest.php b/examples/arb/ARBCreateSubscriptionRequest.php index d8d66a5..8aef0c1 100644 --- a/examples/arb/ARBCreateSubscriptionRequest.php +++ b/examples/arb/ARBCreateSubscriptionRequest.php @@ -127,11 +127,11 @@

Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Code
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Status
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/createCustomerPaymentProfileRequest.php b/examples/cim/createCustomerPaymentProfileRequest.php index ee3b8d1..3274c84 100644 --- a/examples/cim/createCustomerPaymentProfileRequest.php +++ b/examples/cim/createCustomerPaymentProfileRequest.php @@ -116,11 +116,11 @@

Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
customerProfileId
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Code
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Code
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>
Transaction ID
Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php index 7153432..797ea61 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php +++ b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php @@ -158,11 +158,11 @@

Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php index bae970d..ee5bdb7 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php +++ b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php @@ -142,11 +142,11 @@

Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/createCustomerProfileTransactionRequest_refund.php b/examples/cim/createCustomerProfileTransactionRequest_refund.php index 5db65c0..7d41882 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_refund.php +++ b/examples/cim/createCustomerProfileTransactionRequest_refund.php @@ -154,11 +154,11 @@

Successful?isSuccessful()) ? 'yes' : 'no'; ?>isSuccessful() ? 'yes' : 'no'; ?>
Error?isError()) ? 'yes' : 'no'; ?>isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/createCustomerProfileTransactionRequest_void.php b/examples/cim/createCustomerProfileTransactionRequest_void.php index 30fc089..5856594 100644 --- a/examples/cim/createCustomerProfileTransactionRequest_void.php +++ b/examples/cim/createCustomerProfileTransactionRequest_void.php @@ -88,11 +88,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/createCustomerShippingAddressRequest.php b/examples/cim/createCustomerShippingAddressRequest.php index ae5d65a..269cf7c 100644 --- a/examples/cim/createCustomerShippingAddressRequest.php +++ b/examples/cim/createCustomerShippingAddressRequest.php @@ -96,11 +96,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> customerAddressId diff --git a/examples/cim/deleteCustomerPaymentProfileRequest.php b/examples/cim/deleteCustomerPaymentProfileRequest.php index 6390a9b..cd681fd 100644 --- a/examples/cim/deleteCustomerPaymentProfileRequest.php +++ b/examples/cim/deleteCustomerPaymentProfileRequest.php @@ -73,11 +73,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/deleteCustomerProfileRequest.php b/examples/cim/deleteCustomerProfileRequest.php index e3bacac..721f8f5 100644 --- a/examples/cim/deleteCustomerProfileRequest.php +++ b/examples/cim/deleteCustomerProfileRequest.php @@ -71,11 +71,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/deleteCustomerShippingAddressRequest.php b/examples/cim/deleteCustomerShippingAddressRequest.php index 3e3e479..60705a6 100644 --- a/examples/cim/deleteCustomerShippingAddressRequest.php +++ b/examples/cim/deleteCustomerShippingAddressRequest.php @@ -73,11 +73,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/getCustomerPaymentProfileRequest.php b/examples/cim/getCustomerPaymentProfileRequest.php index be80db8..61cd341 100644 --- a/examples/cim/getCustomerPaymentProfileRequest.php +++ b/examples/cim/getCustomerPaymentProfileRequest.php @@ -92,11 +92,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> firstName diff --git a/examples/cim/getCustomerProfileIdsRequest.php b/examples/cim/getCustomerProfileIdsRequest.php index f392b60..a1eafc5 100644 --- a/examples/cim/getCustomerProfileIdsRequest.php +++ b/examples/cim/getCustomerProfileIdsRequest.php @@ -156,11 +156,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> Profile IDs diff --git a/examples/cim/getCustomerProfileRequest.php b/examples/cim/getCustomerProfileRequest.php index 04bf3a7..fdeac98 100644 --- a/examples/cim/getCustomerProfileRequest.php +++ b/examples/cim/getCustomerProfileRequest.php @@ -122,11 +122,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> merchantCustomerId diff --git a/examples/cim/getCustomerShippingAddressRequest.php b/examples/cim/getCustomerShippingAddressRequest.php index 3018013..f00b69e 100644 --- a/examples/cim/getCustomerShippingAddressRequest.php +++ b/examples/cim/getCustomerShippingAddressRequest.php @@ -83,11 +83,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> firstName diff --git a/examples/cim/getHostedProfilePageRequest.php b/examples/cim/getHostedProfilePageRequest.php index a212fd5..18ed9b2 100644 --- a/examples/cim/getHostedProfilePageRequest.php +++ b/examples/cim/getHostedProfilePageRequest.php @@ -92,11 +92,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> token diff --git a/examples/cim/updateCustomerPaymentProfileRequest.php b/examples/cim/updateCustomerPaymentProfileRequest.php index 581fec0..303d55f 100644 --- a/examples/cim/updateCustomerPaymentProfileRequest.php +++ b/examples/cim/updateCustomerPaymentProfileRequest.php @@ -113,11 +113,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/updateCustomerProfileRequest.php b/examples/cim/updateCustomerProfileRequest.php index 04603dc..97a9638 100644 --- a/examples/cim/updateCustomerProfileRequest.php +++ b/examples/cim/updateCustomerProfileRequest.php @@ -81,11 +81,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/updateCustomerShippingAddressRequest.php b/examples/cim/updateCustomerShippingAddressRequest.php index 8dbe236..54907aa 100644 --- a/examples/cim/updateCustomerShippingAddressRequest.php +++ b/examples/cim/updateCustomerShippingAddressRequest.php @@ -97,11 +97,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/updateSplitTenderGroupRequest.php b/examples/cim/updateSplitTenderGroupRequest.php index 8285025..c457f3b 100644 --- a/examples/cim/updateSplitTenderGroupRequest.php +++ b/examples/cim/updateSplitTenderGroupRequest.php @@ -73,11 +73,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?>

diff --git a/examples/cim/validateCustomerPaymentProfileRequest.php b/examples/cim/validateCustomerPaymentProfileRequest.php index e32fd50..201194a 100644 --- a/examples/cim/validateCustomerPaymentProfileRequest.php +++ b/examples/cim/validateCustomerPaymentProfileRequest.php @@ -78,11 +78,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?>

diff --git a/examples/reporting/getBatchStatisticsRequest.php b/examples/reporting/getBatchStatisticsRequest.php index 1ad6388..700c3d7 100644 --- a/examples/reporting/getBatchStatisticsRequest.php +++ b/examples/reporting/getBatchStatisticsRequest.php @@ -111,11 +111,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> Batch diff --git a/examples/reporting/getSettledBatchListRequest.php b/examples/reporting/getSettledBatchListRequest.php index 730a815..92fbb48 100644 --- a/examples/reporting/getSettledBatchListRequest.php +++ b/examples/reporting/getSettledBatchListRequest.php @@ -201,11 +201,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> batchList as $batch) : ?> diff --git a/examples/reporting/getTransactionDetailsRequest.php b/examples/reporting/getTransactionDetailsRequest.php index 0132d98..836e2aa 100644 --- a/examples/reporting/getTransactionDetailsRequest.php +++ b/examples/reporting/getTransactionDetailsRequest.php @@ -132,11 +132,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> Transaction diff --git a/examples/reporting/getTransactionListRequest.php b/examples/reporting/getTransactionListRequest.php index fe1a35d..dffff97 100644 --- a/examples/reporting/getTransactionListRequest.php +++ b/examples/reporting/getTransactionListRequest.php @@ -94,11 +94,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> transactions as $transaction) : ?> diff --git a/examples/reporting/getUnsettledTransactionListRequest.php b/examples/reporting/getUnsettledTransactionListRequest.php index ab4cd2f..ffbb7e1 100644 --- a/examples/reporting/getUnsettledTransactionListRequest.php +++ b/examples/reporting/getUnsettledTransactionListRequest.php @@ -121,11 +121,11 @@ Successful? - isSuccessful()) ? 'yes' : 'no'; ?> + isSuccessful() ? 'yes' : 'no'; ?> Error? - isError()) ? 'yes' : 'no'; ?> + isError() ? 'yes' : 'no'; ?> transactions as $transaction) : ?> From b0daa39b10db9e2a08e5a14af1290a806345e05e Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 14:01:20 -0400 Subject: [PATCH 066/105] Minor cleanup --- src/authnet/AuthnetApiFactory.php | 1 - src/authnet/AuthnetSim.php | 1 - src/exceptions/AuthnetCannotSetParamsException.php | 4 ++-- src/exceptions/AuthnetCurlException.php | 3 +-- src/exceptions/AuthnetException.php | 3 +-- src/exceptions/AuthnetInvalidAmountException.php | 3 +-- src/exceptions/AuthnetInvalidCredentialsException.php | 3 +-- src/exceptions/AuthnetInvalidJsonException.php | 3 +-- src/exceptions/AuthnetInvalidServerException.php | 3 +-- src/exceptions/AuthnetTransactionResponseCallException.php | 3 +-- 10 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index d5f9db2..8ee4e50 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -20,7 +20,6 @@ * Factory to instantiate an instance of an AuthnetJson object with the proper endpoint * URL and Processor Class. * - * @package AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 diff --git a/src/authnet/AuthnetSim.php b/src/authnet/AuthnetSim.php index f7b5a07..1c53060 100644 --- a/src/authnet/AuthnetSim.php +++ b/src/authnet/AuthnetSim.php @@ -17,7 +17,6 @@ /** * Wrapper to simplify the creation of SIM data * - * @package AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 diff --git a/src/exceptions/AuthnetCannotSetParamsException.php b/src/exceptions/AuthnetCannotSetParamsException.php index b838fac..e921f46 100644 --- a/src/exceptions/AuthnetCannotSetParamsException.php +++ b/src/exceptions/AuthnetCannotSetParamsException.php @@ -17,7 +17,7 @@ /** * Exception that is throw when when client code attempts to set a parameter directly (i.e. using __set()) * - * @package AuthnetJSON + * echo $response->isError() AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 @@ -25,7 +25,7 @@ */ class AuthnetCannotSetParamsException extends AuthnetException { - public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetCurlException.php b/src/exceptions/AuthnetCurlException.php index 14e1476..8193102 100644 --- a/src/exceptions/AuthnetCurlException.php +++ b/src/exceptions/AuthnetCurlException.php @@ -15,7 +15,6 @@ /** * Exception that is throw when cURL experiences an unexpected error * - * @package AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 @@ -23,7 +22,7 @@ */ class AuthnetCurlException extends AuthnetException { - public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetException.php b/src/exceptions/AuthnetException.php index 09ecaf5..053e512 100644 --- a/src/exceptions/AuthnetException.php +++ b/src/exceptions/AuthnetException.php @@ -15,7 +15,6 @@ /** * Generic Exception that may be thrown whenever an unexpect error occurs using the AuthnetJson class * - * @package AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 @@ -23,7 +22,7 @@ */ class AuthnetException extends \Exception { - public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetInvalidAmountException.php b/src/exceptions/AuthnetInvalidAmountException.php index b4e2ca9..ef51c18 100644 --- a/src/exceptions/AuthnetInvalidAmountException.php +++ b/src/exceptions/AuthnetInvalidAmountException.php @@ -15,7 +15,6 @@ /** * Exception that is thrown when invalid amount to pay is provided for a SIM transaction * - * @package AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 @@ -23,7 +22,7 @@ */ class AuthnetInvalidAmountException extends AuthnetException { - public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetInvalidCredentialsException.php b/src/exceptions/AuthnetInvalidCredentialsException.php index 599e5dc..00f2432 100644 --- a/src/exceptions/AuthnetInvalidCredentialsException.php +++ b/src/exceptions/AuthnetInvalidCredentialsException.php @@ -15,7 +15,6 @@ /** * Exception that is throw when invalid Authorize.Net API credentials are provided * - * @package AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 @@ -23,7 +22,7 @@ */ class AuthnetInvalidCredentialsException extends AuthnetException { - public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetInvalidJsonException.php b/src/exceptions/AuthnetInvalidJsonException.php index b0a5c36..966d2bb 100644 --- a/src/exceptions/AuthnetInvalidJsonException.php +++ b/src/exceptions/AuthnetInvalidJsonException.php @@ -15,7 +15,6 @@ /** * Exception that is throw when invalid JSON is returned by the API * - * @package AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 @@ -23,7 +22,7 @@ */ class AuthnetInvalidJsonException extends AuthnetException { - public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetInvalidServerException.php b/src/exceptions/AuthnetInvalidServerException.php index 4417230..abcfaee 100644 --- a/src/exceptions/AuthnetInvalidServerException.php +++ b/src/exceptions/AuthnetInvalidServerException.php @@ -16,7 +16,6 @@ * Exception that is throw when an invalid value is given for the $server paramater when * initiating an instance of the AuthnetJson class * - * @package AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 @@ -24,7 +23,7 @@ */ class AuthnetInvalidServerException extends AuthnetException { - public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetTransactionResponseCallException.php b/src/exceptions/AuthnetTransactionResponseCallException.php index 57cc2a1..2b3251b 100644 --- a/src/exceptions/AuthnetTransactionResponseCallException.php +++ b/src/exceptions/AuthnetTransactionResponseCallException.php @@ -15,7 +15,6 @@ /** * Exception that is throw when transaction response data is requested on an API call that does not return any * - * @package AuthnetJSON * @author John Conde * @copyright John Conde * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 @@ -23,7 +22,7 @@ */ class AuthnetTransactionResponseCallException extends AuthnetException { - public function __construct(string $message = "", int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) { parent::__construct($message, $code, $previous); } From c33fc77dee0253d5de9d83ea52f4def34d3523e2 Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 14:06:57 -0400 Subject: [PATCH 067/105] Reduced complexity of AuthnetJsonRequest::process() by breaking out request and retry logic into its own method --- src/authnet/AuthnetJsonRequest.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php index 2bda07d..ab542e3 100644 --- a/src/authnet/AuthnetJsonRequest.php +++ b/src/authnet/AuthnetJsonRequest.php @@ -171,12 +171,9 @@ public function __call($api_call, Array $args) } /** - * Tells the handler to make the API call to Authorize.Net - * - * @return string JSON string containing API response - * @throws AuthnetCurlException + * Makes POST request with retry logic. */ - private function process() : string + private function makeRequest() : void { $retries = 0; while ($retries < self::MAX_RETRIES) { @@ -186,6 +183,17 @@ private function process() : string } $retries++; } + } + + /** + * Tells the handler to make the API call to Authorize.Net + * + * @return string JSON string containing API response + * @throws AuthnetCurlException + */ + private function process() : string + { + $this->makeRequest(); if (!$this->processor->error && isset($this->processor->response)) { return $this->processor->response; } From 50101277b7f6e2c218d204036db27f2c15d67204 Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 14:10:42 -0400 Subject: [PATCH 068/105] Minor cleanup --- src/authnet/AuthnetApiFactory.php | 2 +- src/authnet/AuthnetJson.php | 1 + src/authnet/AuthnetJsonRequest.php | 1 + src/authnet/AuthnetJsonResponse.php | 1 + src/authnet/AuthnetSim.php | 2 +- src/authnet/AuthnetWebhook.php | 1 + src/authnet/AuthnetWebhooksRequest.php | 1 + src/authnet/AuthnetWebhooksResponse.php | 1 + src/authnet/TransactionResponse.php | 1 + src/exceptions/AuthnetCannotSetParamsException.php | 1 + src/exceptions/AuthnetCurlException.php | 1 + src/exceptions/AuthnetException.php | 1 + src/exceptions/AuthnetInvalidAmountException.php | 1 + src/exceptions/AuthnetInvalidCredentialsException.php | 1 + src/exceptions/AuthnetInvalidJsonException.php | 1 + src/exceptions/AuthnetInvalidServerException.php | 1 + src/exceptions/AuthnetTransactionResponseCallException.php | 1 + 17 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index 8ee4e50..34c772e 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -1,4 +1,5 @@ Date: Fri, 21 Jun 2019 15:36:00 -0400 Subject: [PATCH 069/105] Removed unneeded reference to config file in unit tests --- tests/AuthnetApiFactoryTest.php | 4 +--- tests/AuthnetJsonAimPaypalTest.php | 4 +--- tests/AuthnetJsonAimTest.php | 2 -- tests/AuthnetJsonArbTest.php | 4 +--- tests/AuthnetJsonCimTest.php | 4 +--- tests/AuthnetJsonReportingTest.php | 4 +--- tests/AuthnetJsonRequestTest.php | 4 +--- tests/AuthnetWebhooksRequestTest.php | 2 -- 8 files changed, 6 insertions(+), 22 deletions(-) diff --git a/tests/AuthnetApiFactoryTest.php b/tests/AuthnetApiFactoryTest.php index ca127dd..333f407 100644 --- a/tests/AuthnetApiFactoryTest.php +++ b/tests/AuthnetApiFactoryTest.php @@ -13,8 +13,6 @@ use PHPUnit\Framework\TestCase; -require(__DIR__ . '/../config.inc.php'); - class AuthnetApiFactoryTest extends TestCase { private $login; @@ -321,4 +319,4 @@ public function testGetWebhooksUrlBadServer() : void $reflectionMethod->setAccessible(true); $reflectionMethod->invoke(null, $server); } -} \ No newline at end of file +} diff --git a/tests/AuthnetJsonAimPaypalTest.php b/tests/AuthnetJsonAimPaypalTest.php index cf024e4..40a8246 100644 --- a/tests/AuthnetJsonAimPaypalTest.php +++ b/tests/AuthnetJsonAimPaypalTest.php @@ -13,8 +13,6 @@ use PHPUnit\Framework\TestCase; -require(__DIR__ . '/../config.inc.php'); - class AuthnetJsonAimPaypalTest extends TestCase { private $login; @@ -728,4 +726,4 @@ public function testCreateTransactionRequestRefundError() : void $this->assertEquals('54', $response->transactionResponse->errors[0]->errorCode); $this->assertEquals('The referenced transaction does not meet the criteria for issuing a credit.', $response->transactionResponse->errors[0]->errorText); } -} \ No newline at end of file +} diff --git a/tests/AuthnetJsonAimTest.php b/tests/AuthnetJsonAimTest.php index 416efad..1f26db3 100644 --- a/tests/AuthnetJsonAimTest.php +++ b/tests/AuthnetJsonAimTest.php @@ -13,8 +13,6 @@ use PHPUnit\Framework\TestCase; -require(__DIR__ . '/../config.inc.php'); - class AuthnetJsonAimTest extends TestCase { private $login; diff --git a/tests/AuthnetJsonArbTest.php b/tests/AuthnetJsonArbTest.php index a613164..1607fb9 100644 --- a/tests/AuthnetJsonArbTest.php +++ b/tests/AuthnetJsonArbTest.php @@ -13,8 +13,6 @@ use PHPUnit\Framework\TestCase; -require(__DIR__ . '/../config.inc.php'); - class AuthnetJsonArbTest extends TestCase { private $login; @@ -468,4 +466,4 @@ public function testARBUpdateSubscriptionRequestError() : void $this->assertEquals('E00037', $response->messages->message[0]->code); $this->assertEquals('Subscriptions that are canceled cannot be updated.', $response->messages->message[0]->text); } -} \ No newline at end of file +} diff --git a/tests/AuthnetJsonCimTest.php b/tests/AuthnetJsonCimTest.php index 3187b6b..6ba3dde 100644 --- a/tests/AuthnetJsonCimTest.php +++ b/tests/AuthnetJsonCimTest.php @@ -13,8 +13,6 @@ use PHPUnit\Framework\TestCase; -require(__DIR__ . '/../config.inc.php'); - class AuthnetJsonCimTest extends TestCase { private $login; @@ -1967,4 +1965,4 @@ public function testGetHostedProfilePageRequest() : void $this->assertEquals('Successful.', $response->messages->message[0]->text); $this->assertEquals('Mvwo9mTx2vS332eCFY3rFzh/x1x64henm7rppLYQxd2cOzNpw+bfp1ZTVKvu98XSIvL9VIEB65mCFtzchN/pFKBdBA0daBukS27pWYxZuo6QpBUpz2p6zLENX8qH9wCcAw6EJr0MZkNttPW6b+Iw9eKfcBtJayq6kdNm9m1ywANHsg9xME4qUccBXnY2cCf3kLaaLNJhhiNxJmcboKNlDn5HtIQ/wcRnxB4YbqddTN8=', $response->token); } -} \ No newline at end of file +} diff --git a/tests/AuthnetJsonReportingTest.php b/tests/AuthnetJsonReportingTest.php index 3168c7b..f435a13 100644 --- a/tests/AuthnetJsonReportingTest.php +++ b/tests/AuthnetJsonReportingTest.php @@ -13,8 +13,6 @@ use PHPUnit\Framework\TestCase; -require(__DIR__ . '/../config.inc.php'); - class AuthnetJsonReportingTest extends TestCase { private $login; @@ -688,4 +686,4 @@ public function testGetTransactionDetailsRequestSuccess() : void $this->assertEquals('Card Not Present', $response->transaction->product); $this->assertEquals('eCommerce', $response->transaction->marketType); } -} \ No newline at end of file +} diff --git a/tests/AuthnetJsonRequestTest.php b/tests/AuthnetJsonRequestTest.php index 58cdebc..b788040 100644 --- a/tests/AuthnetJsonRequestTest.php +++ b/tests/AuthnetJsonRequestTest.php @@ -13,8 +13,6 @@ use PHPUnit\Framework\TestCase; -require(__DIR__ . '/../config.inc.php'); - class AuthnetJsonRequestTest extends TestCase { /** @@ -327,4 +325,4 @@ public function testProcessError() : void $request->setProcessHandler($http); $request->deleteCustomerProfileRequest([]); } -} \ No newline at end of file +} diff --git a/tests/AuthnetWebhooksRequestTest.php b/tests/AuthnetWebhooksRequestTest.php index 67675ba..cee635c 100644 --- a/tests/AuthnetWebhooksRequestTest.php +++ b/tests/AuthnetWebhooksRequestTest.php @@ -13,8 +13,6 @@ use PHPUnit\Framework\TestCase; -require(__DIR__ . '/../config.inc.php'); - class AuthnetWebhooksRequestTest extends TestCase { private $login; From 5a7d7c34aac2cd56c920569ef1dfe51b6abdd493 Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 16:10:55 -0400 Subject: [PATCH 070/105] Made @param type more specific --- src/authnet/AuthnetJsonRequest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php index 9f60143..888382f 100644 --- a/src/authnet/AuthnetJsonRequest.php +++ b/src/authnet/AuthnetJsonRequest.php @@ -13,6 +13,8 @@ namespace JohnConde\Authnet; +use \Curl\Curl; + /** * Creates a request to the Authorize.Net JSON endpoints * @@ -210,7 +212,7 @@ private function process() : string /** * Sets the handler to be used to handle our API call. Mainly used for unit testing as Curl is used by default. * - * @param object $processor + * @param Curl $processor */ public function setProcessHandler($processor) : void { From f4f35970d336512c8b5702f68fbbd5a02a81e35b Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 16:11:16 -0400 Subject: [PATCH 071/105] Added code coverage badge --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f848377..8fa4e0e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ [![Latest Stable Version](https://poser.pugx.org/stymiee/authnetjson/v/stable.svg)](https://packagist.org/packages/stymiee/authnetjson) [![Total Downloads](https://poser.pugx.org/stymiee/authnetjson/downloads)](https://packagist.org/packages/stymiee/authnetjson) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/stymiee/authnetjson/?branch=master) -[![Build Status](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/build.png?b=master)](https://scrutinizer-ci.com/g/stymiee/authnetjson/build-status/master) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/stymiee/authnetjson/?branch=php72) +[![Build Status](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/build.png?b=master)](https://scrutinizer-ci.com/g/stymiee/authnetjson/build-status/php72) +[![Code Coverage](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/coverage.png?b=php72)](https://scrutinizer-ci.com/g/stymiee/authnetjson/?branch=php72) [![Maintainability](https://api.codeclimate.com/v1/badges/5847da924af47933e25f/maintainability)](https://codeclimate.com/github/stymiee/authnetjson/maintainability) [![License](https://poser.pugx.org/stymiee/authnetjson/license)](https://packagist.org/packages/stymiee/authnetjson) # AuthnetJSON From fedf26ffe298b6b209aee9143ef47944cbbda29c Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 16:14:17 -0400 Subject: [PATCH 072/105] Updated --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 0506ef4..ce7f732 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ Added support for prepaid cards Added constructor to Authnet exceptions Removed unused AuthnetInvalidParameterException class Updated unit tests for phpunit 8 +Removed unneeded require of config file in unit tests Added phpunit to require-dev Shiny badges for the README Cleaned up HTML and CSS in examples From 9de706b2c6325fe237a64ec5db3036b6395f9620 Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 21:13:38 -0400 Subject: [PATCH 073/105] Fixed default server parameters defaulting correctly. Minor code clean up. --- src/authnet/AuthnetApiFactory.php | 88 ++++++++++++++++--------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index 34c772e..a4f0095 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -21,11 +21,11 @@ * Factory to instantiate an instance of an AuthnetJson object with the proper endpoint * URL and Processor Class. * - * @author John Conde - * @copyright John Conde - * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 + * @author John Conde + * @copyright John Conde + * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 * - * @link https://github.com/stymiee/authnetjson + * @link https://github.com/stymiee/authnetjson */ class AuthnetApiFactory { @@ -45,17 +45,17 @@ class AuthnetApiFactory public const USE_AKAMAI_SERVER = 2; /** - Validates the Authorize.Net credentials and returns a Request object to be used to make an API call + * Validates the Authorize.Net credentials and returns a Request object to be used to make an API call. * - * @param string $login Authorize.Net API Login ID - * @param string $transaction_key Authorize.Net API Transaction Key - * @param integer $server ID of which server to use (optional) - * @return AuthnetJsonRequest - * @throws ErrorException - * @throws AuthnetInvalidCredentialsException - * @throws AuthnetInvalidServerException + * @param string $login Authorize.Net API Login ID + * @param string $transaction_key Authorize.Net API Transaction Key + * @param integer $server ID of which server to use (optional) + * @return AuthnetJsonRequest + * @throws ErrorException + * @throws AuthnetInvalidCredentialsException + * @throws AuthnetInvalidServerException */ - public static function getJsonApiHandler(string $login, string $transaction_key, ?int $server) : object + public static function getJsonApiHandler(string $login, string $transaction_key, ?int $server = null) : object { $login = trim($login); $transaction_key = trim($transaction_key); @@ -81,16 +81,16 @@ public static function getJsonApiHandler(string $login, string $transaction_key, /** * Gets the API endpoint to be used for a JSON API call * - * @param integer $server ID of which server to use - * @return string The URL endpoint the request is to be sent to - * @throws AuthnetInvalidServerException + * @param integer $server ID of which server to use + * @return string The URL endpoint the request is to be sent to + * @throws AuthnetInvalidServerException */ protected static function getWebServiceURL(int $server) : string { $urls = [ static::USE_PRODUCTION_SERVER => 'https://api.authorize.net/xml/v1/request.api', static::USE_DEVELOPMENT_SERVER => 'https://apitest.authorize.net/xml/v1/request.api', - static::USE_AKAMAI_SERVER => 'https://api2.authorize.net/xml/v1/request.api' + static::USE_AKAMAI_SERVER => 'https://api2.authorize.net/xml/v1/request.api', ]; if (array_key_exists($server, $urls)) { return $urls[$server]; @@ -99,20 +99,21 @@ protected static function getWebServiceURL(int $server) : string } /** - * Validates the Authorize.Net credentials and returns a SIM object to be used to make a SIM API call + * Validates the Authorize.Net credentials and returns a SIM object to be used to make a SIM API call. * - * @param string $login Authorize.Net API Login ID - * @param string $transaction_key Authorize.Net API Transaction Key - * @param integer $server ID of which server to use (optional) - * @return AuthnetSim - * @throws AuthnetInvalidCredentialsException - * @throws AuthnetInvalidServerException - * @throws Exception + * @param string $login Authorize.Net API Login ID + * @param string $transaction_key Authorize.Net API Transaction Key + * @param integer $server ID of which server to use (optional) + * @return AuthnetSim + * @throws AuthnetInvalidCredentialsException + * @throws AuthnetInvalidServerException + * @throws Exception */ - public static function getSimHandler(string $login, string $transaction_key, $server = self::USE_PRODUCTION_SERVER) : object + public static function getSimHandler(string $login, string $transaction_key, ?int $server = null) : object { $login = trim($login); $transaction_key = trim($transaction_key); + $server = $server ?? self::USE_PRODUCTION_SERVER; $api_url = static::getSimURL($server); if (empty($login) || empty($transaction_key)) { @@ -123,11 +124,11 @@ public static function getSimHandler(string $login, string $transaction_key, $se } /** - * Gets the API endpoint to be used for a SIM API call + * Gets the API endpoint to be used for a SIM API call. * - * @param integer $server ID of which server to use - * @return string The URL endpoint the request is to be sent to - * @throws AuthnetInvalidServerException + * @param integer $server ID of which server to use + * @return string The URL endpoint the request is to be sent to + * @throws AuthnetInvalidServerException */ protected static function getSimURL(int $server) : string { @@ -142,20 +143,21 @@ protected static function getSimURL(int $server) : string } /** - * Validates the Authorize.Net credentials and returns a Webhooks Request object to be used to make an Webhook call + * Validates the Authorize.Net credentials and returns a Webhooks Request object to be used to make an Webhook call. * - * @param string $login Authorize.Net API Login ID - * @param string $transaction_key Authorize.Net API Transaction Key - * @param integer $server ID of which server to use (optional) - * @throws ErrorException - * @return AuthnetWebhooksRequest - * @throws AuthnetInvalidCredentialsException - * @throws AuthnetInvalidServerException + * @param string $login Authorize.Net API Login ID + * @param string $transaction_key Authorize.Net API Transaction Key + * @param integer $server ID of which server to use (optional) + * @throws ErrorException + * @return AuthnetWebhooksRequest + * @throws AuthnetInvalidCredentialsException + * @throws AuthnetInvalidServerException */ - public static function getWebhooksHandler(string $login, string $transaction_key, $server = self::USE_PRODUCTION_SERVER) : object + public static function getWebhooksHandler(string $login, string $transaction_key, ?int $server = null) : object { $login = trim($login); $transaction_key = trim($transaction_key); + $server = $server ?? self::USE_PRODUCTION_SERVER; $api_url = static::getWebhooksURL($server); if (empty($login) || empty($transaction_key)) { @@ -178,11 +180,11 @@ public static function getWebhooksHandler(string $login, string $transaction_key } /** - * Gets the API endpoint to be used for a SIM API call + * Gets the API endpoint to be used for a SIM API call. * - * @param integer $server ID of which server to use - * @return string The URL endpoint the request is to be sent to - * @throws AuthnetInvalidServerException + * @param integer $server ID of which server to use + * @return string The URL endpoint the request is to be sent to + * @throws AuthnetInvalidServerException */ protected static function getWebhooksURL(int $server) : string { From 94f5a4f0e53b980a93c90b52726f75b38d235283 Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 21:14:29 -0400 Subject: [PATCH 074/105] Made test pass more consistently (resolved formatting issues) --- tests/AuthnetJsonResponseTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/AuthnetJsonResponseTest.php b/tests/AuthnetJsonResponseTest.php index a68926c..074ed2b 100644 --- a/tests/AuthnetJsonResponseTest.php +++ b/tests/AuthnetJsonResponseTest.php @@ -268,10 +268,12 @@ public function testGetRawResponse() : void ] } }'; + $responseJson = json_encode(json_decode($responseJson, false)); $response = new AuthnetJsonResponse($responseJson); + $response = json_encode(json_decode($response->getRawResponse(), false)); - $this->assertSame(str_replace("\n", '', $responseJson), $response->getRawResponse()); + $this->assertSame($responseJson, $response); } From 6968257a64e3c1db735e7369b9a90626a581890c Mon Sep 17 00:00:00 2001 From: John Conde Date: Fri, 21 Jun 2019 21:16:14 -0400 Subject: [PATCH 075/105] Minor cleanup --- src/authnet/AuthnetApiFactory.php | 2 +- src/authnet/AuthnetJson.php | 2 +- src/authnet/AuthnetJsonRequest.php | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php index a4f0095..94d7a96 100644 --- a/src/authnet/AuthnetApiFactory.php +++ b/src/authnet/AuthnetApiFactory.php @@ -79,7 +79,7 @@ public static function getJsonApiHandler(string $login, string $transaction_key, } /** - * Gets the API endpoint to be used for a JSON API call + * Gets the API endpoint to be used for a JSON API call. * * @param integer $server ID of which server to use * @return string The URL endpoint the request is to be sent to diff --git a/src/authnet/AuthnetJson.php b/src/authnet/AuthnetJson.php index b00dd2f..eaf126d 100644 --- a/src/authnet/AuthnetJson.php +++ b/src/authnet/AuthnetJson.php @@ -14,7 +14,7 @@ namespace JohnConde\Authnet; /** - * Contains constant values + * Contains constant values. * * @package AuthnetJSON * @author John Conde diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php index 888382f..2977638 100644 --- a/src/authnet/AuthnetJsonRequest.php +++ b/src/authnet/AuthnetJsonRequest.php @@ -16,7 +16,7 @@ use \Curl\Curl; /** - * Creates a request to the Authorize.Net JSON endpoints + * Creates a request to the Authorize.Net JSON endpoints. * * @package AuthnetJSON * @author John Conde @@ -93,7 +93,7 @@ class AuthnetJsonRequest /** * Creates the request object by setting the Authorize.Net credentials and URL of the endpoint to be used - * for the API call + * for the API call. * * @param string $login Authorize.Net API login ID * @param string $transactionKey Authorize.Net API Transaction Key @@ -144,7 +144,7 @@ public function __set($name, $value) /** * Magic method that dynamically creates our API call based on the name of the method in the client code and - * the array passed as its parameter + * the array passed as its parameter. * * @param string $api_call name of the API call to be made * @param array $args the array to be passed to the API @@ -189,7 +189,7 @@ private function makeRequest() : void } /** - * Tells the handler to make the API call to Authorize.Net + * Tells the handler to make the API call to Authorize.Net. * * @return string JSON string containing API response * @throws AuthnetCurlException @@ -220,7 +220,7 @@ public function setProcessHandler($processor) : void } /** - * Gets the request sent to Authorize.Net in JSON format for logging purposes + * Gets the request sent to Authorize.Net in JSON format for logging purposes. * * @return string transaction request sent to Authorize.Net in JSON format */ From 9f460c91c62230d5b3d35bfae660f7409888d8d2 Mon Sep 17 00:00:00 2001 From: John Conde Date: Sat, 27 Jul 2019 09:05:15 -0400 Subject: [PATCH 076/105] Used import for Throwable type hint --- src/exceptions/AuthnetCannotSetParamsException.php | 2 +- src/exceptions/AuthnetCurlException.php | 4 +++- src/exceptions/AuthnetException.php | 4 +++- src/exceptions/AuthnetInvalidAmountException.php | 4 +++- src/exceptions/AuthnetInvalidCredentialsException.php | 4 +++- src/exceptions/AuthnetInvalidJsonException.php | 4 +++- src/exceptions/AuthnetInvalidServerException.php | 4 +++- src/exceptions/AuthnetTransactionResponseCallException.php | 4 +++- 8 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/exceptions/AuthnetCannotSetParamsException.php b/src/exceptions/AuthnetCannotSetParamsException.php index 54af368..65bcd10 100644 --- a/src/exceptions/AuthnetCannotSetParamsException.php +++ b/src/exceptions/AuthnetCannotSetParamsException.php @@ -26,7 +26,7 @@ */ class AuthnetCannotSetParamsException extends AuthnetException { - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetCurlException.php b/src/exceptions/AuthnetCurlException.php index b62f769..7a9abc0 100644 --- a/src/exceptions/AuthnetCurlException.php +++ b/src/exceptions/AuthnetCurlException.php @@ -13,6 +13,8 @@ namespace JohnConde\Authnet; +use Throwable; + /** * Exception that is throw when cURL experiences an unexpected error * @@ -23,7 +25,7 @@ */ class AuthnetCurlException extends AuthnetException { - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetException.php b/src/exceptions/AuthnetException.php index 1bd8209..172e2ff 100644 --- a/src/exceptions/AuthnetException.php +++ b/src/exceptions/AuthnetException.php @@ -13,6 +13,8 @@ namespace JohnConde\Authnet; +use Throwable; + /** * Generic Exception that may be thrown whenever an unexpect error occurs using the AuthnetJson class * @@ -23,7 +25,7 @@ */ class AuthnetException extends \Exception { - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetInvalidAmountException.php b/src/exceptions/AuthnetInvalidAmountException.php index 3d73c7d..ed01a52 100644 --- a/src/exceptions/AuthnetInvalidAmountException.php +++ b/src/exceptions/AuthnetInvalidAmountException.php @@ -13,6 +13,8 @@ namespace JohnConde\Authnet; +use Throwable; + /** * Exception that is thrown when invalid amount to pay is provided for a SIM transaction * @@ -23,7 +25,7 @@ */ class AuthnetInvalidAmountException extends AuthnetException { - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetInvalidCredentialsException.php b/src/exceptions/AuthnetInvalidCredentialsException.php index 2c15465..50acf1a 100644 --- a/src/exceptions/AuthnetInvalidCredentialsException.php +++ b/src/exceptions/AuthnetInvalidCredentialsException.php @@ -13,6 +13,8 @@ namespace JohnConde\Authnet; +use Throwable; + /** * Exception that is throw when invalid Authorize.Net API credentials are provided * @@ -23,7 +25,7 @@ */ class AuthnetInvalidCredentialsException extends AuthnetException { - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetInvalidJsonException.php b/src/exceptions/AuthnetInvalidJsonException.php index cb79238..cded533 100644 --- a/src/exceptions/AuthnetInvalidJsonException.php +++ b/src/exceptions/AuthnetInvalidJsonException.php @@ -13,6 +13,8 @@ namespace JohnConde\Authnet; +use Throwable; + /** * Exception that is throw when invalid JSON is returned by the API * @@ -23,7 +25,7 @@ */ class AuthnetInvalidJsonException extends AuthnetException { - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetInvalidServerException.php b/src/exceptions/AuthnetInvalidServerException.php index b360366..0b1b000 100644 --- a/src/exceptions/AuthnetInvalidServerException.php +++ b/src/exceptions/AuthnetInvalidServerException.php @@ -13,6 +13,8 @@ namespace JohnConde\Authnet; +use Throwable; + /** * Exception that is throw when an invalid value is given for the $server paramater when * initiating an instance of the AuthnetJson class @@ -24,7 +26,7 @@ */ class AuthnetInvalidServerException extends AuthnetException { - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/exceptions/AuthnetTransactionResponseCallException.php b/src/exceptions/AuthnetTransactionResponseCallException.php index 9cac42c..d9c3db6 100644 --- a/src/exceptions/AuthnetTransactionResponseCallException.php +++ b/src/exceptions/AuthnetTransactionResponseCallException.php @@ -13,6 +13,8 @@ namespace JohnConde\Authnet; +use Throwable; + /** * Exception that is throw when transaction response data is requested on an API call that does not return any * @@ -23,7 +25,7 @@ */ class AuthnetTransactionResponseCallException extends AuthnetException { - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); } From caebe57246d10a211b20c4a3488d719503af0de9 Mon Sep 17 00:00:00 2001 From: John Conde Date: Sat, 27 Jul 2019 09:05:33 -0400 Subject: [PATCH 077/105] Minor __toString() HTML cleanup --- src/authnet/AuthnetJsonRequest.php | 10 +++++----- src/authnet/AuthnetJsonResponse.php | 2 +- src/authnet/AuthnetWebhook.php | 4 ++-- src/authnet/AuthnetWebhooksRequest.php | 6 +++--- src/authnet/AuthnetWebhooksResponse.php | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php index 2977638..a1e8581 100644 --- a/src/authnet/AuthnetJsonRequest.php +++ b/src/authnet/AuthnetJsonRequest.php @@ -115,11 +115,11 @@ public function __toString() { $output = ''."\n"; $output .= ''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; + $output .= ''."\n"; + $output .= ''."\n"; + $output .= ''."\n"; + $output .= ''."\n"; + $output .= ''."\n"; if (!empty($this->requestJson)) { $output .= '
Authorize.Net Request
Class Parameters
API Login ID'.$this->login.'
Transaction Key'.$this->transactionKey.'
Authnet Server URL'.$this->url.'
Request JSON
Class Parameters
API Login ID'.$this->login.'
Transaction Key'.$this->transactionKey.'
Authnet Server URL'.$this->url.'
Request JSON
'."\n";
             $output .= $this->requestJson."\n";
diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php
index 4f81af3..17cea45 100644
--- a/src/authnet/AuthnetJsonResponse.php
+++ b/src/authnet/AuthnetJsonResponse.php
@@ -132,7 +132,7 @@ public function __toString()
     {
         $output  = ''."\n";
         $output .= ''."\n";
-        $output .= ''."\n\t\t".''."\n".''."\n";
+        $output .= ''."\n";
         $output .= ''."\n";
diff --git a/src/authnet/AuthnetWebhook.php b/src/authnet/AuthnetWebhook.php
index 806181e..67c3b2f 100644
--- a/src/authnet/AuthnetWebhook.php
+++ b/src/authnet/AuthnetWebhook.php
@@ -80,11 +80,11 @@ public function __toString()
     {
         $output  = '
Authorize.Net Response
Response JSON
Response JSON
'."\n";
         $output .= $this->responseJson."\n";
         $output .= '
'."\n"; $output .= ''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; + $output .= ''."\n"; $output .= ''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; + $output .= ''."\n"; $output .= ''."\n"; diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php index 88caa8a..a4dc973 100644 --- a/src/authnet/AuthnetWebhooksRequest.php +++ b/src/authnet/AuthnetWebhooksRequest.php @@ -67,9 +67,9 @@ public function __toString() { $output = '
Authorize.Net Webhook
Response HTTP Headers
Response HTTP Headers
'."\n";
         $output .= var_export($this->headers)."\n";
         $output .= '
Response JSON
Response JSON
'."\n";
         $output .= $this->webhookJson."\n";
         $output .= '
'."\n"; $output .= ''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; - $output .= ''."\n\t\t".''."\n".''."\n"; + $output .= ''."\n"; + $output .= ''."\n"; + $output .= ''."\n"; if (!empty($this->requestJson)) { $output .= '
Authorize.Net Request
Class Parameters
Authnet Server URL'.$this->url.'
Request JSON
Class Parameters
Authnet Server URL'.$this->url.'
Request JSON
'."\n";
             $output .= $this->requestJson."\n";
diff --git a/src/authnet/AuthnetWebhooksResponse.php b/src/authnet/AuthnetWebhooksResponse.php
index ebcf289..dd475f3 100644
--- a/src/authnet/AuthnetWebhooksResponse.php
+++ b/src/authnet/AuthnetWebhooksResponse.php
@@ -58,7 +58,7 @@ public function __toString()
     {
         $output  = ''."\n";
         $output .= ''."\n";
-        $output .= ''."\n\t\t".''."\n".''."\n";
+        $output .= ''."\n";
         $output .= ''."\n";

From bfafa8bb9b44745f84b40bd946834000736c6ea2 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 3 Nov 2019 12:31:21 -0500
Subject: [PATCH 078/105] Added CONTRIBUTING.md to project

---
 CONTRIBUTING.md | 81 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 CONTRIBUTING.md

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..6546a4d
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,81 @@
+# Contributing
+
+When contributing to this repository, please first discuss the change you wish to make via issue,
+email, or any other method with the owners of this repository before making a change. 
+
+Please note we have a code of conduct, please follow it in all your interactions with the project.
+
+## Code of Conduct
+
+### Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, gender identity and expression, level of experience,
+nationality, personal appearance, race, religion, or sexual identity and
+orientation.
+
+### Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+  address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+  professional setting
+
+### Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+### Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+### Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at stymiee@gmail.com. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+### Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/

From 37354f32f236a8978f79fd247d91723b3efa42cc Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 3 Nov 2019 12:32:04 -0500
Subject: [PATCH 079/105] Added tests for makeRequest()

---
 tests/AuthnetJsonRequestTest.php | 67 +++++++++++++++++++++++++++++---
 1 file changed, 62 insertions(+), 5 deletions(-)

diff --git a/tests/AuthnetJsonRequestTest.php b/tests/AuthnetJsonRequestTest.php
index b788040..24301ad 100644
--- a/tests/AuthnetJsonRequestTest.php
+++ b/tests/AuthnetJsonRequestTest.php
@@ -304,8 +304,8 @@ public function testGetRawRequest() : void
     }
 
     /**
-     * @covers            \JohnConde\Authnet\AuthnetJsonRequest::process()
-     * @covers            \JohnConde\Authnet\AuthnetCurlException::__construct()
+     * @covers \JohnConde\Authnet\AuthnetJsonRequest::process()
+     * @covers \JohnConde\Authnet\AuthnetCurlException::__construct()
      */
     public function testProcessError() : void
     {
@@ -317,12 +317,69 @@ public function testProcessError() : void
         $http = $this->getMockBuilder('\Curl\Curl')
             ->setMethods(['post'])
             ->getMock();
-        $http->error      = true;
-        $http->error_code = 10;
-        $http->error      = 'Test Error Message';
+        $http->error         = true;
+        $http->error_code    = 10;
+        $http->error_message = 'Test Error Message';
 
         $request = AuthnetApiFactory::getJsonApiHandler($apiLogin, $apiTransKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler($http);
         $request->deleteCustomerProfileRequest([]);
     }
+
+    /**
+     * @covers \JohnConde\Authnet\AuthnetJsonRequest::makeRequest()
+     */
+    public function testMakeRequestWithError() : void
+    {
+        $apiLogin    = 'apiLogin';
+        $apiTransKey = 'apiTransKey';
+
+        $http = $this->getMockBuilder('\Curl\Curl')
+            ->setMethods(['post'])
+            ->getMock();
+        $http->error         = true;
+        $http->error_code    = 10;
+        $http->error_message = 'Test Error Message';
+
+        $request = AuthnetApiFactory::getJsonApiHandler($apiLogin, $apiTransKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
+        $request->setProcessHandler($http);
+
+        $method = new \ReflectionMethod('\JohnConde\Authnet\AuthnetJsonRequest', 'makeRequest');
+        $method->setAccessible(true);
+        $method->invoke($request);
+
+        $reflectionOfRequest = new \ReflectionObject($request);
+        $retries = $reflectionOfRequest->getProperty('retries');
+        $retries->setAccessible(true);
+
+        $reflectionOfMaxRetries = new \ReflectionClassConstant('\JohnConde\Authnet\AuthnetJsonRequest', 'MAX_RETRIES');
+
+        $this->assertEquals($reflectionOfMaxRetries->getValue(), $retries->getValue($request));
+    }
+
+    /**
+     * @covers \JohnConde\Authnet\AuthnetJsonRequest::makeRequest()
+     */
+    public function testMakeRequestWithNoError() : void
+    {
+        $apiLogin    = 'apiLogin';
+        $apiTransKey = 'apiTransKey';
+
+        $http = $this->getMockBuilder('\Curl\Curl')
+            ->setMethods(['post'])
+            ->getMock();
+        $http->error         = false;
+
+        $request = AuthnetApiFactory::getJsonApiHandler($apiLogin, $apiTransKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
+        $request->setProcessHandler($http);
+
+        $method = new \ReflectionMethod('\JohnConde\Authnet\AuthnetJsonRequest', 'makeRequest');
+        $method->setAccessible(true);
+        $method->invoke($request);
+
+        $reflectionOfRequest = new \ReflectionObject($request);
+        $retries = $reflectionOfRequest->getProperty('retries');
+        $retries->setAccessible(true);
+        $this->assertEquals(0, $retries->getValue($request));
+    }
 }

From a9763a0e38c73db19579e8d5bed5365f7e151f2d Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 3 Nov 2019 12:32:45 -0500
Subject: [PATCH 080/105] Made retry variable a class property instead of a
 local variable

---
 src/authnet/AuthnetJsonRequest.php | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php
index a1e8581..7c1e21a 100644
--- a/src/authnet/AuthnetJsonRequest.php
+++ b/src/authnet/AuthnetJsonRequest.php
@@ -91,6 +91,11 @@ class AuthnetJsonRequest
      */
     private $processor;
 
+    /**
+     * @var     int  Number of attempts to make an HTTP request
+     */
+    private $retries;
+
     /**
      * Creates the request object by setting the Authorize.Net credentials and URL of the endpoint to be used
      * for the API call.
@@ -178,13 +183,13 @@ public function __call($api_call, Array $args)
      */
     private function makeRequest() : void
     {
-        $retries = 0;
-        while ($retries < self::MAX_RETRIES) {
+        $this->retries = 0;
+        while ($this->retries < self::MAX_RETRIES) {
             $this->processor->post($this->url, $this->requestJson);
             if (!$this->processor->error) {
                 break;
             }
-            $retries++;
+            $this->retries++;
         }
     }
 

From 3e27a736c04ba7affd1901ed48143988587d4bd8 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 3 Nov 2019 12:33:17 -0500
Subject: [PATCH 081/105] Added test to cover when
 getTransactionResponseField() throws an exception

---
 tests/AuthnetJsonResponseTest.php | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/AuthnetJsonResponseTest.php b/tests/AuthnetJsonResponseTest.php
index 074ed2b..deccdb5 100644
--- a/tests/AuthnetJsonResponseTest.php
+++ b/tests/AuthnetJsonResponseTest.php
@@ -117,6 +117,17 @@ public function testTransactionResponse() : void
         $this->assertEquals('2230582306', $response->getTransactionResponseField('TransactionID'));
     }
 
+    /**
+     * @covers            \JohnConde\Authnet\AuthnetJsonResponse::getTransactionResponseField()
+     */
+    public function testTransactionResponseException() : void
+    {
+        $this->expectException('\JohnConde\Authnet\AuthnetTransactionResponseCallException');
+
+        $AuthnetJsonResponse = new AuthnetJsonResponse('{}');
+        $method = new \ReflectionMethod($AuthnetJsonResponse, 'getTransactionResponseField');
+        $method->invoke($AuthnetJsonResponse, 'test');
+    }
 
     /**
      * @covers            \JohnConde\Authnet\AuthnetJsonResponse::isApproved()

From 06d64c72f254f0fc6da2120534b56d854ddd923f Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 3 Nov 2019 12:33:47 -0500
Subject: [PATCH 082/105] Added CONTRIBUTING.md

---
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG b/CHANGELOG
index ce7f732..1206039 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -11,6 +11,7 @@ Removed unused AuthnetInvalidParameterException class
 Updated unit tests for phpunit 8
 Removed unneeded require of config file in unit tests
 Added phpunit to require-dev
+Added CONTRIBUTING.md
 Shiny badges for the README
 Cleaned up HTML and CSS in examples
 Minor formatting changes

From 7d4730e2d42921aee2f95f6e18252035e2e1b8f3 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 3 Nov 2019 19:29:50 -0500
Subject: [PATCH 083/105] Cleaned up examples which had erroneous sample code.
 Cleaned up usage of single vs double quotes.

---
 .../createTransactionRequest_authCapture.php  | 44 +++++++++----------
 .../aim/createTransactionRequest_authOnly.php | 14 +++---
 .../createTransactionRequest_partialAuth.php  |  2 +-
 ...teTransactionRequest_paypalAuthCapture.php | 32 +++++++-------
 ...ctionRequest_paypalAuthCaptureContinue.php | 12 ++---
 ...reateTransactionRequest_paypalAuthOnly.php | 15 ++++---
 ...nsactionRequest_paypalAuthOnlyContinue.php | 12 ++---
 ...ateTransactionRequest_paypalGetDetails.php |  6 +--
 ...nsactionRequest_paypalPriorAuthCapture.php |  6 +--
 .../createTransactionRequest_paypalRefund.php |  6 +--
 .../createTransactionRequest_paypalVoid.php   |  6 +--
 .../createTransactionRequest_visaCheckout.php | 16 +++----
 examples/aim/decryptPaymentDataRequest.php    | 10 ++---
 .../sendCustomerTransactionReceiptRequest.php |  2 +-
 examples/cim/getHostedProfilePageRequest.php  |  6 +--
 15 files changed, 94 insertions(+), 95 deletions(-)

diff --git a/examples/aim/createTransactionRequest_authCapture.php b/examples/aim/createTransactionRequest_authCapture.php
index e67197f..d85ea82 100644
--- a/examples/aim/createTransactionRequest_authCapture.php
+++ b/examples/aim/createTransactionRequest_authCapture.php
@@ -252,35 +252,33 @@
             ],
             'customerIP' => '192.168.1.1',
             'transactionSettings' => [
-                'setting' => [
-                    0 => [
-                        'settingName' =>'allowPartialAuth',
-                        'settingValue' => 'false'
-                    ],
-                    1 => [
-                        'settingName' => 'duplicateWindow',
-                        'settingValue' => '0'
-                    ],
-                    2 => [
-                        'settingName' => 'emailCustomer',
-                        'settingValue' => 'false'
-                    ],
-                    3 => [
-                        'settingName' => 'recurringBilling',
-                        'settingValue' => 'false'
-                    ],
-                    4 => [
-                        'settingName' => 'testRequest',
-                        'settingValue' => 'false'
-                    ]
+                [
+                    'settingName' =>'allowPartialAuth',
+                    'settingValue' => 'false'
+                ],
+                [
+                    'settingName' => 'duplicateWindow',
+                    'settingValue' => '0'
+                ],
+                [
+                    'settingName' => 'emailCustomer',
+                    'settingValue' => 'false'
+                ],
+                [
+                    'settingName' => 'recurringBilling',
+                    'settingValue' => 'false'
+                ],
+                [
+                    'settingName' => 'testRequest',
+                    'settingValue' => 'false'
                 ]
             ],
             'userFields' => [
-                'userField' => [
+                [
                     'name' => 'MerchantDefinedFieldName1',
                     'value' => 'MerchantDefinedFieldValue1',
                 ],
-                'userField' => [
+                [
                     'name' => 'favorite_color',
                     'value' => 'blue',
                 ],
diff --git a/examples/aim/createTransactionRequest_authOnly.php b/examples/aim/createTransactionRequest_authOnly.php
index 541bdeb..f822209 100644
--- a/examples/aim/createTransactionRequest_authOnly.php
+++ b/examples/aim/createTransactionRequest_authOnly.php
@@ -216,33 +216,33 @@
             ],
             'customerIP' => '192.168.1.1',
             'transactionSettings' => [
-                'setting' => [
+                [
                     'settingName' => 'allowPartialAuth',
                     'settingValue' => 'false',
                 ],
-                'setting' => [
+                [
                     'settingName' => 'duplicateWindow',
                     'settingValue' => '0',
                 ],
-                'setting' => [
+                [
                     'settingName' => 'emailCustomer',
                     'settingValue' => 'false',
                 ],
-                'setting' => [
+                [
                   'settingName' => 'recurringBilling',
                   'settingValue' => 'false',
                 ],
-                'setting' => [
+                [
                     'settingName' => 'testRequest',
                     'settingValue' => 'false',
                 ],
             ],
             'userFields' => [
-                'userField' => [
+                [
                     'name' => 'MerchantDefinedFieldName1',
                     'value' => 'MerchantDefinedFieldValue1',
                 ],
-                'userField' => [
+                [
                     'name' => 'favorite_color',
                     'value' => 'blue',
                 ],
diff --git a/examples/aim/createTransactionRequest_partialAuth.php b/examples/aim/createTransactionRequest_partialAuth.php
index 45932a3..880859e 100644
--- a/examples/aim/createTransactionRequest_partialAuth.php
+++ b/examples/aim/createTransactionRequest_partialAuth.php
@@ -151,7 +151,7 @@
                'country' => 'USA',
             ],
             'transactionSettings' => [
-                'setting' => [
+                [
                     0 => [
                         'settingName' =>'allowPartialAuth',
                         'settingValue' => 'true'
diff --git a/examples/aim/createTransactionRequest_paypalAuthCapture.php b/examples/aim/createTransactionRequest_paypalAuthCapture.php
index e6efb81..9d8b816 100644
--- a/examples/aim/createTransactionRequest_paypalAuthCapture.php
+++ b/examples/aim/createTransactionRequest_paypalAuthCapture.php
@@ -82,24 +82,24 @@
 
     $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
     $response = $request->createTransactionRequest([
-        "transactionRequest" => [
-            "transactionType" => "authCaptureTransaction",
-            "amount" => "80.93",
-            "payment" => [
-                "payPal" => [
-                    "successUrl" => "https://my.server.com/success.html",
-                    "cancelUrl" => "https://my.server.com/cancel.html",
-                    "paypalLc" => "",
-                    "paypalHdrImg" => "",
-                    "paypalPayflowcolor" => "FFFF00"
+        'transactionRequest' => [
+            'transactionType' => 'authCaptureTransaction',
+            'amount' => '80.93',
+            'payment' => [
+                'payPal' => [
+                    'successUrl' => 'https://my.server.com/success.html',
+                    'cancelUrl' => 'https://my.server.com/cancel.html',
+                    'paypalLc' => '',
+                    'paypalHdrImg' => '',
+                    'paypalPayflowcolor' => 'FFFF00'
                 ]
             ],
-            "lineItems" => [
-                "lineItem" => [
-                    "itemId" => "item1",
-                    "name" => "golf balls",
-                    "quantity" => "1",
-                    "unitPrice" => "18.95"
+            'lineItems' => [
+                'lineItem' => [
+                    'itemId' => 'item1',
+                    'name' => 'golf balls',
+                    'quantity' => '1',
+                    'unitPrice' => '18.95'
                 ]
             ]
         ]
diff --git a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php
index 19535c8..8d129e5 100644
--- a/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php
+++ b/examples/aim/createTransactionRequest_paypalAuthCaptureContinue.php
@@ -75,14 +75,14 @@
 
     $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
     $response = $request->createTransactionRequest([
-        "transactionRequest" => [
-            "transactionType" => "authCaptureContinueTransaction",
-            "payment" => [
-                "payPal" => [
-                    "payerID" =>  "S6D5ETGSVYX94"
+        'transactionRequest' => [
+            'transactionType' => 'authCaptureContinueTransaction',
+            'payment' => [
+                'payPal' => [
+                    'payerID' => 'S6D5ETGSVYX94'
                 ]
             ],
-            "refTransId" => "139"
+            'refTransId' => '139'
         ]
     ]);
 ?>
diff --git a/examples/aim/createTransactionRequest_paypalAuthOnly.php b/examples/aim/createTransactionRequest_paypalAuthOnly.php
index 36e6439..dd74c7e 100644
--- a/examples/aim/createTransactionRequest_paypalAuthOnly.php
+++ b/examples/aim/createTransactionRequest_paypalAuthOnly.php
@@ -1,5 +1,6 @@
 createTransactionRequest([
-        "transactionRequest" => [
-            "transactionType" => "authOnlyTransaction",
-            "amount" => "5",
-            "payment" => [
-                "payPal" => [
-                    "successUrl" => "https://my.server.com/success.html",
-                    "cancelUrl" => "https://my.server.com/cancel.html"
+        'transactionRequest' => [
+            'transactionType' => 'authOnlyTransaction',
+            'amount' => 5,
+            'payment' => [
+                'payPal' => [
+                    'successUrl' => 'https://my.server.com/success.html',
+                    'cancelUrl' => 'https://my.server.com/cancel.html'
                 ]
             ]
         ]
diff --git a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php
index a76a54c..9075e18 100644
--- a/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php
+++ b/examples/aim/createTransactionRequest_paypalAuthOnlyContinue.php
@@ -75,14 +75,14 @@
 
     $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
     $response = $request->authOnlyContinueTransaction([
-        "transactionRequest" => [
-            "transactionType" => "authOnlyContinueTransaction",
-            "payment" => [
-                "payPal" => [
-                    "payerID" => "S6D5ETGSVYX94"
+        'transactionRequest' => [
+            'transactionType' => 'authOnlyContinueTransaction',
+            'payment' => [
+                'payPal' => [
+                    'payerID' => 'S6D5ETGSVYX94'
                 ]
             ],
-            "refTransId" => "128"
+            'refTransId' => '128'
         ]
     ]);
 ?>
diff --git a/examples/aim/createTransactionRequest_paypalGetDetails.php b/examples/aim/createTransactionRequest_paypalGetDetails.php
index eb41f5a..fa3a17e 100644
--- a/examples/aim/createTransactionRequest_paypalGetDetails.php
+++ b/examples/aim/createTransactionRequest_paypalGetDetails.php
@@ -70,9 +70,9 @@
 
     $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
     $response = $request->createTransactionRequest([
-        "transactionRequest" => [
-            "transactionType" => "getDetailsTransaction",
-            "refTransId" => "128"
+        'transactionRequest' => [
+            'transactionType' => 'getDetailsTransaction',
+            'refTransId' => '128'
         ]
     ]);
 ?>
diff --git a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php
index df4232d..ee9afb7 100644
--- a/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php
+++ b/examples/aim/createTransactionRequest_paypalPriorAuthCapture.php
@@ -70,9 +70,9 @@
 
     $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
     $response = $request->createTransactionRequest([
-        "transactionRequest" => [
-            "transactionType" => "priorAuthCaptureTransaction",
-            "refTransId" => "128"
+        'transactionRequest' => [
+            'transactionType' => 'priorAuthCaptureTransaction',
+            'refTransId' => '128'
         ]
     ]);
 ?>
diff --git a/examples/aim/createTransactionRequest_paypalRefund.php b/examples/aim/createTransactionRequest_paypalRefund.php
index c2cd327..e6283f9 100644
--- a/examples/aim/createTransactionRequest_paypalRefund.php
+++ b/examples/aim/createTransactionRequest_paypalRefund.php
@@ -65,9 +65,9 @@
 
     $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
     $response = $request->createTransactionRequest([
-        "transactionRequest" => [
-            "transactionType" => "refundTransaction",
-            "refTransId" => "138"
+        'transactionRequest' => [
+            'transactionType' => 'refundTransaction',
+            'refTransId' => '138'
         ]
     ]);
 ?>
diff --git a/examples/aim/createTransactionRequest_paypalVoid.php b/examples/aim/createTransactionRequest_paypalVoid.php
index cbe2a26..e420857 100644
--- a/examples/aim/createTransactionRequest_paypalVoid.php
+++ b/examples/aim/createTransactionRequest_paypalVoid.php
@@ -70,9 +70,9 @@
 
     $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
     $response = $request->createTransactionRequest([
-        "transactionRequest" => [
-            "transactionType" => "voidTransaction",
-            "refTransId" => "138"
+        'transactionRequest' => [
+            'transactionType' => 'voidTransaction',
+            'refTransId' => '138'
         ]
     ]);
 ?>
diff --git a/examples/aim/createTransactionRequest_visaCheckout.php b/examples/aim/createTransactionRequest_visaCheckout.php
index 5c20204..f6da220 100644
--- a/examples/aim/createTransactionRequest_visaCheckout.php
+++ b/examples/aim/createTransactionRequest_visaCheckout.php
@@ -79,18 +79,18 @@
 
     $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
     $response = $request->createTransactionRequest([
-        "refId" => random_int(1000000, 100000000),
-        "transactionRequest" => [
-            "transactionType" => "authCaptureTransaction",
-            "amount" => "5",
-            "payment" => [
-                "opaqueData" => [
-                    "dataDescriptor" => "COMMON.VCO.ONLINE.PAYMENT",
+        'refId' => random_int(1000000, 100000000),
+        'transactionRequest' => [
+            'transactionType' => 'authCaptureTransaction',
+            'amount' => 5,
+            'payment' => [
+                'opaqueData' => [
+                    'dataDescriptor' => 'COMMON.VCO.ONLINE.PAYMENT',
                     "dataValue" => "2BceaAHSHwTc0oA8RTqXfqpqDQk+e0thusXG/SAy3EuyksOis8aEMkxuVZDRUpbZVOFh6JnmUl/LS3s+GuoPFJbR8+OBfwJRBNGSuFIgYFhZooXYQbH0pkO6jY3WCMTwiYymGz359T9M6WEdCA2oIMRKOw8PhRpZLvaoqlxZ+oILMq6+NCckdBd2LJeFNOHzUlBvYdVmUX1K1IhJVB0+nxCjFijYQQQVlxx5sacg+9A0YWWhxNnEk8HzeCghnU9twR1P/JGI5LlT+AaPmP0wj6LupH0mNFDIYzLIoA6eReIrTqn63OwJdCwYZ7qQ2hWVhPyLZty22NycWjVCdl2hdrNhWyOySXJqKDFGIq0yrnD3Hh1Y71hbg4GjsObhxtq3IsGT1JgoL9t6Q393Yw2K4sdzjgSJgetxrh2aElgLs9mEtQfWYUo71KpesMmDPxZYlf+NToIXpgz5yrQ/FT29YCSbGUICO9ems9buhb0iwcuhhamUcg336bLjL2K54+s1cpOGNEuqUi0cSMvng9T9IKZgWO+jMvQmJzRsIB5KD3FooCnDwxadp61eWfc+Bl+e0b0oQXSxJt12vyghZBgHvhEQcXU+YGBihbyYuI1JOPtt+A3smz7Emfd2+ktGF4lp82RVQNXlG9ENtKr26Utntc/xfj+y1UX2NUtsn22rW+Kahb20/4hHXA8DLcmfeHMDvrupePIcCKj02+Feofc2RMnVQLS9bsXXzbxzYGm6kHtmaXteNTnpB67U0z3igD17bYFOZurNQUBEHLXntCAMqCL7kkBT8Qx8yaSA3uhzJVhLSWU9ovu2uM1AGIauJki5TxdjSyrcj56Hi8sVB7FNxWcsZhGb67wwNRVwwyurU+YFVXB8fJna3FW686qPfo+UnyVUxwOXP4g+wC661VcrkMPPwZySzVaM7vH2n2VENkECCpm3bBYBitRifHwhRlYFF6z0GNhJQ2JLy2+YJZrlNWUMtzvYjcKojgA6YsCkSr1tFCv2c+oLAfkC720G9IvfCNQyv4o2dH554taGPvMynzbtCjWbhCj3sdX80AO2o/fQjeowa45/lYkY4CDgthzjwQwDaEK9qEKSIWjt3C/gb/VgxPRikdwmVCfI5XltVSX/bIoSyGiHvIo8DoTYebridtw4dHNx55y/a12Y/dWjpDNqV+8enZqNEfSrGSAC3E+nv9oM8ttB1JQ1GVtuN7vIv+tjHuYLEV9/U2WkUlA5ia3JjWRp3mOiYmluyof7pZbFPi5UpbKs9Nqp58oH5nI4f9JhUg2iQUz5cBiRJpntD8/KgA9JngTuQsoGWSt397hDmM99q848cqJf8UJ0OXqdgMf5mjh/atatfqgxglXfuPD2lJlJAdFDLEs0a/EEGrhwf2t14Gaw7XwBl6CSy2HzdD+HwmkNSdicb8an+JbH0WPqH8DXR8eaT0P11rjVtoGTPwQD1G+OllgfmzL5kxtRZFqbfFVCRqLjHGsygNX9Ts8nxGz301NT294HnkZSfre7hadDQUqTpZo0Em/DkwY1ruuba3zfLwzv0C4Hil3FllEhZbPNYIcb4C5FHQ2NlqVCSt2YfofGYkDWI2g46UJG1rlLQ4OQ7jcdjybvasMqcCvqO+jkQK07DZtb5gZEnzWqGSNcRdzz6cJbnbJqDDhxyci+FRBE0an9m7iHX7lyhEbfnjatP606DRikKQkmPnjaDlhsAJA6Yx82zu3z88/wJG75W8TkKrbyEAMiB5CGDSg/bvEUN60VN9PRbYiD3XTm8ZpTg0k2hQfh/xwRktbRKJ/zqp5l5Jchif0vrtMJdk6omzMMy0LBCSzu9aNAELwz4CQoSpeKA90piGy0T/IjiAvq2r6hOWfAUvZITckN9PA1NPaqEkACG1jyK+LgXew/CCplywL3Tz76fKkkYYApJAuTgzja6O2a9xC3ULlMjfVzeDHbV+R4mDno35mDOz7q7BB2Qoj3TBr6yLgz9mzZssY48U93Nwd1g663NKk1mn/i2a0fLeaOOr46d/tS0oXCEIB+NIOlYYQqKfuZAh0GSzVZMYZsQ4NfueSx5VY80MibBYrVk26u3/sco5wvaz0C3PY27pBj89VhM5kAhGv1CXJcbIFBJ/B9Xw9VFsTf39PfJUhB7b0+7+zFwtriJn02WcW1Z9pX78wSs0AxwYCMbNtxzK5fFZZcdOt2HOsIHw==",
                     "dataKey" => "k5qdgh6t5BnvuBz3Xs0f+iraXB0tXO+6WewMUVTBsqYN3G16HHYwlz8To602G/pZ+Sng0mjTAy3mwhpOb/5nJktiCTpKL4wvn0exJxGt9GIAODBYz4PFbxuenmuQE9O5"
                 ],
             ],
-            "callId" => "4859677641513545101"
+            'callId' => '4859677641513545101'
         ],
     ]);
 ?>
diff --git a/examples/aim/decryptPaymentDataRequest.php b/examples/aim/decryptPaymentDataRequest.php
index e11472b..398b052 100644
--- a/examples/aim/decryptPaymentDataRequest.php
+++ b/examples/aim/decryptPaymentDataRequest.php
@@ -76,12 +76,12 @@
 
 $request  = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
 $response = $request->decryptPaymentDataRequest([
-    "opaqueData" => [
-        "dataDescriptor" => "COMMON.VCO.ONLINE.PAYMENT",
-        "dataValue" => "2BceaAHSHwTc0oA8RTqXfqpqDQk+e0thusXG/SAy3EuyksOis8aEMkxuVZDRUpbZVOFh6JnmUl/LS3s+GuoPFJbR8+OBfwJRBNGSuFIgYFhZooXYQbH0pkO6jY3WCMTwiYymGz359T9M6WEdCA2oIMRKOw8PhRpZLvaoqlxZ+oILMq6+NCckdBd2LJeFNOHzUlBvYdVmUX1K1IhJVB0+nxCjFijYQQQVlxx5sacg+9A0YWWhxNnEk8HzeCghnU9twR1P/JGI5LlT+AaPmP0wj6LupH0mNFDIYzLIoA6eReIrTqn63OwJdCwYZ7qQ2hWVhPyLZty22NycWjVCdl2hdrNhWyOySXJqKDFGIq0yrnD3Hh1Y71hbg4GjsObhxtq3IsGT1JgoL9t6Q393Yw2K4sdzjgSJgetxrh2aElgLs9mEtQfWYUo71KpesMmDPxZYlf+NToIXpgz5yrQ/FT29YCSbGUICO9ems9buhb0iwcuhhamUcg336bLjL2K54+s1cpOGNEuqUi0cSMvng9T9IKZgWO+jMvQmJzRsIB5KD3FooCnDwxadp61eWfc+Bl+e0b0oQXSxJt12vyghZBgHvhEQcXU+YGBihbyYuI1JOPtt+A3smz7Emfd2+ktGF4lp82RVQNXlG9ENtKr26Utntc/xfj+y1UX2NUtsn22rW+Kahb20/4hHXA8DLcmfeHMDvrupePIcCKj02+Feofc2RMnVQLS9bsXXzbxzYGm6kHtmaXteNTnpB67U0z3igD17bYFOZurNQUBEHLXntCAMqCL7kkBT8Qx8yaSA3uhzJVhLSWU9ovu2uM1AGIauJki5TxdjSyrcj56Hi8sVB7FNxWcsZhGb67wwNRVwwyurU+YFVXB8fJna3FW686qPfo+UnyVUxwOXP4g+wC661VcrkMPPwZySzVaM7vH2n2VENkECCpm3bBYBitRifHwhRlYFF6z0GNhJQ2JLy2+YJZrlNWUMtzvYjcKojgA6YsCkSr1tFCv2c+oLAfkC720G9IvfCNQyv4o2dH554taGPvMynzbtCjWbhCj3sdX80AO2o/fQjeowa45/lYkY4CDgthzjwQwDaEK9qEKSIWjt3C/gb/VgxPRikdwmVCfI5XltVSX/bIoSyGiHvIo8DoTYebridtw4dHNx55y/a12Y/dWjpDNqV+8enZqNEfSrGSAC3E+nv9oM8ttB1JQ1GVtuN7vIv+tjHuYLEV9/U2WkUlA5ia3JjWRp3mOiYmluyof7pZbFPi5UpbKs9Nqp58oH5nI4f9JhUg2iQUz5cBiRJpntD8/KgA9JngTuQsoGWSt397hDmM99q848cqJf8UJ0OXqdgMf5mjh/atatfqgxglXfuPD2lJlJAdFDLEs0a/EEGrhwf2t14Gaw7XwBl6CSy2HzdD+HwmkNSdicb8an+JbH0WPqH8DXR8eaT0P11rjVtoGTPwQD1G+OllgfmzL5kxtRZFqbfFVCRqLjHGsygNX9Ts8nxGz301NT294HnkZSfre7hadDQUqTpZo0Em/DkwY1ruuba3zfLwzv0C4Hil3FllEhZbPNYIcb4C5FHQ2NlqVCSt2YfofGYkDWI2g46UJG1rlLQ4OQ7jcdjybvasMqcCvqO+jkQK07DZtb5gZEnzWqGSNcRdzz6cJbnbJqDDhxyci+FRBE0an9m7iHX7lyhEbfnjatP606DRikKQkmPnjaDlhsAJA6Yx82zu3z88/wJG75W8TkKrbyEAMiB5CGDSg/bvEUN60VN9PRbYiD3XTm8ZpTg0k2hQfh/xwRktbRKJ/zqp5l5Jchif0vrtMJdk6omzMMy0LBCSzu9aNAELwz4CQoSpeKA90piGy0T/IjiAvq2r6hOWfAUvZITckN9PA1NPaqEkACG1jyK+LgXew/CCplywL3Tz76fKkkYYApJAuTgzja6O2a9xC3ULlMjfVzeDHbV+R4mDno35mDOz7q7BB2Qoj3TBr6yLgz9mzZssY48U93Nwd1g663NKk1mn/i2a0fLeaOOr46d/tS0oXCEIB+NIOlYYQqKfuZAh0GSzVZMYZsQ4NfueSx5VY80MibBYrVk26u3/sco5wvaz0C3PY27pBj89VhM5kAhGv1CXJcbIFBJ/B9Xw9VFsTf39PfJUhB7b0+7+zFwtriJn02WcW1Z9pX78wSs0AxwYCMbNtxzK5fFZZcdOt2HOsIHw==",
-        "dataKey" => "k5qdgh6t5BnvuBz3Xs0f+iraXB0tXO+6WewMUVTBsqYN3G16HHYwlz8To602G/pZ+Sng0mjTAy3mwhpOb/5nJktiCTpKL4wvn0exJxGt9GIAODBYz4PFbxuenmuQE9O5"
+    'opaqueData' => [
+        'dataDescriptor' => 'COMMON.VCO.ONLINE.PAYMENT',
+        'dataValue' => '2BceaAHSHwTc0oA8RTqXfqpqDQk+e0thusXG/SAy3EuyksOis8aEMkxuVZDRUpbZVOFh6JnmUl/LS3s+GuoPFJbR8+OBfwJRBNGSuFIgYFhZooXYQbH0pkO6jY3WCMTwiYymGz359T9M6WEdCA2oIMRKOw8PhRpZLvaoqlxZ+oILMq6+NCckdBd2LJeFNOHzUlBvYdVmUX1K1IhJVB0+nxCjFijYQQQVlxx5sacg+9A0YWWhxNnEk8HzeCghnU9twR1P/JGI5LlT+AaPmP0wj6LupH0mNFDIYzLIoA6eReIrTqn63OwJdCwYZ7qQ2hWVhPyLZty22NycWjVCdl2hdrNhWyOySXJqKDFGIq0yrnD3Hh1Y71hbg4GjsObhxtq3IsGT1JgoL9t6Q393Yw2K4sdzjgSJgetxrh2aElgLs9mEtQfWYUo71KpesMmDPxZYlf+NToIXpgz5yrQ/FT29YCSbGUICO9ems9buhb0iwcuhhamUcg336bLjL2K54+s1cpOGNEuqUi0cSMvng9T9IKZgWO+jMvQmJzRsIB5KD3FooCnDwxadp61eWfc+Bl+e0b0oQXSxJt12vyghZBgHvhEQcXU+YGBihbyYuI1JOPtt+A3smz7Emfd2+ktGF4lp82RVQNXlG9ENtKr26Utntc/xfj+y1UX2NUtsn22rW+Kahb20/4hHXA8DLcmfeHMDvrupePIcCKj02+Feofc2RMnVQLS9bsXXzbxzYGm6kHtmaXteNTnpB67U0z3igD17bYFOZurNQUBEHLXntCAMqCL7kkBT8Qx8yaSA3uhzJVhLSWU9ovu2uM1AGIauJki5TxdjSyrcj56Hi8sVB7FNxWcsZhGb67wwNRVwwyurU+YFVXB8fJna3FW686qPfo+UnyVUxwOXP4g+wC661VcrkMPPwZySzVaM7vH2n2VENkECCpm3bBYBitRifHwhRlYFF6z0GNhJQ2JLy2+YJZrlNWUMtzvYjcKojgA6YsCkSr1tFCv2c+oLAfkC720G9IvfCNQyv4o2dH554taGPvMynzbtCjWbhCj3sdX80AO2o/fQjeowa45/lYkY4CDgthzjwQwDaEK9qEKSIWjt3C/gb/VgxPRikdwmVCfI5XltVSX/bIoSyGiHvIo8DoTYebridtw4dHNx55y/a12Y/dWjpDNqV+8enZqNEfSrGSAC3E+nv9oM8ttB1JQ1GVtuN7vIv+tjHuYLEV9/U2WkUlA5ia3JjWRp3mOiYmluyof7pZbFPi5UpbKs9Nqp58oH5nI4f9JhUg2iQUz5cBiRJpntD8/KgA9JngTuQsoGWSt397hDmM99q848cqJf8UJ0OXqdgMf5mjh/atatfqgxglXfuPD2lJlJAdFDLEs0a/EEGrhwf2t14Gaw7XwBl6CSy2HzdD+HwmkNSdicb8an+JbH0WPqH8DXR8eaT0P11rjVtoGTPwQD1G+OllgfmzL5kxtRZFqbfFVCRqLjHGsygNX9Ts8nxGz301NT294HnkZSfre7hadDQUqTpZo0Em/DkwY1ruuba3zfLwzv0C4Hil3FllEhZbPNYIcb4C5FHQ2NlqVCSt2YfofGYkDWI2g46UJG1rlLQ4OQ7jcdjybvasMqcCvqO+jkQK07DZtb5gZEnzWqGSNcRdzz6cJbnbJqDDhxyci+FRBE0an9m7iHX7lyhEbfnjatP606DRikKQkmPnjaDlhsAJA6Yx82zu3z88/wJG75W8TkKrbyEAMiB5CGDSg/bvEUN60VN9PRbYiD3XTm8ZpTg0k2hQfh/xwRktbRKJ/zqp5l5Jchif0vrtMJdk6omzMMy0LBCSzu9aNAELwz4CQoSpeKA90piGy0T/IjiAvq2r6hOWfAUvZITckN9PA1NPaqEkACG1jyK+LgXew/CCplywL3Tz76fKkkYYApJAuTgzja6O2a9xC3ULlMjfVzeDHbV+R4mDno35mDOz7q7BB2Qoj3TBr6yLgz9mzZssY48U93Nwd1g663NKk1mn/i2a0fLeaOOr46d/tS0oXCEIB+NIOlYYQqKfuZAh0GSzVZMYZsQ4NfueSx5VY80MibBYrVk26u3/sco5wvaz0C3PY27pBj89VhM5kAhGv1CXJcbIFBJ/B9Xw9VFsTf39PfJUhB7b0+7+zFwtriJn02WcW1Z9pX78wSs0AxwYCMbNtxzK5fFZZcdOt2HOsIHw==',
+        'dataKey' => 'k5qdgh6t5BnvuBz3Xs0f+iraXB0tXO+6WewMUVTBsqYN3G16HHYwlz8To602G/pZ+Sng0mjTAy3mwhpOb/5nJktiCTpKL4wvn0exJxGt9GIAODBYz4PFbxuenmuQE9O5'
     ],
-    "callId" => "4859677641513545101"
+    'callId' => '4859677641513545101'
 ]);
 ?>
 
diff --git a/examples/aim/sendCustomerTransactionReceiptRequest.php b/examples/aim/sendCustomerTransactionReceiptRequest.php
index 7d0bb41..d4f2939 100644
--- a/examples/aim/sendCustomerTransactionReceiptRequest.php
+++ b/examples/aim/sendCustomerTransactionReceiptRequest.php
@@ -50,7 +50,7 @@
         'transId' => '2165665581',
         'customerEmail' => 'user@example.com',
         'emailSettings' => [
-            'setting' => [
+            [
                 'settingName' => 'headerEmailReceipt',
                 'settingValue' => 'some HEADER stuff'
             ],
diff --git a/examples/cim/getHostedProfilePageRequest.php b/examples/cim/getHostedProfilePageRequest.php
index 18ed9b2..da91bee 100644
--- a/examples/cim/getHostedProfilePageRequest.php
+++ b/examples/cim/getHostedProfilePageRequest.php
@@ -46,15 +46,15 @@
     $response = $request->getHostedProfilePageRequest([
         'customerProfileId' => '31390172',
         'hostedProfileSettings' => [
-            'setting' => [
+            [
                 'settingName' => 'hostedProfileReturnUrl',
                 'settingValue' => 'https://blah.com/blah/',
             ],
-            'setting' => [
+            [
                 'settingName' => 'hostedProfileReturnUrlText',
                 'settingValue' => 'Continue to blah.',
             ],
-            'setting' => [
+            [
                 'settingName' => 'hostedProfilePageBorderVisible',
                 'settingValue' => 'true',
             ]

From 9cf67b47cd6f32baedbf87ce86321c7b08fc8f7f Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Tue, 12 Nov 2019 19:29:04 -0500
Subject: [PATCH 084/105] Cleaned up unit tests

---
 tests/AuthnetApiFactoryTest.php       | 46 +++++++++++++--------------
 tests/AuthnetJsonAimPaypalTest.php    |  3 +-
 tests/AuthnetJsonAimTest.php          |  3 +-
 tests/AuthnetJsonArbTest.php          |  3 +-
 tests/AuthnetJsonCimTest.php          |  3 +-
 tests/AuthnetJsonReportingTest.php    |  3 +-
 tests/AuthnetJsonRequestTest.php      | 29 +++++++++--------
 tests/AuthnetJsonResponseTest.php     |  8 ++---
 tests/AuthnetSimTest.php              |  4 +--
 tests/AuthnetWebhookTest.php          |  6 ++--
 tests/AuthnetWebhooksRequestTest.php  | 33 +++++++++----------
 tests/AuthnetWebhooksResponseTest.php |  7 ++--
 12 files changed, 77 insertions(+), 71 deletions(-)

diff --git a/tests/AuthnetApiFactoryTest.php b/tests/AuthnetApiFactoryTest.php
index 333f407..c8d07b4 100644
--- a/tests/AuthnetApiFactoryTest.php
+++ b/tests/AuthnetApiFactoryTest.php
@@ -30,7 +30,7 @@ protected function setUp() : void
     public function testGetWebServiceUrlProductionServer() : void
     {
         $server           = AuthnetApiFactory::USE_PRODUCTION_SERVER;
-        $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebServiceURL');
+        $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
         $reflectionMethod->setAccessible(true);
         $url              = $reflectionMethod->invoke(null, $server);
 
@@ -43,7 +43,7 @@ public function testGetWebServiceUrlProductionServer() : void
     public function testGetWebServiceUrlDevelopmentServer() : void
     {
         $server           = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebServiceURL');
+        $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
         $reflectionMethod->setAccessible(true);
         $url              = $reflectionMethod->invoke(null, $server);
 
@@ -56,7 +56,7 @@ public function testGetWebServiceUrlDevelopmentServer() : void
     public function testGetWebServiceUrlAkamaiServer() : void
     {
         $server           = AuthnetApiFactory::USE_AKAMAI_SERVER;
-        $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebServiceURL');
+        $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
         $reflectionMethod->setAccessible(true);
         $url              = $reflectionMethod->invoke(null, $server);
 
@@ -73,7 +73,7 @@ public function testGetWebServiceUrlBadServer() : void
         $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException');
 
         $server           = 99;
-        $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebServiceURL');
+        $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
         $reflectionMethod->setAccessible(true);
         $reflectionMethod->invoke(null, $server);
     }
@@ -85,7 +85,7 @@ public function testGetWebServiceUrlBadServer() : void
      */
     public function testExceptionIsRaisedForInvalidCredentialsLogin() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException');
+        $this->expectException(AuthnetInvalidCredentialsException::class);
 
         $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         AuthnetApiFactory::getJsonApiHandler('', $this->transactionKey, $server);
@@ -98,7 +98,7 @@ public function testExceptionIsRaisedForInvalidCredentialsLogin() : void
      */
     public function testExceptionIsRaisedForInvalidCredentialsTransactionKey() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException');
+        $this->expectException(AuthnetInvalidCredentialsException::class);
 
         $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         AuthnetApiFactory::getJsonApiHandler($this->login, '', $server);
@@ -110,7 +110,7 @@ public function testExceptionIsRaisedForInvalidCredentialsTransactionKey() : voi
      */
     public function testExceptionIsRaisedForAuthnetInvalidServer() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException');
+        $this->expectException(AuthnetInvalidServerException::class);
 
         AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, 5);
     }
@@ -124,7 +124,7 @@ public function testCurlWrapperProductionResponse() : void
         $server  = AuthnetApiFactory::USE_PRODUCTION_SERVER;
         $authnet = AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, $server);
 
-        $reflectionClass = new \ReflectionClass('\JohnConde\Authnet\AuthnetJsonRequest');
+        $reflectionClass = new \ReflectionClass(AuthnetJsonRequest::class);
         $reflectionOfProcessor = $reflectionClass->getProperty('processor');
         $reflectionOfProcessor->setAccessible(true);
         $processor = $reflectionOfProcessor->getValue($authnet);
@@ -141,7 +141,7 @@ public function testCurlWrapperDevelopmentResponse() : void
         $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         $authnet = AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, $server);
 
-        $reflectionClass = new \ReflectionClass('\JohnConde\Authnet\AuthnetJsonRequest');
+        $reflectionClass = new \ReflectionClass(AuthnetJsonRequest::class);
         $reflectionOfProcessor = $reflectionClass->getProperty('processor');
         $reflectionOfProcessor->setAccessible(true);
         $processor = $reflectionOfProcessor->getValue($authnet);
@@ -157,7 +157,7 @@ public function testGetSimHandler() : void
         $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         $sim    = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $server);
 
-        $this->assertInstanceOf('JohnConde\Authnet\AuthnetSim', $sim);
+        $this->assertInstanceOf(AuthnetSim::class, $sim);
     }
 
     /**
@@ -166,7 +166,7 @@ public function testGetSimHandler() : void
      */
     public function testExceptionIsRaisedForInvalidCredentialsSim() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException');
+        $this->expectException(AuthnetInvalidCredentialsException::class);
 
         $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         AuthnetApiFactory::getSimHandler('', $this->transactionKey, $server);
@@ -178,7 +178,7 @@ public function testExceptionIsRaisedForInvalidCredentialsSim() : void
     public function testGetSimServerTest() : void
     {
         $server           = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getSimURL');
+        $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getSimURL');
         $reflectionMethod->setAccessible(true);
         $url              = $reflectionMethod->invoke($reflectionMethod, $server);
 
@@ -191,7 +191,7 @@ public function testGetSimServerTest() : void
     public function testGetSimServerProduction() : void
     {
         $server           = AuthnetApiFactory::USE_PRODUCTION_SERVER;
-        $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getSimURL');
+        $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getSimURL');
         $reflectionMethod->setAccessible(true);
         $url              = $reflectionMethod->invoke($reflectionMethod, $server);
 
@@ -204,7 +204,7 @@ public function testGetSimServerProduction() : void
      */
     public function testExceptionIsRaisedForAuthnetInvalidSimServer() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException');
+        $this->expectException(AuthnetInvalidServerException::class);
 
         AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, 5);
     }
@@ -216,7 +216,7 @@ public function testExceptionIsRaisedForAuthnetInvalidSimServer() : void
      */
     public function testExceptionIsRaisedForInvalidCredentialsLoginWebhooks() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException');
+        $this->expectException(AuthnetInvalidCredentialsException::class);
 
         $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         AuthnetApiFactory::getWebhooksHandler('', $this->transactionKey, $server);
@@ -229,7 +229,7 @@ public function testExceptionIsRaisedForInvalidCredentialsLoginWebhooks() : void
      */
     public function testExceptionIsRaisedForInvalidCredentialsTransactionKeyWebhooks() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException');
+        $this->expectException(AuthnetInvalidCredentialsException::class);
 
         $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         AuthnetApiFactory::getWebhooksHandler($this->login, '', $server);
@@ -241,7 +241,7 @@ public function testExceptionIsRaisedForInvalidCredentialsTransactionKeyWebhooks
      */
     public function testExceptionIsRaisedForAuthnetInvalidServerWebhooks() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException');
+        $this->expectException(AuthnetInvalidServerException::class);
 
         AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, 5);
     }
@@ -255,7 +255,7 @@ public function testCurlWrapperProductionResponseWebhooks() : void
         $server  = AuthnetApiFactory::USE_PRODUCTION_SERVER;
         $authnet = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, $server);
 
-        $reflectionClass = new \ReflectionClass('\JohnConde\Authnet\AuthnetWebhooksRequest');
+        $reflectionClass = new \ReflectionClass(AuthnetWebhooksRequest::class);
         $reflectionOfProcessor = $reflectionClass->getProperty('processor');
         $reflectionOfProcessor->setAccessible(true);
         $processor = $reflectionOfProcessor->getValue($authnet);
@@ -272,7 +272,7 @@ public function testCurlWrapperDevelopmentResponseWebhooks() : void
         $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         $authnet = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, $server);
 
-        $reflectionClass = new \ReflectionClass('\JohnConde\Authnet\AuthnetWebhooksRequest');
+        $reflectionClass = new \ReflectionClass(AuthnetWebhooksRequest::class);
         $reflectionOfProcessor = $reflectionClass->getProperty('processor');
         $reflectionOfProcessor->setAccessible(true);
         $processor = $reflectionOfProcessor->getValue($authnet);
@@ -286,7 +286,7 @@ public function testCurlWrapperDevelopmentResponseWebhooks() : void
     public function testGetWebhooksUrlProductionServer() : void
     {
         $server           = AuthnetApiFactory::USE_PRODUCTION_SERVER;
-        $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebhooksURL');
+        $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebhooksURL');
         $reflectionMethod->setAccessible(true);
         $url              = $reflectionMethod->invoke(null, $server);
 
@@ -299,7 +299,7 @@ public function testGetWebhooksUrlProductionServer() : void
     public function testGetWebhooksUrlDevelopmentServer() : void
     {
         $server           = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebhooksURL');
+        $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebhooksURL');
         $reflectionMethod->setAccessible(true);
         $url              = $reflectionMethod->invoke(null, $server);
 
@@ -312,10 +312,10 @@ public function testGetWebhooksUrlDevelopmentServer() : void
      */
     public function testGetWebhooksUrlBadServer() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException');
+        $this->expectException(AuthnetInvalidServerException::class);
 
         $server           = 99;
-        $reflectionMethod = new \ReflectionMethod('\JohnConde\Authnet\AuthnetApiFactory', 'getWebhooksURL');
+        $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebhooksURL');
         $reflectionMethod->setAccessible(true);
         $reflectionMethod->invoke(null, $server);
     }
diff --git a/tests/AuthnetJsonAimPaypalTest.php b/tests/AuthnetJsonAimPaypalTest.php
index 40a8246..f5af2b7 100644
--- a/tests/AuthnetJsonAimPaypalTest.php
+++ b/tests/AuthnetJsonAimPaypalTest.php
@@ -12,6 +12,7 @@
 namespace JohnConde\Authnet;
 
 use PHPUnit\Framework\TestCase;
+use Curl\Curl;
 
 class AuthnetJsonAimPaypalTest extends TestCase
 {
@@ -26,7 +27,7 @@ protected function setUp() : void
         $this->transactionKey = 'test';
         $this->server         = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
 
-        $this->http = $this->getMockBuilder('\Curl\Curl')
+        $this->http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $this->http->error = false;
diff --git a/tests/AuthnetJsonAimTest.php b/tests/AuthnetJsonAimTest.php
index 1f26db3..3a017d9 100644
--- a/tests/AuthnetJsonAimTest.php
+++ b/tests/AuthnetJsonAimTest.php
@@ -12,6 +12,7 @@
 namespace JohnConde\Authnet;
 
 use PHPUnit\Framework\TestCase;
+use Curl\Curl;
 
 class AuthnetJsonAimTest extends TestCase
 {
@@ -26,7 +27,7 @@ protected function setUp() : void
         $this->transactionKey = 'test';
         $this->server         = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
 
-        $this->http = $this->getMockBuilder('\Curl\Curl')
+        $this->http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $this->http->error = false;
diff --git a/tests/AuthnetJsonArbTest.php b/tests/AuthnetJsonArbTest.php
index 1607fb9..9f66d73 100644
--- a/tests/AuthnetJsonArbTest.php
+++ b/tests/AuthnetJsonArbTest.php
@@ -12,6 +12,7 @@
 namespace JohnConde\Authnet;
 
 use PHPUnit\Framework\TestCase;
+use Curl\Curl;
 
 class AuthnetJsonArbTest extends TestCase
 {
@@ -26,7 +27,7 @@ protected function setUp() : void
         $this->transactionKey = 'test';
         $this->server         = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
 
-        $this->http = $this->getMockBuilder('\Curl\Curl')
+        $this->http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $this->http->error = false;
diff --git a/tests/AuthnetJsonCimTest.php b/tests/AuthnetJsonCimTest.php
index 6ba3dde..147530f 100644
--- a/tests/AuthnetJsonCimTest.php
+++ b/tests/AuthnetJsonCimTest.php
@@ -12,6 +12,7 @@
 namespace JohnConde\Authnet;
 
 use PHPUnit\Framework\TestCase;
+use Curl\Curl;
 
 class AuthnetJsonCimTest extends TestCase
 {
@@ -26,7 +27,7 @@ protected function setUp() : void
         $this->transactionKey = 'test';
         $this->server         = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
 
-        $this->http = $this->getMockBuilder('\Curl\Curl')
+        $this->http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $this->http->error = false;
diff --git a/tests/AuthnetJsonReportingTest.php b/tests/AuthnetJsonReportingTest.php
index f435a13..8bf76e1 100644
--- a/tests/AuthnetJsonReportingTest.php
+++ b/tests/AuthnetJsonReportingTest.php
@@ -12,6 +12,7 @@
 namespace JohnConde\Authnet;
 
 use PHPUnit\Framework\TestCase;
+use Curl\Curl;
 
 class AuthnetJsonReportingTest extends TestCase
 {
@@ -26,7 +27,7 @@ protected function setUp() : void
         $this->transactionKey = 'test';
         $this->server         = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
 
-        $this->http = $this->getMockBuilder('\Curl\Curl')
+        $this->http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $this->http->error = false;
diff --git a/tests/AuthnetJsonRequestTest.php b/tests/AuthnetJsonRequestTest.php
index 24301ad..eb58ed5 100644
--- a/tests/AuthnetJsonRequestTest.php
+++ b/tests/AuthnetJsonRequestTest.php
@@ -12,6 +12,7 @@
 namespace JohnConde\Authnet;
 
 use PHPUnit\Framework\TestCase;
+use Curl\Curl;
 
 class AuthnetJsonRequestTest extends TestCase
 {
@@ -42,7 +43,7 @@ public function testConstructor() : void
      */
     public function testExceptionIsRaisedForCannotSetParamsException() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetCannotSetParamsException');
+        $this->expectException(AuthnetCannotSetParamsException::class);
 
         $request = new AuthnetJsonRequest('', '', AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->login = 'test';
@@ -57,13 +58,13 @@ public function testExceptionIsRaisedForCannotSetParamsException() : void
      */
     public function testExceptionIsRaisedForInvalidJsonException() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetCurlException');
+        $this->expectException(AuthnetCurlException::class);
 
         $requestJson = array(
             'customerProfileId' => '123456789'
         );
 
-        $this->http = $this->getMockBuilder('\Curl\Curl')
+        $this->http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $this->http->error = false;
@@ -80,13 +81,13 @@ public function testExceptionIsRaisedForInvalidJsonException() : void
     public function testProcessorIsInstanceOfCurlWrapper() : void
     {
         $request = new AuthnetJsonRequest('', '', AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
-        $request->setProcessHandler(new \Curl\Curl());
+        $request->setProcessHandler(new Curl());
 
         $reflectionOfRequest = new \ReflectionObject($request);
         $processor = $reflectionOfRequest->getProperty('processor');
         $processor->setAccessible(true);
 
-        $this->assertInstanceOf('\Curl\Curl', $processor->getValue($request));
+        $this->assertInstanceOf(Curl::class, $processor->getValue($request));
     }
 
 
@@ -248,7 +249,7 @@ public function testToString() : void
         $apiLogin    = 'apiLogin';
         $apiTransKey = 'apiTransKey';
 
-        $http = $this->getMockBuilder('\Curl\Curl')
+        $http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $http->error = false;
@@ -289,7 +290,7 @@ public function testGetRawRequest() : void
         $apiLogin    = 'apiLogin';
         $apiTransKey = 'apiTransKey';
 
-        $http = $this->getMockBuilder('\Curl\Curl')
+        $http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $http->error = false;
@@ -309,12 +310,12 @@ public function testGetRawRequest() : void
      */
     public function testProcessError() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetCurlException');
+        $this->expectException(AuthnetCurlException::class);
 
         $apiLogin    = 'apiLogin';
         $apiTransKey = 'apiTransKey';
 
-        $http = $this->getMockBuilder('\Curl\Curl')
+        $http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $http->error         = true;
@@ -334,7 +335,7 @@ public function testMakeRequestWithError() : void
         $apiLogin    = 'apiLogin';
         $apiTransKey = 'apiTransKey';
 
-        $http = $this->getMockBuilder('\Curl\Curl')
+        $http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $http->error         = true;
@@ -344,7 +345,7 @@ public function testMakeRequestWithError() : void
         $request = AuthnetApiFactory::getJsonApiHandler($apiLogin, $apiTransKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler($http);
 
-        $method = new \ReflectionMethod('\JohnConde\Authnet\AuthnetJsonRequest', 'makeRequest');
+        $method = new \ReflectionMethod(AuthnetJsonRequest::class, 'makeRequest');
         $method->setAccessible(true);
         $method->invoke($request);
 
@@ -352,7 +353,7 @@ public function testMakeRequestWithError() : void
         $retries = $reflectionOfRequest->getProperty('retries');
         $retries->setAccessible(true);
 
-        $reflectionOfMaxRetries = new \ReflectionClassConstant('\JohnConde\Authnet\AuthnetJsonRequest', 'MAX_RETRIES');
+        $reflectionOfMaxRetries = new \ReflectionClassConstant(AuthnetJsonRequest::class, 'MAX_RETRIES');
 
         $this->assertEquals($reflectionOfMaxRetries->getValue(), $retries->getValue($request));
     }
@@ -365,7 +366,7 @@ public function testMakeRequestWithNoError() : void
         $apiLogin    = 'apiLogin';
         $apiTransKey = 'apiTransKey';
 
-        $http = $this->getMockBuilder('\Curl\Curl')
+        $http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post'])
             ->getMock();
         $http->error         = false;
@@ -373,7 +374,7 @@ public function testMakeRequestWithNoError() : void
         $request = AuthnetApiFactory::getJsonApiHandler($apiLogin, $apiTransKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler($http);
 
-        $method = new \ReflectionMethod('\JohnConde\Authnet\AuthnetJsonRequest', 'makeRequest');
+        $method = new \ReflectionMethod(AuthnetJsonRequest::class, 'makeRequest');
         $method->setAccessible(true);
         $method->invoke($request);
 
diff --git a/tests/AuthnetJsonResponseTest.php b/tests/AuthnetJsonResponseTest.php
index deccdb5..17fa54a 100644
--- a/tests/AuthnetJsonResponseTest.php
+++ b/tests/AuthnetJsonResponseTest.php
@@ -21,7 +21,7 @@ class AuthnetJsonResponseTest extends TestCase
      */
     public function testExceptionIsRaisedForCannotSetParamsException() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetCannotSetParamsException');
+        $this->expectException(AuthnetCannotSetParamsException::class);
 
         $request = new AuthnetJsonRequest('', '', AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->login = 'test';
@@ -33,7 +33,7 @@ public function testExceptionIsRaisedForCannotSetParamsException() : void
      */
     public function testExceptionIsRaisedForInvalidJsonException() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidJsonException');
+        $this->expectException(AuthnetInvalidJsonException::class);
 
         $responseJson = 'I am invalid';
         new AuthnetJsonResponse($responseJson);
@@ -122,7 +122,7 @@ public function testTransactionResponse() : void
      */
     public function testTransactionResponseException() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetTransactionResponseCallException');
+        $this->expectException(AuthnetTransactionResponseCallException::class);
 
         $AuthnetJsonResponse = new AuthnetJsonResponse('{}');
         $method = new \ReflectionMethod($AuthnetJsonResponse, 'getTransactionResponseField');
@@ -317,7 +317,7 @@ public function testGet() : void
      */
     public function testExceptionIsRaisedForTransactionResponseCall() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetTransactionResponseCallException');
+        $this->expectException(AuthnetTransactionResponseCallException::class);
 
         $responseJson = '{
            "refId":"2241729",
diff --git a/tests/AuthnetSimTest.php b/tests/AuthnetSimTest.php
index 07b8b17..3534475 100644
--- a/tests/AuthnetSimTest.php
+++ b/tests/AuthnetSimTest.php
@@ -71,7 +71,7 @@ public function testGetFingerprint() : void
      */
     public function testGetFingerprintException() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidAmountException');
+        $this->expectException(AuthnetInvalidAmountException::class);
 
         $amount    = 0;
         $sim       = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $this->server);
@@ -158,4 +158,4 @@ public function testResetParameters() : void
         $this->assertNotEquals($timestamp, $timestampReflection->getValue($sim));
         $this->assertNotEquals($timestamp, $sequenceReflection->getValue($sim));
     }
-}
\ No newline at end of file
+}
diff --git a/tests/AuthnetWebhookTest.php b/tests/AuthnetWebhookTest.php
index 5a27ff7..c6857da 100644
--- a/tests/AuthnetWebhookTest.php
+++ b/tests/AuthnetWebhookTest.php
@@ -42,7 +42,7 @@ public function testConstructor() : void
      */
     public function testExceptionIsRaisedForNoSignature() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidCredentialsException');
+        $this->expectException(AuthnetInvalidCredentialsException::class);
         new AuthnetWebhook('', 'Not JSON', []);
     }
 
@@ -52,7 +52,7 @@ public function testExceptionIsRaisedForNoSignature() : void
      */
     public function testExceptionIsRaisedForCannotSetParamsException() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidJsonException');
+        $this->expectException(AuthnetInvalidJsonException::class);
         new AuthnetWebhook('a', 'Not JSON', []);
     }
 
@@ -178,4 +178,4 @@ public function testGetAllHeaders() : void
 
         $this->assertNotEmpty($headers->getValue($webhook));
     }
-}
\ No newline at end of file
+}
diff --git a/tests/AuthnetWebhooksRequestTest.php b/tests/AuthnetWebhooksRequestTest.php
index cee635c..1beef72 100644
--- a/tests/AuthnetWebhooksRequestTest.php
+++ b/tests/AuthnetWebhooksRequestTest.php
@@ -12,6 +12,7 @@
 namespace JohnConde\Authnet;
 
 use PHPUnit\Framework\TestCase;
+use Curl\Curl;
 
 class AuthnetWebhooksRequestTest extends TestCase
 {
@@ -26,7 +27,7 @@ protected function setUp() : void
         $this->transactionKey = 'test';
         $this->server         = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
 
-        $this->http = $this->getMockBuilder('\Curl\Curl')
+        $this->http = $this->getMockBuilder(Curl::class)
             ->setMethods(['post','get','put','delete'])
             ->getMock();
         $this->http->error = false;
@@ -96,7 +97,7 @@ public function testToStringNA() : void
     public function testGetEventTypes() : void
     {
         $this->http->error = false;
-        $this->http->response = $responseJson = '[
+        $this->http->response = '[
             {
                 "name": "net.authorize.customer.created"
             },
@@ -166,7 +167,7 @@ public function testGetEventTypes() : void
         $request->setProcessHandler($this->http);
         $response = $request->getEventTypes();
 
-        $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response);
+        $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response);
     }
 
     /**
@@ -200,7 +201,7 @@ public function testCreateWebhooks() : void
             'net.authorize.customer.subscription.expiring'
         ], 'http://requestb.in/', 'active');
 
-        $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response);
+        $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response);
     }
 
     /**
@@ -291,7 +292,7 @@ public function testGetWebhooks() : void
         $request->setProcessHandler($this->http);
         $response = $request->getWebhooks();
 
-        $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response);
+        $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response);
     }
 
     /**
@@ -322,7 +323,7 @@ public function testGetWebhook() : void
         $request->setProcessHandler($this->http);
         $response = $request->getWebhook('cd2c262f-2723-4848-ae92-5d317902441c');
 
-        $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response);
+        $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response);
     }
 
     /**
@@ -351,7 +352,7 @@ public function testUpdateWebhook() : void
             'net.authorize.customer.created'
         ], 'active');
 
-        $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response);
+        $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response);
     }
 
     /**
@@ -385,7 +386,7 @@ public function testGetNotificationHistory() : void
         $request->setProcessHandler($this->http);
         $response = $request->getNotificationHistory();
 
-        $this->assertInstanceOf('\JohnConde\Authnet\AuthnetWebhooksResponse', $response);
+        $this->assertInstanceOf(AuthnetWebhooksResponse::class, $response);
     }
 
     /**
@@ -399,7 +400,7 @@ public function testHandleResponse() : void
         $request = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler($this->http);
 
-        $method = new \ReflectionMethod('\JohnConde\Authnet\AuthnetWebhooksRequest', 'handleResponse');
+        $method = new \ReflectionMethod(AuthnetWebhooksRequest::class, 'handleResponse');
         $method->setAccessible(true);
 
         $response = $method->invoke($request);
@@ -413,7 +414,7 @@ public function testHandleResponse() : void
      */
     public function testHandleResponseWithErrorMessage() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetCurlException');
+        $this->expectException(AuthnetCurlException::class);
 
         $this->http->error          = true;
         $this->http->error_message  = 'Error Message';
@@ -428,7 +429,7 @@ public function testHandleResponseWithErrorMessage() : void
         $request = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler($this->http);
 
-        $method = new \ReflectionMethod('\JohnConde\Authnet\AuthnetWebhooksRequest', 'handleResponse');
+        $method = new \ReflectionMethod(AuthnetWebhooksRequest::class, 'handleResponse');
         $method->setAccessible(true);
 
         $method->invoke($request);
@@ -440,7 +441,7 @@ public function testHandleResponseWithErrorMessage() : void
      */
     public function testHandleResponseWithErrorMessageTestMessage() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetCurlException');
+        $this->expectException(AuthnetCurlException::class);
 
         $this->http->error          = true;
         $this->http->error_message  = 'Error Message';
@@ -455,7 +456,7 @@ public function testHandleResponseWithErrorMessageTestMessage() : void
         $request = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler($this->http);
 
-        $method = new \ReflectionMethod('\JohnConde\Authnet\AuthnetWebhooksRequest', 'handleResponse');
+        $method = new \ReflectionMethod(AuthnetWebhooksRequest::class, 'handleResponse');
         $method->setAccessible(true);
 
         try {
@@ -472,7 +473,7 @@ public function testHandleResponseWithErrorMessageTestMessage() : void
      */
     public function testHandleResponseWithErrorMessageNoMessage() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetCurlException');
+        $this->expectException(AuthnetCurlException::class);
 
         $this->http->error          = true;
         $this->http->error_code     = 100;
@@ -485,7 +486,7 @@ public function testHandleResponseWithErrorMessageNoMessage() : void
         $request = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
         $request->setProcessHandler($this->http);
 
-        $method = new \ReflectionMethod('\JohnConde\Authnet\AuthnetWebhooksRequest', 'handleResponse');
+        $method = new \ReflectionMethod(AuthnetWebhooksRequest::class, 'handleResponse');
         $method->setAccessible(true);
 
         try {
@@ -509,7 +510,7 @@ public function testProcessorIsInstanceOfCurlWrapper() : void
         $processor = $reflectionOfRequest->getProperty('processor');
         $processor->setAccessible(true);
 
-        $this->assertInstanceOf('\Curl\Curl', $processor->getValue($request));
+        $this->assertInstanceOf(Curl::class, $processor->getValue($request));
     }
 
     /**
diff --git a/tests/AuthnetWebhooksResponseTest.php b/tests/AuthnetWebhooksResponseTest.php
index 1d5444c..25d352a 100644
--- a/tests/AuthnetWebhooksResponseTest.php
+++ b/tests/AuthnetWebhooksResponseTest.php
@@ -21,7 +21,7 @@ class AuthnetWebhooksResponseTest extends TestCase
      */
     public function testExceptionIsRaisedForInvalidJsonException() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidJsonException');
+        $this->expectException(AuthnetInvalidJsonException::class);
         new AuthnetWebhooksResponse('');
     }
 
@@ -40,8 +40,7 @@ public function testConstruct() : void
         try {
             new AuthnetWebhooksResponse($responseJson);
             $this->assertTrue(true);
-        }
-        catch (\Exception $e) {
+        } catch (\Exception $e) {
             $this->assertTrue(false);
         }
     }
@@ -303,4 +302,4 @@ public function testGetNotificationHistory() : void
         $this->assertEquals('net.authorize.payment.authcapture.created', $history[0]->getEventType());
         $this->assertEquals('2017-02-09T19:18:42.167', $history[0]->getEventDate());
     }
-}
\ No newline at end of file
+}

From 8a7bec7372732b120491a2c33d1f40dec33ef8f9 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 16 Nov 2019 12:28:13 -0500
Subject: [PATCH 085/105] Cleaned up example code

---
 examples/aim/createTransactionRequest_authCapture.php |  4 ++--
 examples/aim/createTransactionRequest_partialAuth.php | 11 +++++------
 ...eCustomerProfileTransactionRequest_authCapture.php |  4 ++--
 ...eateCustomerProfileTransactionRequest_authOnly.php |  4 ++--
 ...eCustomerProfileTransactionRequest_captureOnly.php |  4 ++--
 ...omerProfileTransactionRequest_priorAuthCapture.php |  4 ++--
 ...createCustomerProfileTransactionRequest_refund.php |  4 ++--
 7 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/examples/aim/createTransactionRequest_authCapture.php b/examples/aim/createTransactionRequest_authCapture.php
index d85ea82..898d0b5 100644
--- a/examples/aim/createTransactionRequest_authCapture.php
+++ b/examples/aim/createTransactionRequest_authCapture.php
@@ -194,14 +194,14 @@
             ],
             'lineItems' => [
                 'lineItem' => [
-                    0 => [
+                    [
                         'itemId' => '1',
                         'name' => 'vase',
                         'description' => 'Cannes logo',
                         'quantity' => '18',
                         'unitPrice' => '45.00'
                     ],
-                    1 => [
+                    [
                         'itemId' => '2',
                         'name' => 'desk',
                         'description' => 'Big Desk',
diff --git a/examples/aim/createTransactionRequest_partialAuth.php b/examples/aim/createTransactionRequest_partialAuth.php
index 880859e..607bc82 100644
--- a/examples/aim/createTransactionRequest_partialAuth.php
+++ b/examples/aim/createTransactionRequest_partialAuth.php
@@ -152,23 +152,22 @@
             ],
             'transactionSettings' => [
                 [
-                    0 => [
+                    [
                         'settingName' =>'allowPartialAuth',
                         'settingValue' => 'true'
                     ],
-                    1 => [
+                    [
                         'settingName' => 'duplicateWindow',
                         'settingValue' => '0'
-                    ],
-                    2 => [
+                    ], [
                         'settingName' => 'emailCustomer',
                         'settingValue' => 'false'
                     ],
-                    3 => [
+                    [
                         'settingName' => 'recurringBilling',
                         'settingValue' => 'false'
                     ],
-                    4 => [
+                    [
                         'settingName' => 'testRequest',
                         'settingValue' => 'false'
                     ]
diff --git a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php
index 07ce654..76cc6bc 100644
--- a/examples/cim/createCustomerProfileTransactionRequest_authCapture.php
+++ b/examples/cim/createCustomerProfileTransactionRequest_authCapture.php
@@ -94,14 +94,14 @@
                     'description' => 'Ground based 5 to 10 day shipping'
                 ],
                 'lineItems' => [
-                    0 => [
+                    [
                         'itemId' => '1',
                         'name' => 'vase',
                         'description' => 'Cannes logo',
                         'quantity' => '18',
                         'unitPrice' => '45.00'
                     ],
-                    1 => [
+                    [
                         'itemId' => '2',
                         'name' => 'desk',
                         'description' => 'Big Desk',
diff --git a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php
index 64f4857..d20a00e 100644
--- a/examples/cim/createCustomerProfileTransactionRequest_authOnly.php
+++ b/examples/cim/createCustomerProfileTransactionRequest_authOnly.php
@@ -94,14 +94,14 @@
                     'description' => 'Ground based 5 to 10 day shipping'
                 ],
                 'lineItems' => [
-                    0 => [
+                    [
                         'itemId' => '1',
                         'name' => 'vase',
                         'description' => 'Cannes logo',
                         'quantity' => '18',
                         'unitPrice' => '45.00'
                     ],
-                    1 => [
+                    [
                         'itemId' => '2',
                         'name' => 'desk',
                         'description' => 'Big Desk',
diff --git a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php
index 797ea61..f5ce9a4 100644
--- a/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php
+++ b/examples/cim/createCustomerProfileTransactionRequest_captureOnly.php
@@ -95,14 +95,14 @@
                     'description' => 'Ground based 5 to 10 day shipping'
                 ],
                 'lineItems' => [
-                    0 => [
+                    [
                         'itemId' => '1',
                         'name' => 'vase',
                         'description' => 'Cannes logo',
                         'quantity' => '18',
                         'unitPrice' => '45.00'
                     ],
-                    1 => [
+                    [
                         'itemId' => '2',
                         'name' => 'desk',
                         'description' => 'Big Desk',
diff --git a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php
index ee5bdb7..81552f7 100644
--- a/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php
+++ b/examples/cim/createCustomerProfileTransactionRequest_priorAuthCapture.php
@@ -87,14 +87,14 @@
                     'description' => 'Ground based 5 to 10 day shipping'
                 ],
                 'lineItems' => [
-                    0 => [
+                    [
                         'itemId' => '1',
                         'name' => 'vase',
                         'description' => 'Cannes logo',
                         'quantity' => '18',
                         'unitPrice' => '45.00'
                     ],
-                    1 => [
+                    [
                         'itemId' => '2',
                         'name' => 'desk',
                         'description' => 'Big Desk',
diff --git a/examples/cim/createCustomerProfileTransactionRequest_refund.php b/examples/cim/createCustomerProfileTransactionRequest_refund.php
index 7d41882..17fafe3 100644
--- a/examples/cim/createCustomerProfileTransactionRequest_refund.php
+++ b/examples/cim/createCustomerProfileTransactionRequest_refund.php
@@ -93,14 +93,14 @@
                     'description' => 'Ground based 5 to 10 day shipping'
                 ],
                 'lineItems' => [
-                    0 => [
+                    [
                         'itemId' => '1',
                         'name' => 'vase',
                         'description' => 'Cannes logo',
                         'quantity' => '18',
                         'unitPrice' => '45.00'
                     ],
-                    1 => [
+                    [
                         'itemId' => '2',
                         'name' => 'desk',
                         'description' => 'Big Desk',

From 522090ff087ea1c8552632e664a482687aa8f5d6 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Thu, 28 Nov 2019 11:17:57 -0500
Subject: [PATCH 086/105] Made code PSR-12 compatible

---
 src/authnet/AuthnetApiFactory.php      | 12 ++++++------
 src/authnet/AuthnetJsonResponse.php    |  2 +-
 src/authnet/AuthnetSim.php             |  8 ++++----
 src/authnet/AuthnetWebhooksRequest.php |  4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php
index 94d7a96..34abebb 100644
--- a/src/authnet/AuthnetApiFactory.php
+++ b/src/authnet/AuthnetApiFactory.php
@@ -49,7 +49,7 @@ class AuthnetApiFactory
      *
      * @param  string      $login                          Authorize.Net API Login ID
      * @param  string      $transaction_key                Authorize.Net API Transaction Key
-     * @param  integer     $server                         ID of which server to use (optional)
+     * @param  int         $server                         ID of which server to use (optional)
      * @return AuthnetJsonRequest
      * @throws ErrorException
      * @throws AuthnetInvalidCredentialsException
@@ -81,7 +81,7 @@ public static function getJsonApiHandler(string $login, string $transaction_key,
     /**
      * Gets the API endpoint to be used for a JSON API call.
      *
-     * @param  integer     $server     ID of which server to use
+     * @param  int         $server     ID of which server to use
      * @return string                  The URL endpoint the request is to be sent to
      * @throws AuthnetInvalidServerException
      */
@@ -103,7 +103,7 @@ protected static function getWebServiceURL(int $server) : string
      *
      * @param  string      $login                  Authorize.Net API Login ID
      * @param  string      $transaction_key        Authorize.Net API Transaction Key
-     * @param  integer     $server                 ID of which server to use (optional)
+     * @param  int         $server                 ID of which server to use (optional)
      * @return AuthnetSim
      * @throws AuthnetInvalidCredentialsException
      * @throws AuthnetInvalidServerException
@@ -126,7 +126,7 @@ public static function getSimHandler(string $login, string $transaction_key, ?in
     /**
      * Gets the API endpoint to be used for a SIM API call.
      *
-     * @param  integer     $server     ID of which server to use
+     * @param  int         $server     ID of which server to use
      * @return string                  The URL endpoint the request is to be sent to
      * @throws AuthnetInvalidServerException
      */
@@ -147,7 +147,7 @@ protected static function getSimURL(int $server) : string
      *
      * @param  string      $login                          Authorize.Net API Login ID
      * @param  string      $transaction_key                Authorize.Net API Transaction Key
-     * @param  integer     $server                         ID of which server to use (optional)
+     * @param  int         $server                         ID of which server to use (optional)
      * @throws ErrorException
      * @return AuthnetWebhooksRequest
      * @throws AuthnetInvalidCredentialsException
@@ -182,7 +182,7 @@ public static function getWebhooksHandler(string $login, string $transaction_key
     /**
      * Gets the API endpoint to be used for a SIM API call.
      *
-     * @param  integer     $server     ID of which server to use
+     * @param  int         $server     ID of which server to use
      * @return string                  The URL endpoint the request is to be sent to
      * @throws AuthnetInvalidServerException
      */
diff --git a/src/authnet/AuthnetJsonResponse.php b/src/authnet/AuthnetJsonResponse.php
index 17cea45..214d27f 100644
--- a/src/authnet/AuthnetJsonResponse.php
+++ b/src/authnet/AuthnetJsonResponse.php
@@ -205,7 +205,7 @@ public function isDeclined() : bool
     /**
      * Check to see if the ResponseCode matches the expected value
      *
-     * @param  integer $status
+     * @param  int     $status
      * @return bool Check to see if the ResponseCode matches the expected value
      */
     protected function checkTransactionStatus(int $status) : bool
diff --git a/src/authnet/AuthnetSim.php b/src/authnet/AuthnetSim.php
index 6e7055a..9df7270 100644
--- a/src/authnet/AuthnetSim.php
+++ b/src/authnet/AuthnetSim.php
@@ -41,12 +41,12 @@ class AuthnetSim
     private $url;
 
     /**
-     * @var     integer  Randomly generated number
+     * @var     int  Randomly generated number
      */
     private $sequence;
 
     /**
-     * @var     integer  Unix timestamp the request was made
+     * @var     int  Unix timestamp the request was made
      */
     private $timestamp;
 
@@ -98,7 +98,7 @@ public function getFingerprint(float $amount) : string
     /**
      * Returns the sequence generated for a transaction
      *
-     * @return  integer           Current sequence
+     * @return  int Current sequence
      */
     public function getSequence() : int
     {
@@ -108,7 +108,7 @@ public function getSequence() : int
     /**
      * Returns the timestamp for a transaction
      *
-     * @return  integer           Current timestamp
+     * @return  int Current timestamp
      */
     public function getTimestamp() : int
     {
diff --git a/src/authnet/AuthnetWebhooksRequest.php b/src/authnet/AuthnetWebhooksRequest.php
index a4dc973..7e1466c 100644
--- a/src/authnet/AuthnetWebhooksRequest.php
+++ b/src/authnet/AuthnetWebhooksRequest.php
@@ -218,8 +218,8 @@ public function deleteWebhook(string $webhookId) : void
     /**
      * Retrieve Notification History
      *
-     * @param   integer   $limit    Default: 1000
-     * @param   integer   $offset   Default: 0
+     * @param   int   $limit    Default: 1000
+     * @param   int   $offset   Default: 0
      * @return  AuthnetWebhooksResponse
      * @throws  AuthnetInvalidJsonException
      * @throws  AuthnetCurlException

From 9bce9fe29d78489df6cc5a481a05959e09e108de Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 8 Mar 2020 09:22:35 -0400
Subject: [PATCH 087/105] Updated CHANGELOG to reflect v4.0.0 beta release

---
 CHANGELOG | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 1206039..71a2c7d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,6 @@
 CHANGE LOG
 
-2019-XX-XX - Version 4.0.0-beta
+2020-03-08 - Version 4.0.0-beta
 --------------------------------------------
 Bumped minimum supported version of PHP to 7.2
 If trying to retrieve non-existent response value, NULL is returned in AuthnetJsonResponse::__get()

From f7d019bbc228a61eeebbe97cf74de2f9660803f8 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sun, 8 Mar 2020 21:24:19 -0400
Subject: [PATCH 088/105] Fixed typo in examples. Updated some dates to not be
 so far in the past.

---
 README.md | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 8fa4e0e..8af0322 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,8 @@ The format of the array to be passed during the API call follows the structure o
 Authorize.Net provides a development environment for developers to test their integration against. To use this server
 (as opposed to their production endpoint) set the optional third parameter of `AuthnetApiFactory::getJsonApiHandler()` to be `1` or use the built in class constant `AuthnetApiFactory::USE_DEVELOPMENT_SERVER`:
 
-    $json = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
+    $json = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, 
+                                                    AuthnetApiFactory::USE_DEVELOPMENT_SERVER);
 
 ## Usage Examples
 
@@ -68,7 +69,7 @@ transaction ID).
 
     $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY);
     $response = $request->createTransactionRequest([
-        'refId' => rand(1000000, 100000000],
+        'refId' => rand(1000000, 100000000),
         'transactionRequest' => [
             'transactionType' => 'authCaptureTransaction',
             'amount' => 5,
@@ -89,7 +90,7 @@ transaction ID).
 
     $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY);
     $response = $request->createTransactionRequest([
-        'refId' => rand(1000000, 100000000],
+        'refId' => rand(1000000, 100000000),
         'transactionRequest' => [
             'transactionType' => 'authCaptureTransaction',
             'amount' => 5,
@@ -285,8 +286,8 @@ transaction ID).
     $request = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY);
     $response = $request->getSettledBatchListRequest([
         'includeStatistics'   => 'true',
-        'firstSettlementDate' => '2015-01-01T08:15:30',
-        'lastSettlementDate'  => '2015-01-30T08:15:30',
+        'firstSettlementDate' => '2020-01-01T08:15:30',
+        'lastSettlementDate'  => '2020-01-30T08:15:30',
     ]);
 
     if ($response->isSuccessful()) {

From 34add9b5991b285377575272bf2c5bc50e6117bc Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 14 Mar 2020 08:56:19 -0400
Subject: [PATCH 089/105] Updated dates to be more recent

---
 README.md | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 8af0322..3a74fee 100644
--- a/README.md
+++ b/README.md
@@ -76,7 +76,7 @@ transaction ID).
             'payment' => [
                 'creditCard' => [
                     'cardNumber' => '4111111111111111',
-                    'expirationDate' => '122016',
+                    'expirationDate' => '122026',
                     'cardCode' => '999',
                 ]
             ]
@@ -97,7 +97,7 @@ transaction ID).
             'payment' => [
                 'creditCard' => [
                     'cardNumber' => '4111111111111111',
-                    'expirationDate' => '122016',
+                    'expirationDate' => '122026',
                     'cardCode' => '999',
                 ],
             ],
@@ -225,7 +225,7 @@ transaction ID).
                 'payment' => [
                     'creditCard' => [
                     'cardNumber' => '4111111111111111',
-                    'expirationDate' => '2016-08',
+                    'expirationDate' => '2026-08',
                     ],
                 ],
             ],
@@ -258,7 +258,7 @@ transaction ID).
                     'length' => '1',
                     'unit' => 'months'
                 ],
-                'startDate' => '2015-04-18',
+                'startDate' => '2020-04-18',
                 'totalOccurrences' => '12',
                 'trialOccurrences' => '1'
             ],

From 786cd671987bdaba040b15fed70acf662225fd88 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Sat, 14 Mar 2020 09:33:13 -0400
Subject: [PATCH 090/105] Changed name of Akamai endpoint to be more generic
 and accurate (CDN); includes tests

---
 CHANGELOG                         |  4 ++++
 src/authnet/AuthnetApiFactory.php |  8 ++++----
 tests/AuthnetApiFactoryTest.php   | 15 ++++++++-------
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 71a2c7d..3ea39c4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,9 @@
 CHANGE LOG
 
+2020-XX-XX - Version 4.0.0
+--------------------------------------------
+Changed name of Akamai endpoint to be more generic and accurate (CDN); includes tests
+
 2020-03-08 - Version 4.0.0-beta
 --------------------------------------------
 Bumped minimum supported version of PHP to 7.2
diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php
index 34abebb..5e467e4 100644
--- a/src/authnet/AuthnetApiFactory.php
+++ b/src/authnet/AuthnetApiFactory.php
@@ -40,9 +40,9 @@ class AuthnetApiFactory
     public const USE_DEVELOPMENT_SERVER = 1;
 
     /**
-     * @const Indicates use of the Akamai endpoint
+     * @const Indicates use of the CDN endpoint
      */
-    public const USE_AKAMAI_SERVER = 2;
+    public const USE_CDN_SERVER = 2;
 
     /**
      * Validates the Authorize.Net credentials and returns a Request object to be used to make an API call.
@@ -59,7 +59,7 @@ public static function getJsonApiHandler(string $login, string $transaction_key,
     {
         $login           = trim($login);
         $transaction_key = trim($transaction_key);
-        $server          = $server ?? self::USE_AKAMAI_SERVER;
+        $server          = $server ?? self::USE_CDN_SERVER;
         $api_url         = static::getWebServiceURL($server);
 
         if (empty($login) || empty($transaction_key)) {
@@ -90,7 +90,7 @@ protected static function getWebServiceURL(int $server) : string
         $urls = [
             static::USE_PRODUCTION_SERVER  => 'https://api.authorize.net/xml/v1/request.api',
             static::USE_DEVELOPMENT_SERVER => 'https://apitest.authorize.net/xml/v1/request.api',
-            static::USE_AKAMAI_SERVER      => 'https://api2.authorize.net/xml/v1/request.api',
+            static::USE_CDN_SERVER      => 'https://api2.authorize.net/xml/v1/request.api',
         ];
         if (array_key_exists($server, $urls)) {
             return $urls[$server];
diff --git a/tests/AuthnetApiFactoryTest.php b/tests/AuthnetApiFactoryTest.php
index c8d07b4..55fcae8 100644
--- a/tests/AuthnetApiFactoryTest.php
+++ b/tests/AuthnetApiFactoryTest.php
@@ -12,6 +12,7 @@
 namespace JohnConde\Authnet;
 
 use PHPUnit\Framework\TestCase;
+use Curl\Curl;
 
 class AuthnetApiFactoryTest extends TestCase
 {
@@ -53,9 +54,9 @@ public function testGetWebServiceUrlDevelopmentServer() : void
     /**
      * @covers            \JohnConde\Authnet\AuthnetApiFactory::getWebServiceURL
      */
-    public function testGetWebServiceUrlAkamaiServer() : void
+    public function testGetWebServiceUrlCDNServer() : void
     {
-        $server           = AuthnetApiFactory::USE_AKAMAI_SERVER;
+        $server           = AuthnetApiFactory::USE_CDN_SERVER;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
         $reflectionMethod->setAccessible(true);
         $url              = $reflectionMethod->invoke(null, $server);
@@ -70,7 +71,7 @@ public function testGetWebServiceUrlAkamaiServer() : void
      */
     public function testGetWebServiceUrlBadServer() : void
     {
-        $this->expectException('\JohnConde\Authnet\AuthnetInvalidServerException');
+        $this->expectException(AuthnetInvalidServerException::class);
 
         $server           = 99;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
@@ -129,7 +130,7 @@ public function testCurlWrapperProductionResponse() : void
         $reflectionOfProcessor->setAccessible(true);
         $processor = $reflectionOfProcessor->getValue($authnet);
 
-        $this->assertInstanceOf('\Curl\Curl', $processor);
+        $this->assertInstanceOf(Curl::class, $processor);
     }
 
     /**
@@ -146,7 +147,7 @@ public function testCurlWrapperDevelopmentResponse() : void
         $reflectionOfProcessor->setAccessible(true);
         $processor = $reflectionOfProcessor->getValue($authnet);
 
-        $this->assertInstanceOf('\Curl\Curl', $processor);
+        $this->assertInstanceOf(Curl::class, $processor);
     }
 
     /**
@@ -260,7 +261,7 @@ public function testCurlWrapperProductionResponseWebhooks() : void
         $reflectionOfProcessor->setAccessible(true);
         $processor = $reflectionOfProcessor->getValue($authnet);
 
-        $this->assertInstanceOf('\Curl\Curl', $processor);
+        $this->assertInstanceOf(Curl::class, $processor);
     }
 
     /**
@@ -277,7 +278,7 @@ public function testCurlWrapperDevelopmentResponseWebhooks() : void
         $reflectionOfProcessor->setAccessible(true);
         $processor = $reflectionOfProcessor->getValue($authnet);
 
-        $this->assertInstanceOf('\Curl\Curl', $processor);
+        $this->assertInstanceOf(Curl::class, $processor);
     }
 
     /**

From 5f9b59f464f7e894380c36123272be3f3760fdd6 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Tue, 31 Mar 2020 10:23:23 -0400
Subject: [PATCH 091/105] Fixed spacing/formatting

---
 src/authnet/AuthnetApiFactory.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php
index 5e467e4..6a0eba4 100644
--- a/src/authnet/AuthnetApiFactory.php
+++ b/src/authnet/AuthnetApiFactory.php
@@ -90,7 +90,7 @@ protected static function getWebServiceURL(int $server) : string
         $urls = [
             static::USE_PRODUCTION_SERVER  => 'https://api.authorize.net/xml/v1/request.api',
             static::USE_DEVELOPMENT_SERVER => 'https://apitest.authorize.net/xml/v1/request.api',
-            static::USE_CDN_SERVER      => 'https://api2.authorize.net/xml/v1/request.api',
+            static::USE_CDN_SERVER         => 'https://api2.authorize.net/xml/v1/request.api',
         ];
         if (array_key_exists($server, $urls)) {
             return $urls[$server];

From 136c42ada30186574c2e621f9b390b1ff01dff43 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Tue, 31 Mar 2020 10:23:52 -0400
Subject: [PATCH 092/105] Fixed example to use properly formatted arrays

---
 .../createTransactionRequest_authCapture.php  | 56 ++++++++++---------
 1 file changed, 30 insertions(+), 26 deletions(-)

diff --git a/examples/aim/createTransactionRequest_authCapture.php b/examples/aim/createTransactionRequest_authCapture.php
index 898d0b5..529f9b0 100644
--- a/examples/aim/createTransactionRequest_authCapture.php
+++ b/examples/aim/createTransactionRequest_authCapture.php
@@ -252,35 +252,39 @@
             ],
             'customerIP' => '192.168.1.1',
             'transactionSettings' => [
-                [
-                    'settingName' =>'allowPartialAuth',
-                    'settingValue' => 'false'
-                ],
-                [
-                    'settingName' => 'duplicateWindow',
-                    'settingValue' => '0'
-                ],
-                [
-                    'settingName' => 'emailCustomer',
-                    'settingValue' => 'false'
-                ],
-                [
-                    'settingName' => 'recurringBilling',
-                    'settingValue' => 'false'
-                ],
-                [
-                    'settingName' => 'testRequest',
-                    'settingValue' => 'false'
+                'setting' => [
+                    0 => [
+                        'settingName' =>'allowPartialAuth',
+                        'settingValue' => 'false'
+                    ],
+                    1 => [
+                        'settingName' => 'duplicateWindow',
+                        'settingValue' => '0'
+                    ],
+                    2 => [
+                        'settingName' => 'emailCustomer',
+                        'settingValue' => 'false'
+                    ],
+                    3 => [
+                        'settingName' => 'recurringBilling',
+                        'settingValue' => 'false'
+                    ],
+                    4 => [
+                        'settingName' => 'testRequest',
+                        'settingValue' => 'false'
+                    ]
                 ]
             ],
             'userFields' => [
-                [
-                    'name' => 'MerchantDefinedFieldName1',
-                    'value' => 'MerchantDefinedFieldValue1',
-                ],
-                [
-                    'name' => 'favorite_color',
-                    'value' => 'blue',
+                'userField' => [
+                    0 => [
+                        'name' => 'MerchantDefinedFieldName1',
+                        'value' => 'MerchantDefinedFieldValue1',
+                    ],
+                    1 => [
+                        'name' => 'favorite_color',
+                        'value' => 'blue',
+                    ],
                 ],
             ],
         ],

From 8d76627f89afd0b3e687e78272fa21429dbb24b1 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Tue, 31 Mar 2020 20:57:47 -0400
Subject: [PATCH 093/105] Changed config.inc.php to throw RuntimeException

---
 CHANGELOG           | 2 ++
 config.inc.php.dist | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 3ea39c4..d6f7892 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,8 @@ CHANGE LOG
 2020-XX-XX - Version 4.0.0
 --------------------------------------------
 Changed name of Akamai endpoint to be more generic and accurate (CDN); includes tests
+Minor fixes for examples
+Changed config.inc.php to throw RuntimeException
 
 2020-03-08 - Version 4.0.0-beta
 --------------------------------------------
diff --git a/config.inc.php.dist b/config.inc.php.dist
index ca01df3..ca1b32f 100644
--- a/config.inc.php.dist
+++ b/config.inc.php.dist
@@ -11,5 +11,5 @@
     defined('AUTHNET_SIGNATURE') || define('AUTHNET_SIGNATURE', '');
 
     if (version_compare(PHP_VERSION, '7.2.0') < 0) {
-        throw new \Exception('AuthnetJson requires PHP 7.2 or greater');
+        throw new \RuntimeException('AuthnetJson requires PHP 7.2 or greater');
     }

From 08b7d8d9b22e9cc6e150b1c31086d2c290d9a214 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Wed, 1 Apr 2020 10:11:29 -0400
Subject: [PATCH 094/105] Minor fixes for examples

---
 .../aim/createTransactionRequest_authOnly.php | 58 ++++++++++---------
 .../createTransactionRequest_partialAuth.php  | 15 ++---
 2 files changed, 39 insertions(+), 34 deletions(-)

diff --git a/examples/aim/createTransactionRequest_authOnly.php b/examples/aim/createTransactionRequest_authOnly.php
index f822209..b93f3d2 100644
--- a/examples/aim/createTransactionRequest_authOnly.php
+++ b/examples/aim/createTransactionRequest_authOnly.php
@@ -216,35 +216,39 @@
             ],
             'customerIP' => '192.168.1.1',
             'transactionSettings' => [
-                [
-                    'settingName' => 'allowPartialAuth',
-                    'settingValue' => 'false',
-                ],
-                [
-                    'settingName' => 'duplicateWindow',
-                    'settingValue' => '0',
-                ],
-                [
-                    'settingName' => 'emailCustomer',
-                    'settingValue' => 'false',
-                ],
-                [
-                  'settingName' => 'recurringBilling',
-                  'settingValue' => 'false',
-                ],
-                [
-                    'settingName' => 'testRequest',
-                    'settingValue' => 'false',
-                ],
+                'setting' => [
+                    0 => [
+                        'settingName' =>'allowPartialAuth',
+                        'settingValue' => 'false'
+                    ],
+                    1 => [
+                        'settingName' => 'duplicateWindow',
+                        'settingValue' => '0'
+                    ],
+                    2 => [
+                        'settingName' => 'emailCustomer',
+                        'settingValue' => 'false'
+                    ],
+                    3 => [
+                        'settingName' => 'recurringBilling',
+                        'settingValue' => 'false'
+                    ],
+                    4 => [
+                        'settingName' => 'testRequest',
+                        'settingValue' => 'false'
+                    ]
+                ]
             ],
             'userFields' => [
-                [
-                    'name' => 'MerchantDefinedFieldName1',
-                    'value' => 'MerchantDefinedFieldValue1',
-                ],
-                [
-                    'name' => 'favorite_color',
-                    'value' => 'blue',
+                'userField' => [
+                    0 => [
+                        'name' => 'MerchantDefinedFieldName1',
+                        'value' => 'MerchantDefinedFieldValue1',
+                    ],
+                    1 => [
+                        'name' => 'favorite_color',
+                        'value' => 'blue',
+                    ],
                 ],
             ],
         ],
diff --git a/examples/aim/createTransactionRequest_partialAuth.php b/examples/aim/createTransactionRequest_partialAuth.php
index 607bc82..38111ec 100644
--- a/examples/aim/createTransactionRequest_partialAuth.php
+++ b/examples/aim/createTransactionRequest_partialAuth.php
@@ -151,23 +151,24 @@
                'country' => 'USA',
             ],
             'transactionSettings' => [
-                [
-                    [
+                'setting' => [
+                    0 => [
                         'settingName' =>'allowPartialAuth',
-                        'settingValue' => 'true'
+                        'settingValue' => 'false'
                     ],
-                    [
+                    1 => [
                         'settingName' => 'duplicateWindow',
                         'settingValue' => '0'
-                    ], [
+                    ],
+                    2 => [
                         'settingName' => 'emailCustomer',
                         'settingValue' => 'false'
                     ],
-                    [
+                    3 => [
                         'settingName' => 'recurringBilling',
                         'settingValue' => 'false'
                     ],
-                    [
+                    4 => [
                         'settingName' => 'testRequest',
                         'settingValue' => 'false'
                     ]

From c4f641495712e65a611b507e1d0c88873d69bb82 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Wed, 1 Apr 2020 12:53:27 -0400
Subject: [PATCH 095/105] Updated README to make supported versions of PHP
 clearer

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 3a74fee..61368c5 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Library that abstracts [Authorize.Net](http://www.authorize.net/)'s [JSON APIs](
 
 ## Requirements
 
-- PHP 7.2+
+- PHP 7.2+ (Support PHP 7.2.0 - 7.4.*)
 - cURL PHP Extension
 - JSON PHP Extension
 - An Authorize.Net account

From cad5a49aa7fdf633547a656a6d168a7887646d6d Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Wed, 1 Apr 2020 14:42:15 -0400
Subject: [PATCH 096/105] Renamed variable to be clearer what its purpose is

---
 src/authnet/AuthnetApiFactory.php |  8 ++--
 tests/AuthnetApiFactoryTest.php   | 76 +++++++++++++++----------------
 2 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/src/authnet/AuthnetApiFactory.php b/src/authnet/AuthnetApiFactory.php
index 6a0eba4..0a32581 100644
--- a/src/authnet/AuthnetApiFactory.php
+++ b/src/authnet/AuthnetApiFactory.php
@@ -49,18 +49,18 @@ class AuthnetApiFactory
      *
      * @param  string      $login                          Authorize.Net API Login ID
      * @param  string      $transaction_key                Authorize.Net API Transaction Key
-     * @param  int         $server                         ID of which server to use (optional)
+     * @param  int         $endpoint                       ID of which endpoint to use (optional)
      * @return AuthnetJsonRequest
      * @throws ErrorException
      * @throws AuthnetInvalidCredentialsException
      * @throws AuthnetInvalidServerException
      */
-    public static function getJsonApiHandler(string $login, string $transaction_key, ?int $server = null) : object
+    public static function getJsonApiHandler(string $login, string $transaction_key, ?int $endpoint = null) : object
     {
         $login           = trim($login);
         $transaction_key = trim($transaction_key);
-        $server          = $server ?? self::USE_CDN_SERVER;
-        $api_url         = static::getWebServiceURL($server);
+        $endpoint        = $endpoint ?? self::USE_CDN_SERVER;
+        $api_url         = static::getWebServiceURL($endpoint);
 
         if (empty($login) || empty($transaction_key)) {
             throw new AuthnetInvalidCredentialsException('You have not configured your login credentials properly.');
diff --git a/tests/AuthnetApiFactoryTest.php b/tests/AuthnetApiFactoryTest.php
index 55fcae8..0c00a27 100644
--- a/tests/AuthnetApiFactoryTest.php
+++ b/tests/AuthnetApiFactoryTest.php
@@ -30,10 +30,10 @@ protected function setUp() : void
      */
     public function testGetWebServiceUrlProductionServer() : void
     {
-        $server           = AuthnetApiFactory::USE_PRODUCTION_SERVER;
+        $endpoint         = AuthnetApiFactory::USE_PRODUCTION_SERVER;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
         $reflectionMethod->setAccessible(true);
-        $url              = $reflectionMethod->invoke(null, $server);
+        $url              = $reflectionMethod->invoke(null, $endpoint);
 
         $this->assertEquals($url, 'https://api.authorize.net/xml/v1/request.api');
     }
@@ -43,10 +43,10 @@ public function testGetWebServiceUrlProductionServer() : void
      */
     public function testGetWebServiceUrlDevelopmentServer() : void
     {
-        $server           = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        $endpoint         = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
         $reflectionMethod->setAccessible(true);
-        $url              = $reflectionMethod->invoke(null, $server);
+        $url              = $reflectionMethod->invoke(null, $endpoint);
 
         $this->assertEquals($url, 'https://apitest.authorize.net/xml/v1/request.api');
     }
@@ -56,10 +56,10 @@ public function testGetWebServiceUrlDevelopmentServer() : void
      */
     public function testGetWebServiceUrlCDNServer() : void
     {
-        $server           = AuthnetApiFactory::USE_CDN_SERVER;
+        $endpoint         = AuthnetApiFactory::USE_CDN_SERVER;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
         $reflectionMethod->setAccessible(true);
-        $url              = $reflectionMethod->invoke(null, $server);
+        $url              = $reflectionMethod->invoke(null, $endpoint);
 
         $this->assertEquals($url, 'https://api2.authorize.net/xml/v1/request.api');
     }
@@ -73,10 +73,10 @@ public function testGetWebServiceUrlBadServer() : void
     {
         $this->expectException(AuthnetInvalidServerException::class);
 
-        $server           = 99;
+        $endpoint         = 99;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebServiceURL');
         $reflectionMethod->setAccessible(true);
-        $reflectionMethod->invoke(null, $server);
+        $reflectionMethod->invoke(null, $endpoint);
     }
 
     /**
@@ -88,8 +88,8 @@ public function testExceptionIsRaisedForInvalidCredentialsLogin() : void
     {
         $this->expectException(AuthnetInvalidCredentialsException::class);
 
-        $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        AuthnetApiFactory::getJsonApiHandler('', $this->transactionKey, $server);
+        $endpoint  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        AuthnetApiFactory::getJsonApiHandler('', $this->transactionKey, $endpoint);
     }
 
     /**
@@ -101,8 +101,8 @@ public function testExceptionIsRaisedForInvalidCredentialsTransactionKey() : voi
     {
         $this->expectException(AuthnetInvalidCredentialsException::class);
 
-        $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        AuthnetApiFactory::getJsonApiHandler($this->login, '', $server);
+        $endpoint  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        AuthnetApiFactory::getJsonApiHandler($this->login, '', $endpoint);
     }
 
     /**
@@ -122,8 +122,8 @@ public function testExceptionIsRaisedForAuthnetInvalidServer() : void
      */
     public function testCurlWrapperProductionResponse() : void
     {
-        $server  = AuthnetApiFactory::USE_PRODUCTION_SERVER;
-        $authnet = AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, $server);
+        $endpoint = AuthnetApiFactory::USE_PRODUCTION_SERVER;
+        $authnet  = AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, $endpoint);
 
         $reflectionClass = new \ReflectionClass(AuthnetJsonRequest::class);
         $reflectionOfProcessor = $reflectionClass->getProperty('processor');
@@ -139,8 +139,8 @@ public function testCurlWrapperProductionResponse() : void
      */
     public function testCurlWrapperDevelopmentResponse() : void
     {
-        $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        $authnet = AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, $server);
+        $endpoint = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        $authnet  = AuthnetApiFactory::getJsonApiHandler($this->login, $this->transactionKey, $endpoint);
 
         $reflectionClass = new \ReflectionClass(AuthnetJsonRequest::class);
         $reflectionOfProcessor = $reflectionClass->getProperty('processor');
@@ -155,8 +155,8 @@ public function testCurlWrapperDevelopmentResponse() : void
      */
     public function testGetSimHandler() : void
     {
-        $server = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        $sim    = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $server);
+        $endpoint = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        $sim    = AuthnetApiFactory::getSimHandler($this->login, $this->transactionKey, $endpoint);
 
         $this->assertInstanceOf(AuthnetSim::class, $sim);
     }
@@ -169,8 +169,8 @@ public function testExceptionIsRaisedForInvalidCredentialsSim() : void
     {
         $this->expectException(AuthnetInvalidCredentialsException::class);
 
-        $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        AuthnetApiFactory::getSimHandler('', $this->transactionKey, $server);
+        $endpoint  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        AuthnetApiFactory::getSimHandler('', $this->transactionKey, $endpoint);
     }
 
     /**
@@ -178,10 +178,10 @@ public function testExceptionIsRaisedForInvalidCredentialsSim() : void
      */
     public function testGetSimServerTest() : void
     {
-        $server           = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        $endpoint         = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getSimURL');
         $reflectionMethod->setAccessible(true);
-        $url              = $reflectionMethod->invoke($reflectionMethod, $server);
+        $url              = $reflectionMethod->invoke($reflectionMethod, $endpoint);
 
         $this->assertEquals($url, 'https://test.authorize.net/gateway/transact.dll');
     }
@@ -191,10 +191,10 @@ public function testGetSimServerTest() : void
      */
     public function testGetSimServerProduction() : void
     {
-        $server           = AuthnetApiFactory::USE_PRODUCTION_SERVER;
+        $endpoint         = AuthnetApiFactory::USE_PRODUCTION_SERVER;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getSimURL');
         $reflectionMethod->setAccessible(true);
-        $url              = $reflectionMethod->invoke($reflectionMethod, $server);
+        $url              = $reflectionMethod->invoke($reflectionMethod, $endpoint);
 
         $this->assertEquals($url, 'https://secure2.authorize.net/gateway/transact.dll');
     }
@@ -219,8 +219,8 @@ public function testExceptionIsRaisedForInvalidCredentialsLoginWebhooks() : void
     {
         $this->expectException(AuthnetInvalidCredentialsException::class);
 
-        $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        AuthnetApiFactory::getWebhooksHandler('', $this->transactionKey, $server);
+        $endpoint  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        AuthnetApiFactory::getWebhooksHandler('', $this->transactionKey, $endpoint);
     }
 
     /**
@@ -232,8 +232,8 @@ public function testExceptionIsRaisedForInvalidCredentialsTransactionKeyWebhooks
     {
         $this->expectException(AuthnetInvalidCredentialsException::class);
 
-        $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        AuthnetApiFactory::getWebhooksHandler($this->login, '', $server);
+        $endpoint = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        AuthnetApiFactory::getWebhooksHandler($this->login, '', $endpoint);
     }
 
     /**
@@ -253,8 +253,8 @@ public function testExceptionIsRaisedForAuthnetInvalidServerWebhooks() : void
      */
     public function testCurlWrapperProductionResponseWebhooks() : void
     {
-        $server  = AuthnetApiFactory::USE_PRODUCTION_SERVER;
-        $authnet = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, $server);
+        $endpoint = AuthnetApiFactory::USE_PRODUCTION_SERVER;
+        $authnet  = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, $endpoint);
 
         $reflectionClass = new \ReflectionClass(AuthnetWebhooksRequest::class);
         $reflectionOfProcessor = $reflectionClass->getProperty('processor');
@@ -270,8 +270,8 @@ public function testCurlWrapperProductionResponseWebhooks() : void
      */
     public function testCurlWrapperDevelopmentResponseWebhooks() : void
     {
-        $server  = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
-        $authnet = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, $server);
+        $endpoint = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        $authnet  = AuthnetApiFactory::getWebhooksHandler($this->login, $this->transactionKey, $endpoint);
 
         $reflectionClass = new \ReflectionClass(AuthnetWebhooksRequest::class);
         $reflectionOfProcessor = $reflectionClass->getProperty('processor');
@@ -286,10 +286,10 @@ public function testCurlWrapperDevelopmentResponseWebhooks() : void
      */
     public function testGetWebhooksUrlProductionServer() : void
     {
-        $server           = AuthnetApiFactory::USE_PRODUCTION_SERVER;
+        $endpoint         = AuthnetApiFactory::USE_PRODUCTION_SERVER;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebhooksURL');
         $reflectionMethod->setAccessible(true);
-        $url              = $reflectionMethod->invoke(null, $server);
+        $url              = $reflectionMethod->invoke(null, $endpoint);
 
         $this->assertEquals($url, 'https://api.authorize.net/rest/v1/');
     }
@@ -299,10 +299,10 @@ public function testGetWebhooksUrlProductionServer() : void
      */
     public function testGetWebhooksUrlDevelopmentServer() : void
     {
-        $server           = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
+        $endpoint         = AuthnetApiFactory::USE_DEVELOPMENT_SERVER;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebhooksURL');
         $reflectionMethod->setAccessible(true);
-        $url              = $reflectionMethod->invoke(null, $server);
+        $url              = $reflectionMethod->invoke(null, $endpoint);
 
         $this->assertEquals($url, 'https://apitest.authorize.net/rest/v1/');
     }
@@ -315,9 +315,9 @@ public function testGetWebhooksUrlBadServer() : void
     {
         $this->expectException(AuthnetInvalidServerException::class);
 
-        $server           = 99;
+        $endpoint         = 99;
         $reflectionMethod = new \ReflectionMethod(AuthnetApiFactory::class, 'getWebhooksURL');
         $reflectionMethod->setAccessible(true);
-        $reflectionMethod->invoke(null, $server);
+        $reflectionMethod->invoke(null, $endpoint);
     }
 }

From 5eea6941513bc78a87db274bd40de02cc70c70a8 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Wed, 1 Apr 2020 14:43:37 -0400
Subject: [PATCH 097/105] Renamed variable to be clearer what its purpose is

---
 CHANGELOG | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index d6f7892..b2c60c7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -157,7 +157,7 @@ Fixed bug where AuthnetInvalidJsonException would not be thrown when invalid JSO
 
 2015-03-30 - Version 1.0.1
 --------------------------------------------
-Fixed bug where setting the third parameter AuthnetApiFactory::getJsonApiHandler to NULL would default to production server
+Fixed bug where setting the third parameter AuthnetApiFactory::getJsonApiHandler to NULL would default to production endpoint
 Throws AuthnetInvalidJsonException if response JSON is not valid
 Finished adding examples
 Added more unit tests

From 726a2578bf6b3516473446d68fd24341cb56e0c1 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Wed, 1 Apr 2020 14:43:47 -0400
Subject: [PATCH 098/105] Updated README to make supported versions of PHP
 clearer

---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 61368c5..b6564b9 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Library that abstracts [Authorize.Net](http://www.authorize.net/)'s [JSON APIs](
 
 ## Requirements
 
-- PHP 7.2+ (Support PHP 7.2.0 - 7.4.*)
+- PHP 7.2+ (Support for PHP 7.2.0 - 7.4.*)
 - cURL PHP Extension
 - JSON PHP Extension
 - An Authorize.Net account
@@ -52,7 +52,7 @@ The format of the array to be passed during the API call follows the structure o
 
 ## Using the Authorize.Net Development Server
 
-Authorize.Net provides a development environment for developers to test their integration against. To use this server
+Authorize.Net provides a development environment for developers to test their integration against. To use this endpoint
 (as opposed to their production endpoint) set the optional third parameter of `AuthnetApiFactory::getJsonApiHandler()` to be `1` or use the built in class constant `AuthnetApiFactory::USE_DEVELOPMENT_SERVER`:
 
     $json = AuthnetApiFactory::getJsonApiHandler(AUTHNET_LOGIN, AUTHNET_TRANSKEY, 

From fd1b8028b223162548baccf8a111116f6e34c5aa Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Wed, 1 Apr 2020 14:45:08 -0400
Subject: [PATCH 099/105] Updated example in README

---
 README.md | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index b6564b9..089d724 100644
--- a/README.md
+++ b/README.md
@@ -190,12 +190,14 @@ transaction ID).
             ],
             'userFields' => [
                 'userField' => [
-                    'name' => 'MerchantDefinedFieldName1',
-                    'value' => 'MerchantDefinedFieldValue1',
-                ],
-                'userField' => [
-                    'name' => 'favorite_color',
-                    'value' => 'blue',
+                    0 => [
+                        'name' => 'MerchantDefinedFieldName1',
+                        'value' => 'MerchantDefinedFieldValue1',
+                    ],
+                    1 => [
+                        'name' => 'favorite_color',
+                        'value' => 'blue',
+                    ],
                 ],
             ],
         ],

From 75e9bc2201c82e9758957711601e90925caf05d9 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Wed, 1 Apr 2020 14:47:00 -0400
Subject: [PATCH 100/105] Updated Scrutenizer badge

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 089d724..3bc1723 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 [![Latest Stable Version](https://poser.pugx.org/stymiee/authnetjson/v/stable.svg)](https://packagist.org/packages/stymiee/authnetjson)
 [![Total Downloads](https://poser.pugx.org/stymiee/authnetjson/downloads)](https://packagist.org/packages/stymiee/authnetjson)
 [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/stymiee/authnetjson/?branch=php72)
-[![Build Status](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/build.png?b=master)](https://scrutinizer-ci.com/g/stymiee/authnetjson/build-status/php72)
+[![Build Status](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/build.png?b=php72)](https://scrutinizer-ci.com/g/stymiee/authnetjson/build-status/php72)
 [![Code Coverage](https://scrutinizer-ci.com/g/stymiee/authnetjson/badges/coverage.png?b=php72)](https://scrutinizer-ci.com/g/stymiee/authnetjson/?branch=php72)
 [![Maintainability](https://api.codeclimate.com/v1/badges/5847da924af47933e25f/maintainability)](https://codeclimate.com/github/stymiee/authnetjson/maintainability)
 [![License](https://poser.pugx.org/stymiee/authnetjson/license)](https://packagist.org/packages/stymiee/authnetjson)

From 75c73cc9b1d829d4aea1a7f4fcf820e9dc9ee067 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Fri, 3 Apr 2020 14:16:56 -0400
Subject: [PATCH 101/105] Updated HELP to webhook.site

---
 HELP.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/HELP.md b/HELP.md
index 586eae1..111ffd4 100644
--- a/HELP.md
+++ b/HELP.md
@@ -13,7 +13,7 @@ virtually every aspect of the Authorize.Net production APIs without incurring an
 ### Use a webhook testing site to test webhooks
 
 Having a full understanding of what a webhook looks like makes working with webhooks easier. You can inspect an 
-Authorize.Net webhook using a third party service like [RequestBin](https://requestbin.fullcontact.com/).
+Authorize.Net webhook using a third party service like [webhook.site](https://webhook.site/).
 
 ## FAQ
 

From 3c96c72ed3f435c27628f1794dc01fce9939d7c3 Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Fri, 3 Apr 2020 19:59:36 -0400
Subject: [PATCH 102/105] Updated developer info

---
 composer.json | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/composer.json b/composer.json
index 8c8d54e..0d0746a 100644
--- a/composer.json
+++ b/composer.json
@@ -12,6 +12,7 @@
         "capture-transaction",
         "authorize-net",
         "authorizenet",
+        "authnet",
         "payment",
         "payment-gateway"
     ],
@@ -21,7 +22,7 @@
         {
             "name": "John Conde",
             "email": "stymiee@gmail.com",
-            "homepage": "http://www.johnconde.net",
+            "homepage": "https://stymiee.dev",
             "role": "Developer"
         }
     ],
@@ -38,7 +39,10 @@
     },
     "autoload": {
         "psr-4": {
-            "JohnConde\\Authnet\\": ["src/authnet/" ,"src/exceptions/"]
+            "JohnConde\\Authnet\\": [
+                "src/authnet/",
+                "src/exceptions/"
+            ]
         }
     }
-}
\ No newline at end of file
+}

From 03cecdb81966fa4e87193108085f10e585c6d38d Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Thu, 16 Apr 2020 14:33:48 -0400
Subject: [PATCH 103/105] Updated curl/curl dependency to major version (2)

---
 composer.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/composer.json b/composer.json
index 0d0746a..827cd9a 100644
--- a/composer.json
+++ b/composer.json
@@ -28,7 +28,7 @@
     ],
     "require": {
         "php": ">=7.2.0",
-        "curl/curl": "^2.2",
+        "curl/curl": "^2",
         "ext-curl": "*",
         "ext-json": "*"
     },

From a7e555cb4a68df424cfc4d63276d8c9d45f090ea Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Thu, 16 Apr 2020 14:42:52 -0400
Subject: [PATCH 104/105] Updated PHPUnit to v9

---
 composer.json            | 2 +-
 tests/AuthnetSimTest.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/composer.json b/composer.json
index 827cd9a..c428119 100644
--- a/composer.json
+++ b/composer.json
@@ -33,7 +33,7 @@
         "ext-json": "*"
     },
     "require-dev": {
-        "phpunit/phpunit": "^8",
+        "phpunit/phpunit": "^9",
         "squizlabs/php_codesniffer": "3.*",
         "phpmd/phpmd" : "@stable"
     },
diff --git a/tests/AuthnetSimTest.php b/tests/AuthnetSimTest.php
index 3534475..6065db2 100644
--- a/tests/AuthnetSimTest.php
+++ b/tests/AuthnetSimTest.php
@@ -13,7 +13,7 @@
 
 use PHPUnit\Framework\TestCase;
 
-class AuthnetJsonSimTest extends TestCase
+class AuthnetSimTest extends TestCase
 {
     private $login;
     private $transactionKey;

From ab43e2e441ffd44b563885058e6fc9668c47f2ef Mon Sep 17 00:00:00 2001
From: John Conde 
Date: Tue, 21 Apr 2020 15:08:06 -0400
Subject: [PATCH 105/105] Updated URL for github homepage to use HTTPS

---
 composer.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/composer.json b/composer.json
index c428119..abe8e00 100644
--- a/composer.json
+++ b/composer.json
@@ -16,7 +16,7 @@
         "payment",
         "payment-gateway"
     ],
-    "homepage": "http://github.com/stymiee/authnetjson",
+    "homepage": "https://github.com/stymiee/authnetjson",
     "license": "Apache-2.0",
     "authors": [
         {
Authorize.Net Webhook Response
Webhook Response JSON
Webhook Response JSON
'."\n";
         $output .= $this->responseJson."\n";
         $output .= '