From 47763ef495ddd388ed40f5ddcb780b6ce33cd758 Mon Sep 17 00:00:00 2001 From: neopheus Date: Wed, 3 Jan 2018 13:27:54 +0100 Subject: [PATCH 1/2] UPDATE COMPOSER PACKAGES --- composer.json | 6 + composer.lock | 232 + vendor/autoload.php | 2 +- vendor/composer/ClassLoader.php | 48 +- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_real.php | 2 +- vendor/composer/autoload_static.php | 7 +- vendor/composer/installed.json | 53 +- vendor/monext/payline-sdk/CHANGELOG.md | 15 + vendor/monext/payline-sdk/composer.json | 6 +- .../{Address.class.php => Address.php} | 78 +- ...ddressOwner.class.php => AddressOwner.php} | 46 +- ...e.class.php => Authentication3DSecure.php} | 66 +- ...horization.class.php => Authorization.php} | 34 +- ...ountData.class.php => BankAccountData.php} | 42 +- ...e.class.php => BillingRecordForUpdate.php} | 42 +- .../Payline/{Buyer.class.php => Buyer.php} | 138 +- .../src/Payline/{Card.class.php => Card.php} | 67 +- .../Payline/{Cheque.class.php => Cheque.php} | 30 +- .../{Creditor.class.php => Creditor.php} | 38 +- .../Payline/{Order.class.php => Order.php} | 82 +- ...{OrderDetail.class.php => OrderDetail.php} | 66 +- .../Payline/{Owner.class.php => Owner.php} | 42 +- .../payline-sdk/src/Payline/PaylineSDK.php | 791 +- .../{Payment.class.php => Payment.php} | 62 +- .../payline-sdk/src/Payline/PaymentData.php | 19 + ...{PrivateData.class.php => PrivateData.php} | 34 +- .../{Recurring.class.php => Recurring.php} | 54 +- .../Payline/{Wallet.class.php => Wallet.php} | 66 +- .../src/Payline/{v4.49.wsdl => v4.52.wsdl} | 6926 ++++++++--------- 31 files changed, 4685 insertions(+), 4413 deletions(-) create mode 100644 composer.json create mode 100644 composer.lock rename vendor/monext/payline-sdk/src/Payline/{Address.class.php => Address.php} (93%) rename vendor/monext/payline-sdk/src/Payline/{AddressOwner.class.php => AddressOwner.php} (94%) rename vendor/monext/payline-sdk/src/Payline/{Authentication3DSecure.class.php => Authentication3DSecure.php} (93%) rename vendor/monext/payline-sdk/src/Payline/{Authorization.class.php => Authorization.php} (94%) rename vendor/monext/payline-sdk/src/Payline/{BankAccountData.class.php => BankAccountData.php} (94%) rename vendor/monext/payline-sdk/src/Payline/{BillingRecordForUpdate.class.php => BillingRecordForUpdate.php} (94%) rename vendor/monext/payline-sdk/src/Payline/{Buyer.class.php => Buyer.php} (93%) rename vendor/monext/payline-sdk/src/Payline/{Card.class.php => Card.php} (85%) rename vendor/monext/payline-sdk/src/Payline/{Cheque.class.php => Cheque.php} (95%) rename vendor/monext/payline-sdk/src/Payline/{Creditor.class.php => Creditor.php} (94%) rename vendor/monext/payline-sdk/src/Payline/{Order.class.php => Order.php} (93%) rename vendor/monext/payline-sdk/src/Payline/{OrderDetail.class.php => OrderDetail.php} (93%) rename vendor/monext/payline-sdk/src/Payline/{Owner.class.php => Owner.php} (94%) rename vendor/monext/payline-sdk/src/Payline/{Payment.class.php => Payment.php} (94%) create mode 100644 vendor/monext/payline-sdk/src/Payline/PaymentData.php rename vendor/monext/payline-sdk/src/Payline/{PrivateData.class.php => PrivateData.php} (94%) rename vendor/monext/payline-sdk/src/Payline/{Recurring.class.php => Recurring.php} (94%) rename vendor/monext/payline-sdk/src/Payline/{Wallet.class.php => Wallet.php} (93%) rename vendor/monext/payline-sdk/src/Payline/{v4.49.wsdl => v4.52.wsdl} (93%) diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..6be24ba --- /dev/null +++ b/composer.json @@ -0,0 +1,6 @@ +{ + "require": { + "monext/payline-sdk": "^4.52", + "monext/payline-tools-sdk": "^0.9.0" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..aab4a93 --- /dev/null +++ b/composer.lock @@ -0,0 +1,232 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "9a826aaceaad2924e9f6489cc1bf6110", + "packages": [ + { + "name": "monext/payline-sdk", + "version": "4.52.1", + "source": { + "type": "git", + "url": "https://github.com/PaylineByMonext/payline-php-sdk.git", + "reference": "25a04234f2a826c572e104834f6f851606137ff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PaylineByMonext/payline-php-sdk/zipball/25a04234f2a826c572e104834f6f851606137ff9", + "reference": "25a04234f2a826c572e104834f6f851606137ff9", + "shasum": "" + }, + "require": { + "monolog/monolog": "1.*", + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Payline\\": "src/Payline" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Fabien SUAREZ", + "email": "fabien.suarez@payline.com", + "homepage": "http://www.payline.com" + } + ], + "description": "Payline library for PHP", + "keywords": [ + "Monext", + "Payline", + "payment" + ], + "time": "2017-10-24T09:55:59+00:00" + }, + { + "name": "monext/payline-tools-sdk", + "version": "0.9", + "source": { + "type": "git", + "url": "https://github.com/PaylineGitHub/payline-tools-php-sdk.git", + "reference": "7824589fd680e2140d4298b59f521604520de4b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PaylineGitHub/payline-tools-php-sdk/zipball/7824589fd680e2140d4298b59f521604520de4b6", + "reference": "7824589fd680e2140d4298b59f521604520de4b6", + "shasum": "" + }, + "require": { + "monolog/monolog": "1.*", + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Payline\\": "src/PaylineTools" + }, + "psr-0": { + "Payline\\": "src/PaylineTools" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Fabien SUAREZ", + "email": "fabien.suarez@payline.com", + "homepage": "http://www.payline.com" + } + ], + "description": "Payline Tools library for PHP", + "keywords": [ + "Monext", + "Payline", + "tools" + ], + "time": "2016-03-21T14:13:37+00:00" + }, + { + "name": "monolog/monolog", + "version": "1.22.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558", + "reference": "bad29cb8d18ab0315e6c477751418a82c850d558", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "~5.3" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2016-11-26T00:15:39+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/vendor/autoload.php b/vendor/autoload.php index 28b9802..9bafede 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,6 @@ // autoload.php @generated by Composer -require_once __DIR__ . '/composer' . '/autoload_real.php'; +require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit89e7d985dd998990b521c4b61d9167fe::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index ff6ecfb..4626994 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -53,8 +53,9 @@ class ClassLoader private $useIncludePath = false; private $classMap = array(); - private $classMapAuthoritative = false; + private $missingClasses = array(); + private $apcuPrefix; public function getPrefixes() { @@ -271,6 +272,26 @@ public function isClassMapAuthoritative() return $this->classMapAuthoritative; } + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + /** * Registers this instance as an autoloader. * @@ -313,29 +334,34 @@ public function loadClass($class) */ public function findFile($class) { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } - if ($this->classMapAuthoritative) { + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM - if ($file === null && defined('HHVM_VERSION')) { + if (false === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } - if ($file === null) { + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { // Remember that this class does not exist. - return $this->classMap[$class] = false; + $this->missingClasses[$class] = true; } return $file; @@ -399,6 +425,8 @@ private function findFileWithExtension($class, $ext) if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } + + return false; } } diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 7748265..f4768d0 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -6,5 +6,5 @@ $baseDir = dirname($vendorDir); return array( - 'Payline\\' => array($vendorDir . '/monext/payline-sdk/src/Payline', $vendorDir . '/monext/payline-tools-sdk/src/PaylineTools'), + 'Payline\\' => array($vendorDir . '/monext/payline-tools-sdk/src/PaylineTools'), ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 78810ad..8e96ec8 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -7,6 +7,6 @@ return array( 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), - 'Payline\\' => array($vendorDir . '/monext/payline-sdk/src/Payline', $vendorDir . '/monext/payline-tools-sdk/src/PaylineTools'), + 'Payline\\' => array($vendorDir . '/monext/payline-tools-sdk/src/PaylineTools', $vendorDir . '/monext/payline-sdk/src/Payline'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 361e8ff..2d46b1a 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -23,7 +23,7 @@ public static function getLoader() self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInit89e7d985dd998990b521c4b61d9167fe', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 8dd6ca2..c15bb61 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -25,8 +25,8 @@ class ComposerStaticInit89e7d985dd998990b521c4b61d9167fe ), 'Payline\\' => array ( - 0 => __DIR__ . '/..' . '/monext/payline-sdk/src/Payline', - 1 => __DIR__ . '/..' . '/monext/payline-tools-sdk/src/PaylineTools', + 0 => __DIR__ . '/..' . '/monext/payline-tools-sdk/src/PaylineTools', + 1 => __DIR__ . '/..' . '/monext/payline-sdk/src/Payline', ), 'Monolog\\' => array ( @@ -39,8 +39,7 @@ class ComposerStaticInit89e7d985dd998990b521c4b61d9167fe array ( 'Payline\\' => array ( - 0 => __DIR__ . '/..' . '/monext/payline-sdk/src/Payline', - 1 => __DIR__ . '/..' . '/monext/payline-tools-sdk/src/PaylineTools', + 0 => __DIR__ . '/..' . '/monext/payline-tools-sdk/src/PaylineTools', ), ), ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 1cfde5c..8e8b5bf 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -17,7 +17,7 @@ "require": { "php": ">=5.3.0" }, - "time": "2016-10-10 12:19:37", + "time": "2016-10-10T12:19:37+00:00", "type": "library", "extra": { "branch-alias": { @@ -96,7 +96,7 @@ "ruflin/elastica": "Allow sending log messages to an Elastic Search server", "sentry/sentry": "Allow sending log messages to a Sentry server" }, - "time": "2016-11-26 00:15:39", + "time": "2016-11-26T00:15:39+00:00", "type": "library", "extra": { "branch-alias": { @@ -129,33 +129,33 @@ ] }, { - "name": "monext/payline-sdk", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "monext/payline-tools-sdk", + "version": "0.9", + "version_normalized": "0.9.0.0", "source": { "type": "git", - "url": "https://github.com/PaylineByMonext/payline-php-sdk.git", - "reference": "e300e9d7520f81270035126856e7b36ed340f301" + "url": "https://github.com/PaylineGitHub/payline-tools-php-sdk.git", + "reference": "7824589fd680e2140d4298b59f521604520de4b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PaylineByMonext/payline-php-sdk/zipball/e300e9d7520f81270035126856e7b36ed340f301", - "reference": "e300e9d7520f81270035126856e7b36ed340f301", + "url": "https://api.github.com/repos/PaylineGitHub/payline-tools-php-sdk/zipball/7824589fd680e2140d4298b59f521604520de4b6", + "reference": "7824589fd680e2140d4298b59f521604520de4b6", "shasum": "" }, "require": { "monolog/monolog": "1.*", "php": ">=5.3.0" }, - "time": "2017-01-05 15:56:55", + "time": "2016-03-21T14:13:37+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Payline\\": "src/Payline" + "Payline\\": "src/PaylineTools" }, "psr-0": { - "Payline\\": "src/Payline" + "Payline\\": "src/PaylineTools" } }, "notification-url": "https://packagist.org/downloads/", @@ -169,41 +169,38 @@ "homepage": "http://www.payline.com" } ], - "description": "Payline library for PHP", + "description": "Payline Tools library for PHP", "keywords": [ "Monext", "Payline", - "payment" + "tools" ] }, { - "name": "monext/payline-tools-sdk", - "version": "0.9", - "version_normalized": "0.9.0.0", + "name": "monext/payline-sdk", + "version": "4.52.1", + "version_normalized": "4.52.1.0", "source": { "type": "git", - "url": "https://github.com/PaylineGitHub/payline-tools-php-sdk.git", - "reference": "7824589fd680e2140d4298b59f521604520de4b6" + "url": "https://github.com/PaylineByMonext/payline-php-sdk.git", + "reference": "25a04234f2a826c572e104834f6f851606137ff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PaylineGitHub/payline-tools-php-sdk/zipball/7824589fd680e2140d4298b59f521604520de4b6", - "reference": "7824589fd680e2140d4298b59f521604520de4b6", + "url": "https://api.github.com/repos/PaylineByMonext/payline-php-sdk/zipball/25a04234f2a826c572e104834f6f851606137ff9", + "reference": "25a04234f2a826c572e104834f6f851606137ff9", "shasum": "" }, "require": { "monolog/monolog": "1.*", "php": ">=5.3.0" }, - "time": "2016-03-21 14:13:37", + "time": "2017-10-24T09:55:59+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Payline\\": "src/PaylineTools" - }, - "psr-0": { - "Payline\\": "src/PaylineTools" + "Payline\\": "src/Payline" } }, "notification-url": "https://packagist.org/downloads/", @@ -217,11 +214,11 @@ "homepage": "http://www.payline.com" } ], - "description": "Payline Tools library for PHP", + "description": "Payline library for PHP", "keywords": [ "Monext", "Payline", - "tools" + "payment" ] } ] diff --git a/vendor/monext/payline-sdk/CHANGELOG.md b/vendor/monext/payline-sdk/CHANGELOG.md index 5d7d17a..e4d073e 100644 --- a/vendor/monext/payline-sdk/CHANGELOG.md +++ b/vendor/monext/payline-sdk/CHANGELOG.md @@ -1,3 +1,18 @@ +* 4.52 (2017-10-16) + * new avs child node in transaction object + +* 4.51 (2017-08-11) + * no structural changes + +* 4.50.2 (2017-06-30) + * new details child node in doRefundRequest object + +* 4.50.1 (2017-05-09) + * add of certificate-based authentication endpoints + +* 4.50 (2017-04-13) + * new merchantName parameter for doWebPayment, manageWebWallet and verifyEnrollment (name displayed on ACS) + * new attribute paymentData for object Card (used by Apple Pay only) * 4.49 (2017-01-05) * removal of autoload inclusion in main PaylineSDK.php file diff --git a/vendor/monext/payline-sdk/composer.json b/vendor/monext/payline-sdk/composer.json index 1919506..7d83560 100644 --- a/vendor/monext/payline-sdk/composer.json +++ b/vendor/monext/payline-sdk/composer.json @@ -25,9 +25,7 @@ "autoload" : { "psr-4" : { "Payline\\" : "src/Payline" - }, - "psr-0" : { - "Payline\\" : "src/Payline" } + } -} \ No newline at end of file +} diff --git a/vendor/monext/payline-sdk/src/Payline/Address.class.php b/vendor/monext/payline-sdk/src/Payline/Address.php similarity index 93% rename from vendor/monext/payline-sdk/src/Payline/Address.class.php rename to vendor/monext/payline-sdk/src/Payline/Address.php index a178b6f..15eae93 100644 --- a/vendor/monext/payline-sdk/src/Payline/Address.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Address.php @@ -1,40 +1,40 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Address -{ - - public $title; - - public $firstName; - - public $lastName; - - public $name; - - public $street1; - - public $street2; - - public $cityName; - - public $zipCode; - - public $country; - - public $county; - - public $state; - - public $phoneType; - - public $phone; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Address +{ + + public $title; + + public $firstName; + + public $lastName; + + public $name; + + public $street1; + + public $street2; + + public $cityName; + + public $zipCode; + + public $country; + + public $county; + + public $state; + + public $phoneType; + + public $phone; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/AddressOwner.class.php b/vendor/monext/payline-sdk/src/Payline/AddressOwner.php similarity index 94% rename from vendor/monext/payline-sdk/src/Payline/AddressOwner.class.php rename to vendor/monext/payline-sdk/src/Payline/AddressOwner.php index dce5eae..af2251f 100644 --- a/vendor/monext/payline-sdk/src/Payline/AddressOwner.class.php +++ b/vendor/monext/payline-sdk/src/Payline/AddressOwner.php @@ -1,24 +1,24 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class AddressOwner -{ - - public $street; - - public $cityName; - - public $zipCode; - - public $country; - - public $phone; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class AddressOwner +{ + + public $street; + + public $cityName; + + public $zipCode; + + public $country; + + public $phone; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Authentication3DSecure.class.php b/vendor/monext/payline-sdk/src/Payline/Authentication3DSecure.php similarity index 93% rename from vendor/monext/payline-sdk/src/Payline/Authentication3DSecure.class.php rename to vendor/monext/payline-sdk/src/Payline/Authentication3DSecure.php index a8515da..901bbac 100644 --- a/vendor/monext/payline-sdk/src/Payline/Authentication3DSecure.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Authentication3DSecure.php @@ -1,34 +1,34 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Authentication3DSecure -{ - - public $md; - - public $pares; - - public $xid; - - public $eci; - - public $cavv; - - public $cavvAlgorithm; - - public $vadsResult; - - public $typeSecurisation; - - public $PaResStatus; - - public $VeResStatus; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Authentication3DSecure +{ + + public $md; + + public $pares; + + public $xid; + + public $eci; + + public $cavv; + + public $cavvAlgorithm; + + public $vadsResult; + + public $typeSecurisation; + + public $PaResStatus; + + public $VeResStatus; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Authorization.class.php b/vendor/monext/payline-sdk/src/Payline/Authorization.php similarity index 94% rename from vendor/monext/payline-sdk/src/Payline/Authorization.class.php rename to vendor/monext/payline-sdk/src/Payline/Authorization.php index 913bcf7..578cbdc 100644 --- a/vendor/monext/payline-sdk/src/Payline/Authorization.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Authorization.php @@ -1,18 +1,18 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Authorization -{ - - public $number; - - public $date; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Authorization +{ + + public $number; + + public $date; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/BankAccountData.class.php b/vendor/monext/payline-sdk/src/Payline/BankAccountData.php similarity index 94% rename from vendor/monext/payline-sdk/src/Payline/BankAccountData.class.php rename to vendor/monext/payline-sdk/src/Payline/BankAccountData.php index 29abf92..290792f 100644 --- a/vendor/monext/payline-sdk/src/Payline/BankAccountData.class.php +++ b/vendor/monext/payline-sdk/src/Payline/BankAccountData.php @@ -1,22 +1,22 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class BankAccountData -{ - - public $countryCode; - - public $bankCode; - - public $accountNumber; - - public $key; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class BankAccountData +{ + + public $countryCode; + + public $bankCode; + + public $accountNumber; + + public $key; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/BillingRecordForUpdate.class.php b/vendor/monext/payline-sdk/src/Payline/BillingRecordForUpdate.php similarity index 94% rename from vendor/monext/payline-sdk/src/Payline/BillingRecordForUpdate.class.php rename to vendor/monext/payline-sdk/src/Payline/BillingRecordForUpdate.php index 7451a02..7c1597f 100644 --- a/vendor/monext/payline-sdk/src/Payline/BillingRecordForUpdate.class.php +++ b/vendor/monext/payline-sdk/src/Payline/BillingRecordForUpdate.php @@ -1,22 +1,22 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class BillingRecordForUpdate -{ - - public $date; - - public $amount; - - public $status; - - public $executionDate; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class BillingRecordForUpdate +{ + + public $date; + + public $amount; + + public $status; + + public $executionDate; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Buyer.class.php b/vendor/monext/payline-sdk/src/Payline/Buyer.php similarity index 93% rename from vendor/monext/payline-sdk/src/Payline/Buyer.class.php rename to vendor/monext/payline-sdk/src/Payline/Buyer.php index 86d9d55..d7eafb1 100644 --- a/vendor/monext/payline-sdk/src/Payline/Buyer.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Buyer.php @@ -1,70 +1,70 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Buyer -{ - - public $title; - - public $lastName; - - public $firstName; - - public $email; - - public $customerId; - - public $walletId; - - public $walletDisplayed; - - public $walletSecured; - - public $walletCardInd; - - public $shippingAdress; - - public $billingAddress; - - public $accountCreateDate; - - public $accountAverageAmount; - - public $accountOrderCount; - - public $ip; - - public $mobilePhone; - - public $legalStatus; - - public $legalDocument; - - public $birthDate; - - public $fingerprintID; - - public $deviceFingerprint; - - public $isBot; - - public $isIncognito; - - public $isBehindProxy; - - public $isFromTor; - - public $isEmulator; - - public $isRooted; - - public $hasTimezoneMismatch; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Buyer +{ + + public $title; + + public $lastName; + + public $firstName; + + public $email; + + public $customerId; + + public $walletId; + + public $walletDisplayed; + + public $walletSecured; + + public $walletCardInd; + + public $shippingAdress; + + public $billingAddress; + + public $accountCreateDate; + + public $accountAverageAmount; + + public $accountOrderCount; + + public $ip; + + public $mobilePhone; + + public $legalStatus; + + public $legalDocument; + + public $birthDate; + + public $fingerprintID; + + public $deviceFingerprint; + + public $isBot; + + public $isIncognito; + + public $isBehindProxy; + + public $isFromTor; + + public $isEmulator; + + public $isRooted; + + public $hasTimezoneMismatch; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Card.class.php b/vendor/monext/payline-sdk/src/Payline/Card.php similarity index 85% rename from vendor/monext/payline-sdk/src/Payline/Card.class.php rename to vendor/monext/payline-sdk/src/Payline/Card.php index 89f5d27..b1bfa35 100644 --- a/vendor/monext/payline-sdk/src/Payline/Card.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Card.php @@ -1,32 +1,37 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Card -{ - - public $number; - - public $type; - - public $expirationDate; - - public $cvx; - - public $ownerBirthdayDate; - - public $password; - - public $cardPresent; - - public $cardholder; - - public $token; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Card +{ + public $encryptionKeyId; + + public $encryptedData; + + public $number; + + public $type; + + public $expirationDate; + + public $cvx; + + public $ownerBirthdayDate; + + public $password; + + public $cardPresent; + + public $cardholder; + + public $token; + + public $paymentData; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Cheque.class.php b/vendor/monext/payline-sdk/src/Payline/Cheque.php similarity index 95% rename from vendor/monext/payline-sdk/src/Payline/Cheque.class.php rename to vendor/monext/payline-sdk/src/Payline/Cheque.php index a95e7db..61cd72b 100644 --- a/vendor/monext/payline-sdk/src/Payline/Cheque.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Cheque.php @@ -1,16 +1,16 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Cheque -{ - - public $number; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Cheque +{ + + public $number; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Creditor.class.php b/vendor/monext/payline-sdk/src/Payline/Creditor.php similarity index 94% rename from vendor/monext/payline-sdk/src/Payline/Creditor.class.php rename to vendor/monext/payline-sdk/src/Payline/Creditor.php index 64fea85..a02643b 100644 --- a/vendor/monext/payline-sdk/src/Payline/Creditor.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Creditor.php @@ -1,20 +1,20 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Creditor -{ - - public $bic; - - public $iban; - - public $name; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Creditor +{ + + public $bic; + + public $iban; + + public $name; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Order.class.php b/vendor/monext/payline-sdk/src/Payline/Order.php similarity index 93% rename from vendor/monext/payline-sdk/src/Payline/Order.class.php rename to vendor/monext/payline-sdk/src/Payline/Order.php index eb1831a..05c2dc0 100644 --- a/vendor/monext/payline-sdk/src/Payline/Order.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Order.php @@ -1,42 +1,42 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Order -{ - - public $ref; - - public $origin; - - public $country; - - public $taxes; - - public $amount; - - public $currency; - - public $date; - - public $quantity; - - public $comment; - - public $details; - - public $deliveryTime; - - public $deliveryMode; - - public $deliveryExpectedDate; - - public $deliveryExpectedDelay; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Order +{ + + public $ref; + + public $origin; + + public $country; + + public $taxes; + + public $amount; + + public $currency; + + public $date; + + public $quantity; + + public $comment; + + public $details; + + public $deliveryTime; + + public $deliveryMode; + + public $deliveryExpectedDate; + + public $deliveryExpectedDelay; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/OrderDetail.class.php b/vendor/monext/payline-sdk/src/Payline/OrderDetail.php similarity index 93% rename from vendor/monext/payline-sdk/src/Payline/OrderDetail.class.php rename to vendor/monext/payline-sdk/src/Payline/OrderDetail.php index c7f8dac..bfaccf2 100644 --- a/vendor/monext/payline-sdk/src/Payline/OrderDetail.class.php +++ b/vendor/monext/payline-sdk/src/Payline/OrderDetail.php @@ -1,34 +1,34 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class OrderDetail -{ - - public $ref; - - public $price; - - public $quantity; - - public $comment; - - public $category; - - public $subcategory1; - - public $subcategory2; - - public $brand; - - public $additionalData; - - public $taxRate; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class OrderDetail +{ + + public $ref; + + public $price; + + public $quantity; + + public $comment; + + public $category; + + public $subcategory1; + + public $subcategory2; + + public $brand; + + public $additionalData; + + public $taxRate; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Owner.class.php b/vendor/monext/payline-sdk/src/Payline/Owner.php similarity index 94% rename from vendor/monext/payline-sdk/src/Payline/Owner.class.php rename to vendor/monext/payline-sdk/src/Payline/Owner.php index e9ee033..afa9da4 100644 --- a/vendor/monext/payline-sdk/src/Payline/Owner.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Owner.php @@ -1,22 +1,22 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Owner -{ - - public $lastName; - - public $firstName; - - public $billingAddress; - - public $issueCardDate; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Owner +{ + + public $lastName; + + public $firstName; + + public $billingAddress; + + public $issueCardDate; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/PaylineSDK.php b/vendor/monext/payline-sdk/src/Payline/PaylineSDK.php index af6e3c7..0362f52 100644 --- a/vendor/monext/payline-sdk/src/Payline/PaylineSDK.php +++ b/vendor/monext/payline-sdk/src/Payline/PaylineSDK.php @@ -13,26 +13,22 @@ use Monolog\Handler\StreamHandler; use SoapClient; use SoapVar; - -$vendorPath = realpath(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . DIRECTORY_SEPARATOR; -$classesPath = $vendorPath . 'monext' . DIRECTORY_SEPARATOR . 'payline-sdk' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Payline' . DIRECTORY_SEPARATOR; -require_once $classesPath . 'Payment.class.php'; -require_once $classesPath . 'Order.class.php'; -require_once $classesPath . 'OrderDetail.class.php'; -require_once $classesPath . 'Card.class.php'; -require_once $classesPath . 'Buyer.class.php'; -require_once $classesPath . 'Address.class.php'; -require_once $classesPath . 'AddressOwner.class.php'; -require_once $classesPath . 'Owner.class.php'; -require_once $classesPath . 'Authentication3DSecure.class.php'; -require_once $classesPath . 'BankAccountData.class.php'; -require_once $classesPath . 'PrivateData.class.php'; -require_once $classesPath . 'BillingRecordForUpdate.class.php'; -require_once $classesPath . 'Wallet.class.php'; -require_once $classesPath . 'Authorization.class.php'; -require_once $classesPath . 'Creditor.class.php'; -require_once $classesPath . 'Cheque.class.php'; -require_once $classesPath . 'Recurring.class.php'; +use Payline\Payment; +use Payline\Order; +use Payline\OrderDetail; +use Payline\Card; +use Payline\PaymentData; +use Payline\Buyer; +use Payline\Address; +use Payline\AddressOwner; +use Payline\Owner; +use Payline\Authentication3DSecure; +use Payline\BillingRecordForUpdate; +use Payline\Wallet; +use Payline\Authorization; +use Payline\Creditor; +use Payline\Cheque; +use Payline\Recurring; class PaylineSDK { @@ -40,12 +36,12 @@ class PaylineSDK /** * Payline release corresponding to this version of the package */ - const SDK_RELEASE = 'PHP SDK 4.49'; + const SDK_RELEASE = 'PHP SDK 4.52.1'; /** * WSDL file name */ - const WSDL = 'v4.49.wsdl'; + const WSDL = 'v4.52.wsdl'; /** * development environment flag @@ -61,12 +57,22 @@ class PaylineSDK * homologation environment flag */ const ENV_HOMO = "HOMO"; + + /** + * homologation environment flag - uses certificate-based authentication + */ + const ENV_HOMO_CC = "HOMO_CC"; /** * production environment flag */ const ENV_PROD = "PROD"; + /** + * production environment flag - uses certificate-based authentication + */ + const ENV_PROD_CC = "PROD_CC"; + /** * name of Payline DirectPaymentAPI */ @@ -111,6 +117,11 @@ class PaylineSDK * SOAP name of payment object */ const SOAP_PAYMENT = 'payment'; + + /** + * SOAP name of paymentData object + */ + const SOAP_PAYMENT_DATA = 'paymentData'; /** * SOAP name of privateData object @@ -178,14 +189,24 @@ class PaylineSDK const INT_ENDPOINT = 'https://ws.int.payline.com/V4/services/'; /** - * web services endpoint in homologation environment + * standard web services endpoint in homologation environment */ const HOMO_ENDPOINT = 'https://homologation.payline.com/V4/services/'; /** - * web services endpoint in production environment + * certificate-based authentication web services endpoint in homologation environment + */ + const HOMO_CC_ENDPOINT = 'https://homologation-cc.payline.com/V4/services/'; + + /** + * standard web services endpoint in production environment */ const PROD_ENDPOINT = 'https://services.payline.com/V4/services/'; + + /** + * certificate-based authentication web services endpoint in production environment + */ + const PROD_CC_ENDPOINT = 'https://services-cc.payline.com/V4/services/'; /** * URL of getToken servlet, used by AJAX API, in development environment @@ -248,9 +269,10 @@ class PaylineSDK const PROD_CA = 'https://admin.payline.com'; /** - * error code returned when Payline can't be reached + * error code/shortMessage returned when Payline can't be reached */ const ERR_CODE = 'XXXXX'; + const ERR_SHORT_MESSAGE = 'ERROR'; /** * Monolog\Logger instance @@ -318,20 +340,24 @@ class PaylineSDK * @param Monolog\Logger $externalLogger * Monolog\Logger instance, used by PaylineSDK but external to it */ - function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $environment, $pathLog = null, $logLevel = Logger::INFO, $externalLogger = null, $defaultTimezone = "Europe/Paris") + public function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $environment, $pathLog = null, $logLevel = Logger::INFO, $externalLogger = null, $defaultTimezone = "Europe/Paris") { + if (is_int($merchant_id)) { + $merchant_id = (string) $merchant_id; + } + date_default_timezone_set($defaultTimezone); - if($externalLogger){ + if ($externalLogger) { $this->logger = $externalLogger; - }else{ + } else { $this->logger = new Logger('PaylineSDK'); - } + } if (is_null($pathLog)) { $this->logger->pushHandler(new StreamHandler(realpath(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR . date('Y-m-d') . '.log', $logLevel)); // set default log folder } elseif (strlen($pathLog) > 0) { $this->logger->pushHandler(new StreamHandler($pathLog . date('Y-m-d') . '.log', $logLevel)); // set custom log folder } - + $this->logger->addInfo('__construct', array( 'merchant_id' => $this->hideChars($merchant_id, 6, 1), 'access_key' => $this->hideChars($access_key, 1, 3), @@ -353,16 +379,20 @@ function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy $plnInternal = false; if (strcmp($environment, PaylineSDK::ENV_HOMO) == 0) { $this->webServicesEndpoint = PaylineSDK::HOMO_ENDPOINT; + } elseif (strcmp($environment, PaylineSDK::ENV_HOMO_CC) == 0) { + $this->webServicesEndpoint = PaylineSDK::HOMO_CC_ENDPOINT; } elseif (strcmp($environment, PaylineSDK::ENV_PROD) == 0) { - $this->webServicesEndpoint = PaylineSDK::PROD_ENDPOINT; + $this->webServicesEndpoint = PaylineSDK::PROD_ENDPOINT; + } elseif (strcmp($environment, PaylineSDK::ENV_PROD_CC) == 0) { + $this->webServicesEndpoint = PaylineSDK::PROD_CC_ENDPOINT; } elseif (strcmp($environment, PaylineSDK::ENV_DEV) == 0) { $this->webServicesEndpoint = PaylineSDK::DEV_ENDPOINT; $plnInternal = true; } elseif (strcmp($environment, PaylineSDK::ENV_INT) == 0) { $this->webServicesEndpoint = PaylineSDK::INT_ENDPOINT; $plnInternal = true; - }else{ - $this->webServicesEndpoint = false; + } else { + $this->webServicesEndpoint = false; // Exception is raised in PaylineSDK::webServiceRequest } $this->soapclient_options['style'] = defined('SOAP_DOCUMENT') ? SOAP_DOCUMENT : 2; $this->soapclient_options['use'] = defined('SOAP_LITERAL') ? SOAP_LITERAL : 2; @@ -390,10 +420,10 @@ function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy * the array keys are listed in Payment class * @return SoapVar representation of Payment instance */ - protected function payment($array) + protected function payment(array $array) { $payment = new Payment(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { if (array_key_exists($k, $payment) && (strlen($v))) { $payment->$k = $v; @@ -402,6 +432,26 @@ protected function payment($array) } return new \SoapVar($payment, SOAP_ENC_OBJECT, PaylineSDK::SOAP_PAYMENT, PaylineSDK::PAYLINE_NAMESPACE); } + + /** + * build PaymentData instance from $array and make SoapVar object for payment + * + * @param array $array + * the array keys are listed in PaymentData class + * @return SoapVar representation of PaymentData instance + */ + protected function paymentData(array $array) + { + $paymentData = new PaymentData(); + if ($array) { + foreach ($array as $k => $v) { + if (array_key_exists($k, $paymentData) && (strlen($v))) { + $paymentData->$k = $v; + } + } + } + return new \SoapVar($paymentData, SOAP_ENC_OBJECT, PaylineSDK::SOAP_PAYMENT_DATA, PaylineSDK::PAYLINE_NAMESPACE); + } /** * build Order instance from $array and make SoapVar object for order @@ -410,10 +460,10 @@ protected function payment($array) * the array keys are listed in Order CLASS. * @return SoapVar representation of Order instance */ - protected function order($array) + protected function order(array $array) { $order = new Order(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { if (array_key_exists($k, $order) && (strlen($v))) { $order->$k = $v; @@ -432,16 +482,20 @@ protected function order($array) * the array keys are listed in Card CLASS. * @return SoapVar representation of Card instance */ - protected function card($array) + protected function card(array $array) { $card = new Card(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { if (array_key_exists($k, $card) && (strlen($v))) { $card->$k = $v; } } } + $card->paymentData = null; + if (isset($array['paymentData'])) { + $card->paymentData = $this->paymentData($array['paymentData']); + } return new \SoapVar($card, SOAP_ENC_OBJECT, PaylineSDK::SOAP_CARD, PaylineSDK::PAYLINE_NAMESPACE); } @@ -456,13 +510,14 @@ protected function card($array) * the array keys are listed in Address CLASS. * @return SoapVar representation of Buyer instance */ - protected function buyer($array, $shippingAdress, $billingAddress) + protected function buyer(array $array,array $shippingAdress,array $billingAddress) { $buyer = new Buyer(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { - if (array_key_exists($k, $buyer) && (strlen($v))) + if (array_key_exists($k, $buyer) && (strlen($v))) { $buyer->$k = $v; + } } } $buyer->shippingAdress = $this->address($shippingAdress); @@ -473,17 +528,18 @@ protected function buyer($array, $shippingAdress, $billingAddress) /** * build Address instance from $array and make SoapVar object for address. * - * @param array $address + * @param array $array * the array keys are listed in Address CLASS. * @return SoapVar representation of Address instance */ - protected function address($array) + protected function address(array $array) { $address = new Address(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { - if (array_key_exists($k, $address) && (strlen($v))) + if (array_key_exists($k, $address) && (strlen($v))) { $address->$k = $v; + } } } return new \SoapVar($address, SOAP_ENC_OBJECT, PaylineSDK::SOAP_ADDRESS, PaylineSDK::PAYLINE_NAMESPACE); @@ -496,13 +552,14 @@ protected function address($array) * the array keys are listed in AddressOwner CLASS. * @return SoapVar representation of AddressOwner instance */ - protected function addressOwner($array) + protected function addressOwner(array $array) { $addressOwner = new AddressOwner(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { - if (array_key_exists($k, $addressOwner) && (strlen($v))) + if (array_key_exists($k, $addressOwner) && (strlen($v))) { $addressOwner->$k = $v; + } } } return new \SoapVar($addressOwner, SOAP_ENC_OBJECT, PaylineSDK::SOAP_ADDRESS_OWNER, PaylineSDK::PAYLINE_NAMESPACE); @@ -518,14 +575,15 @@ protected function addressOwner($array) * @return SoapVar representation of Owner instance * */ - protected function owner($array, $addressOwner) + protected function owner(array $array, array $addressOwner) { - if ($array != null) { + if ($array !== null) { $owner = new Owner(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { - if (array_key_exists($k, $owner) && (strlen($v))) + if (array_key_exists($k, $owner) && (strlen($v))) { $owner->$k = $v; + } } } $owner->billingAddress = $this->addressOwner($addressOwner); @@ -542,10 +600,10 @@ protected function owner($array, $addressOwner) * the array keys are listed in Authentication3DSecure CLASS. * @return SoapVar representation of Authentication3DSecure instance */ - protected function authentication3DSecure($array) + protected function authentication3DSecure(array $array) { $authentication3DSecure = new Authentication3DSecure(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { if (array_key_exists($k, $authentication3DSecure) && (strlen($v))) { $authentication3DSecure->$k = $v; @@ -562,10 +620,10 @@ protected function authentication3DSecure($array) * the array keys are listed in BankAccountData CLASS. * @return SoapVar representation of BankAccountData instance */ - protected function bankAccountData($array) + protected function bankAccountData(array $array) { $bankAccountData = new BankAccountData($array); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { if (array_key_exists($k, $bankAccountData) && (strlen($v))) { $bankAccountData->$k = $v; @@ -582,13 +640,14 @@ protected function bankAccountData($array) * the array keys are listed in BillingRecordForUpdate CLASS. * @return SoapVar representation of BillingRecordForUpdate instance */ - protected function billingRecordForUpdate($array) + protected function billingRecordForUpdate(array $array) { $billingRecordForUpdate = new BillingRecordForUpdate(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { - if (array_key_exists($k, $billingRecordForUpdate) && (strlen($v))) + if (array_key_exists($k, $billingRecordForUpdate) && (strlen($v))) { $billingRecordForUpdate->$k = $v; + } } } return new \SoapVar($billingRecordForUpdate, SOAP_ENC_OBJECT, PaylineSDK::SOAP_BILLING_RECORD_FOR_UPDATE, PaylineSDK::PAYLINE_NAMESPACE); @@ -605,13 +664,14 @@ protected function billingRecordForUpdate($array) * the array keys are listed in Card CLASS. * @return SoapVar representation of Wallet instance */ - protected function wallet($inWallet, $address, $card) + protected function wallet(array $inWallet, array $address, array $card) { $wallet = new Wallet(); - if ($inWallet && is_array($inWallet)) { + if ($inWallet) { foreach ($inWallet as $k => $v) { - if (array_key_exists($k, $wallet) && (strlen($v))) + if (array_key_exists($k, $wallet) && (strlen($v))) { $wallet->$k = $v; + } } } @@ -629,10 +689,10 @@ protected function wallet($inWallet, $address, $card) * @return SoapVar representation of Authorization instance * */ - protected function authorization($array) + protected function authorization(array $array) { $authorization = new Authorization($array); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { if (array_key_exists($k, $authorization) && (strlen($v))) { $authorization->$k = $v; @@ -649,13 +709,14 @@ protected function authorization($array) * the array keys are listed in Creditor CLASS. * @return SoapVar representation of Creditor instance */ - protected function creditor($array) + protected function creditor(array $array) { $creditor = new Creditor(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { - if (array_key_exists($k, $creditor) && (strlen($v))) + if (array_key_exists($k, $creditor) && (strlen($v))) { $creditor->$k = $v; + } } } return new \SoapVar($creditor, SOAP_ENC_OBJECT, PaylineSDK::SOAP_CREDITOR, PaylineSDK::PAYLINE_NAMESPACE); @@ -668,10 +729,10 @@ protected function creditor($array) * the array keys are listed in Cheque CLASS. * @return SoapVar representation of Cheque instance */ - protected function cheque($array) + protected function cheque(array $array) { $cheque = new Cheque($array); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { if (array_key_exists($k, $cheque) && (strlen($v))) { $cheque->$k = $v; @@ -688,10 +749,10 @@ protected function cheque($array) * the array keys are listed in Recurring CLASS. * @return SoapVar representation of Recurring instance */ - protected function recurring($array) + protected function recurring(array $array) { $recurring = new Recurring(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { if (array_key_exists($k, $recurring) && (strlen($v))) { $recurring->$k = $v; @@ -711,7 +772,7 @@ protected function recurring($array) * @param int $n2 * number of characters shown at end begining of the string */ - private function hideChars($inString, $n1, $n2) + protected function hideChars($inString, $n1, $n2) { $inStringLength = strlen($inString); if ($inStringLength < ($n1 + $n2)) { @@ -729,7 +790,7 @@ private function hideChars($inString, $n1, $n2) * @param String $parentName name of its parent * @return boolean whether $nodeName is child from a list or not */ - private function isChildFromList($nodeName,$parentName){ + protected function isChildFromList($nodeName,$parentName){ if(array_key_exists($nodeName, $this->parentNode)){ if(strcmp($this->parentNode[$nodeName],$parentName) == 0){ return true; @@ -747,22 +808,22 @@ private function isChildFromList($nodeName,$parentName){ * name of the node's parent * @return array representation of the object */ - private function responseToArray($node,$parent=null) + protected function responseToArray($node, $parent = null) { $array = array(); foreach ($node as $k => $v) { if ($this->isChildFromList($k, $parent)) { // current value is a list - if(count($v) == 1 && $k != '0'){ // a list with 1 element. It's returned with a 0-index - $array[$k][0] = PaylineSDK::responseToArray($v,$k); - }elseif(is_object($v) || is_array($v)){ // a list with more than 1 element - $array[$k] = PaylineSDK::responseToArray($v,$k); - }else{ + if (count($v) == 1 && $k != '0') { // a list with 1 element. It's returned with a 0-index + $array[$k][0] = PaylineSDK::responseToArray($v, $k); + } elseif (is_object($v) || is_array($v)) { // a list with more than 1 element + $array[$k] = PaylineSDK::responseToArray($v, $k); + } else { $array[$k] = $v; } } else { - if(is_object($v) || is_array($v)){ - $array[$k] = PaylineSDK::responseToArray($v,$k); - }else{ + if (is_object($v) || is_array($v)) { + $array[$k] = PaylineSDK::responseToArray($v, $k); + } else { $array[$k] = $v; } } @@ -771,61 +832,81 @@ private function responseToArray($node,$parent=null) } /** - * Adds indexes with null values to the web services request array, in order to prevent SOAP format exception + * Adds indexes with empty values to the web services request array, in order to prevent SOAP format exception * * @param array $array * associative array containing web services parameters */ private static function formatRequest(&$array) { - if (! isset($array['buyer'])) - $array['buyer'] = null; - if (! isset($array['ownerAddress'])) - $array['ownerAddress'] = null; - if (! isset($array['3DSecure'])) - $array['3DSecure'] = null; - if (! isset($array['bankAccountData'])) - $array['bankAccountData'] = null; - if (! isset($array['cancelURL']) || ! strlen($array['cancelURL'])) + if (!isset($array['buyer'])) { + $array['buyer'] = array(); + } + if (!isset($array['3DSecure'])) { + $array['3DSecure'] = array(); + } + if (!isset($array['bankAccountData'])) { + $array['bankAccountData'] = array(); + } + if (!isset($array['cancelURL']) || !strlen($array['cancelURL'])) { $array['cancelURL'] = null; - if (! isset($array['notificationURL']) || ! strlen($array['notificationURL'])) + } + if (!isset($array['notificationURL']) || !strlen($array['notificationURL'])) { $array['notificationURL'] = null; - if (! isset($array['returnURL']) || ! strlen($array['returnURL'])) + } + if (!isset($array['returnURL']) || !strlen($array['returnURL'])) { $array['returnURL'] = null; - if (! isset($array['languageCode']) || ! strlen($array['languageCode'])) + } + if (!isset($array['languageCode']) || !strlen($array['languageCode'])) { $array['languageCode'] = null; - if (! isset($array['securityMode']) || ! strlen($array['securityMode'])) + } + if (!isset($array['securityMode']) || !strlen($array['securityMode'])) { $array['securityMode'] = null; - if (! isset($array['buyer'])) - $array['buyer'] = null; - if (! isset($array['billingAddress'])) - $array['billingAddress'] = null; - if (! isset($array['shippingAddress'])) - $array['shippingAddress'] = null; - if (! isset($array['owner'])) - $array['owner'] = null; - if (! isset($array['ownerAddress'])) - $array['ownerAddress'] = null; - if (! isset($array['contracts']) || ! strlen($array['contracts'][0]) || ! is_array($array['contracts'])) + } + if (!isset($array['billingAddress'])) { + $array['billingAddress'] = array(); + } + if (!isset($array['shippingAddress'])) { + $array['shippingAddress'] = array(); + } + if (!isset($array['owner'])) { + $array['owner'] = array(); + } + if (!isset($array['ownerAddress'])) { + $array['ownerAddress'] = array(); + } + if (!isset($array['contracts']) || !strlen($array['contracts'][0]) || !is_array($array['contracts'])) { $array['contracts'] = null; - if (! isset($array['secondContracts']) || ! strlen($array['secondContracts'][0]) || ! is_array($array['secondContracts'])) + } + if (!isset($array['secondContracts']) || !strlen($array['secondContracts'][0]) || !is_array($array['secondContracts'])) { $array['secondContracts'] = null; - if (! isset($array['walletContracts']) || ! strlen($array['walletContracts'][0]) || ! is_array($array['walletContracts'])) + } + if (!isset($array['walletContracts']) || !strlen($array['walletContracts'][0]) || !is_array($array['walletContracts'])) { $array['walletContracts'] = null; - if (! isset($array['customPaymentPageCode']) || ! strlen($array['customPaymentPageCode'])) + } + if (!isset($array['customPaymentPageCode']) || !strlen($array['customPaymentPageCode'])) { $array['customPaymentPageCode'] = null; - if (! isset($array['customPaymentTemplateURL']) || ! strlen($array['customPaymentTemplateURL'])) + } + if (!isset($array['customPaymentTemplateURL']) || !strlen($array['customPaymentTemplateURL'])) { $array['customPaymentTemplateURL'] = null; - if (! isset($array['recurring'])) - $array['recurring'] = null; - if (! isset($array['orderRef']) || ! strlen($array['orderRef'])) + } + if (!isset($array['recurring'])) { + $array['recurring'] = array(); + } + if (!isset($array['orderRef']) || !strlen($array['orderRef'])) { $array['orderRef'] = null; - if (! isset($array['orderDate']) || ! strlen($array['orderDate'])) + } + if (!isset($array['orderDate']) || !strlen($array['orderDate'])) { $array['orderDate'] = null; - if (! isset($array['walletIds']) || ! strlen($array['walletIds'][0] || ! is_array($array['walletIds']))) + } + if (!isset($array['walletIds']) || !strlen($array['walletIds'][0] || !is_array($array['walletIds']))) { $array['walletIds'] = null; + } + if (!isset($array['merchantName'])) { + $array['merchantName'] = null; + } } - + /** * Create the SoapClient instance and make the web service call * @@ -838,7 +919,7 @@ private static function formatRequest(&$array) * @param string $Method * the name of the web service */ - private function webServiceRequest($array, $WSRequest, $PaylineAPI, $Method) + protected function webServiceRequest(array $array, array $WSRequest, $PaylineAPI, $Method) { $logRequest = array(); $logResponse = array( @@ -1168,15 +1249,15 @@ private function webServiceRequest($array, $WSRequest, $PaylineAPI, $Method) } catch (\Exception $e) { $this->logger->addInfo($Method . 'Request', $logRequest); $this->logger->addError('Exception occured at ' . $Method . ' call', array( - 'code' => $e->getCode(), - 'message' => $e->getMessage(), + 'code' => $e->getCode(), + 'message' => $e->getMessage(), 'endpoint' => $this->webServicesEndpoint . $PaylineAPI - )); - $ERROR = array(); - $ERROR['result']['code'] = PaylineSDK::ERR_CODE; - $ERROR['result']['longMessage'] = $e->getMessage(); - $ERROR['result']['shortMessage'] = $e->getMessage(); - $ERROR['result']['partnerCode'] = null; + )); + $ERROR = array(); + $ERROR['result']['code'] = PaylineSDK::ERR_CODE; + $ERROR['result']['longMessage'] = $e->getMessage(); + $ERROR['result']['shortMessage'] = PaylineSDK::ERR_SHORT_MESSAGE; + $ERROR['result']['partnerCode'] = null; $ERROR['result']['partnerCodeLabel'] = null; return $ERROR; } @@ -1209,13 +1290,14 @@ public function getLogger() * @param array $newOrderDetail * associative array containing details about an order item */ - public function addOrderDetail($newOrderDetail) + public function addOrderDetail(array $newOrderDetail) { $orderDetail = new OrderDetail(); - if ($newOrderDetail && is_array($newOrderDetail)) { + if ($newOrderDetail) { foreach ($newOrderDetail as $k => $v) { - if (array_key_exists($k, $orderDetail) && (strlen($v))) + if (array_key_exists($k, $orderDetail) && (strlen($v))) { $orderDetail->$k = $v; + } } } $this->orderDetails[] = new \SoapVar($orderDetail, SOAP_ENC_OBJECT, PaylineSDK::SOAP_ORDERDETAIL, PaylineSDK::PAYLINE_NAMESPACE); @@ -1228,13 +1310,14 @@ public function addOrderDetail($newOrderDetail) * an array containing two indexes : key and value * */ - public function addPrivateData($array) + public function addPrivateData(array $array) { $private = new PrivateData(); - if ($array && is_array($array)) { + if ($array) { foreach ($array as $k => $v) { - if (array_key_exists($k, $private) && (strlen($v))) + if (array_key_exists($k, $private) && (strlen($v))) { $private->$k = $v; + } } } $this->privateData[] = new \SoapVar($private, SOAP_ENC_OBJECT, PaylineSDK::SOAP_PRIVATE_DATA, PaylineSDK::PAYLINE_NAMESPACE); @@ -1254,18 +1337,18 @@ public function addPrivateData($array) * @param array $array * associative array containing doAuthorization parameters */ - public function doAuthorization($array) + public function doAuthorization(array $array) { $this->formatRequest($array); $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'card' => $this->card($array['card']), - 'order' => $this->order($array['order']), - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), - 'owner' => $this->owner($array['owner'], $array['ownerAddress']), - 'privateDataList' => $this->privateData, + 'payment' => $this->payment($array['payment']), + 'card' => $this->card($array['card']), + 'order' => $this->order($array['order']), + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'owner' => $this->owner($array['owner'], $array['ownerAddress']), + 'privateDataList' => $this->privateData, 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']), - 'bankAccountData' => $this->bankAccountData($array['bankAccountData']) + 'bankAccountData' => $this->bankAccountData($array['bankAccountData']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doAuthorization'); } @@ -1276,13 +1359,13 @@ public function doAuthorization($array) * @param array $array * associative array containing doCapture parameters */ - public function doCapture($array) + public function doCapture(array $array) { $WSRequest = array( - 'transactionID' => $array['transactionID'], - 'payment' => $this->payment($array['payment']), + 'transactionID' => $array['transactionID'], + 'payment' => $this->payment($array['payment']), 'privateDataList' => $this->privateData, - 'sequenceNumber' => $array['sequenceNumber'] + 'sequenceNumber' => $array['sequenceNumber'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doCapture'); } @@ -1293,12 +1376,12 @@ public function doCapture($array) * @param array $array * associative array containing doReAuthorization parameters */ - public function doReAuthorization($array) + public function doReAuthorization(array $array) { $WSRequest = array( - 'transactionID' => $array['transactionID'], - 'payment' => $this->payment($array['payment']), - 'order' => $this->order($array['order']), + 'transactionID' => $array['transactionID'], + 'payment' => $this->payment($array['payment']), + 'order' => $this->order($array['order']), 'privateDataList' => $this->privateData ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doReAuthorization'); @@ -1310,17 +1393,17 @@ public function doReAuthorization($array) * @param array $array * associative array containing doDebit parameters */ - public function doDebit($array) + public function doDebit(array $array) { $this->formatRequest($array); $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'card' => $this->card($array['card']), - 'order' => $this->order($array['order']), - 'privateDataList' => $this->privateData, - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'payment' => $this->payment($array['payment']), + 'card' => $this->card($array['card']), + 'order' => $this->order($array['order']), + 'privateDataList' => $this->privateData, + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']), - 'authorization' => $this->authorization($array['authorization']) + 'authorization' => $this->authorization($array['authorization']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doDebit'); } @@ -1334,11 +1417,12 @@ public function doDebit($array) public function doRefund($array) { $WSRequest = array( - 'transactionID' => $array['transactionID'], - 'payment' => $this->payment($array['payment']), - 'comment' => $array['comment'], + 'transactionID' => $array['transactionID'], + 'payment' => $this->payment($array['payment']), + 'comment' => $array['comment'], 'privateDataList' => $this->privateData, - 'sequenceNumber' => $array['sequenceNumber'] + 'details' => $this->orderDetails, + 'sequenceNumber' => $array['sequenceNumber'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doRefund'); } @@ -1349,11 +1433,11 @@ public function doRefund($array) * @param array $array * associative array containing doReset parameters */ - public function doReset($array) + public function doReset(array $array) { $WSRequest = array( 'transactionID' => $array['transactionID'], - 'comment' => $array['comment'] + 'comment' => $array['comment'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doReset'); } @@ -1364,16 +1448,16 @@ public function doReset($array) * @param array $array * associative array containing doCredit parameters */ - public function doCredit($array) + public function doCredit(array $array) { $this->formatRequest($array); $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'card' => $this->card($array['card']), - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'payment' => $this->payment($array['payment']), + 'card' => $this->card($array['card']), + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), 'privateDataList' => $this->privateData, - 'order' => $this->order($array['order']), - 'comment' => $array['comment'] + 'order' => $this->order($array['order']), + 'comment' => $array['comment'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doCredit'); } @@ -1384,16 +1468,16 @@ public function doCredit($array) * @param array $array * associative array containing createWallet parameters */ - public function createWallet($array) + public function createWallet(array $array) { $this->formatRequest($array); $WSRequest = array( - 'contractNumber' => $array['contractNumber'], - 'wallet' => $this->wallet($array['wallet'], $array['address'], $array['card']), - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), - 'owner' => $this->owner($array['owner'], $array['ownerAddress']), - 'privateDataList' => $this->privateData, - 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']), + 'contractNumber' => $array['contractNumber'], + 'wallet' => $this->wallet($array['wallet'], $array['address'], $array['card']), + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'owner' => $this->owner($array['owner'], $array['ownerAddress']), + 'privateDataList' => $this->privateData, + 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']), 'contractNumberWalletList' => $array['walletContracts'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'createWallet'); @@ -1405,16 +1489,16 @@ public function createWallet($array) * @param array $array * associative array containing updateWallet parameters */ - public function updateWallet($array) + public function updateWallet(array $array) { $WSRequest = array( - 'contractNumber' => $array['contractNumber'], - 'cardInd' => $array['cardInd'], - 'wallet' => $this->wallet($array['wallet'], $array['address'], $array['card']), - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), - 'owner' => $this->owner($array['owner'], $array['ownerAddress']), - 'privateDataList' => $this->privateData, - 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']), + 'contractNumber' => $array['contractNumber'], + 'cardInd' => $array['cardInd'], + 'wallet' => $this->wallet($array['wallet'], $array['address'], $array['card']), + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'owner' => $this->owner($array['owner'], $array['ownerAddress']), + 'privateDataList' => $this->privateData, + 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']), 'contractNumberWalletList' => $array['walletContracts'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'updateWallet'); @@ -1426,12 +1510,12 @@ public function updateWallet($array) * @param array $array * associative array containing getWallet parameters */ - public function getWallet($array) + public function getWallet(array $array) { $WSRequest = array( 'contractNumber' => $array['contractNumber'], - 'walletId' => $array['walletId'], - 'cardInd' => $array['cardInd'] + 'walletId' => $array['walletId'], + 'cardInd' => $array['cardInd'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'getWallet'); } @@ -1442,12 +1526,12 @@ public function getWallet($array) * @param array $array * associative array containing getCards parameters */ - public function getCards($array) + public function getCards(array $array) { $WSRequest = array( 'contractNumber' => $array['contractNumber'], - 'walletId' => $array['walletId'], - 'cardInd' => $array['cardInd'] + 'walletId' => $array['walletId'], + 'cardInd' => $array['cardInd'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'getCards'); } @@ -1458,12 +1542,12 @@ public function getCards($array) * @param array $array * associative array containing disableWallet parameters */ - public function disableWallet($array) + public function disableWallet(array $array) { $WSRequest = array( 'contractNumber' => $array['contractNumber'], - 'walletIdList' => $array['walletIds'], - 'cardInd' => $array['cardInd'] + 'walletIdList' => $array['walletIds'], + 'cardInd' => $array['cardInd'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'disableWallet'); } @@ -1474,12 +1558,12 @@ public function disableWallet($array) * @param array $array * associative array containing enableWallet parameters */ - public function enableWallet($array) + public function enableWallet(array $array) { $WSRequest = array( 'contractNumber' => $array['contractNumber'], - 'walletId' => $array['walletId'], - 'cardInd' => $array['cardInd'] + 'walletId' => $array['walletId'], + 'cardInd' => $array['cardInd'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'enableWallet'); } @@ -1490,17 +1574,17 @@ public function enableWallet($array) * @param array $array * associative array containing doImmediateWalletPayment parameters */ - public function doImmediateWalletPayment($array) + public function doImmediateWalletPayment(array $array) { $this->formatRequest($array); $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'order' => $this->order($array['order']), - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), - 'walletId' => $array['walletId'], - 'cardInd' => $array['cardInd'], - 'cvx' => $array['walletCvx'], - 'privateDataList' => $this->privateData, + 'payment' => $this->payment($array['payment']), + 'order' => $this->order($array['order']), + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'walletId' => $array['walletId'], + 'cardInd' => $array['cardInd'], + 'cvx' => $array['walletCvx'], + 'privateDataList' => $this->privateData, 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doImmediateWalletPayment'); @@ -1512,17 +1596,17 @@ public function doImmediateWalletPayment($array) * @param array $array * associative array containing doScheduledWalletPayment parameters */ - public function doScheduledWalletPayment($array) + public function doScheduledWalletPayment(array $array) { $this->formatRequest($array); $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'orderRef' => $array['orderRef'], - 'orderDate' => $array['orderDate'], - 'scheduledDate' => $array['scheduledDate'], - 'walletId' => $array['walletId'], - 'cardInd' => $array['cardInd'], - 'order' => $this->order($array['order']), + 'payment' => $this->payment($array['payment']), + 'orderRef' => $array['orderRef'], + 'orderDate' => $array['orderDate'], + 'scheduledDate' => $array['scheduledDate'], + 'walletId' => $array['walletId'], + 'cardInd' => $array['cardInd'], + 'order' => $this->order($array['order']), 'privateDataList' => $this->privateData ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doScheduledWalletPayment'); @@ -1534,19 +1618,19 @@ public function doScheduledWalletPayment($array) * @param array $array * associative array containing doRecurrentWalletPayment parameters */ - public function doRecurrentWalletPayment($array) + public function doRecurrentWalletPayment(array $array) { $this->formatRequest($array); $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'orderRef' => $array['orderRef'], - 'orderDate' => $array['orderDate'], - 'scheduledDate' => $array['scheduledDate'], - 'walletId' => $array['walletId'], - 'cardInd' => $array['cardInd'], - 'recurring' => $this->recurring($array['recurring']), + 'payment' => $this->payment($array['payment']), + 'orderRef' => $array['orderRef'], + 'orderDate' => $array['orderDate'], + 'scheduledDate' => $array['scheduledDate'], + 'walletId' => $array['walletId'], + 'cardInd' => $array['cardInd'], + 'recurring' => $this->recurring($array['recurring']), 'privateDataList' => $this->privateData, - 'order' => $this->order($array['order']) + 'order' => $this->order($array['order']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doRecurrentWalletPayment'); } @@ -1557,10 +1641,10 @@ public function doRecurrentWalletPayment($array) * @param array $array * associative array containing getPaymentRecord parameters */ - public function getPaymentRecord($array) + public function getPaymentRecord(array $array) { $WSRequest = array( - 'contractNumber' => $array['contractNumber'], + 'contractNumber' => $array['contractNumber'], 'paymentRecordId' => $array['paymentRecordId'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'getPaymentRecord'); @@ -1572,10 +1656,10 @@ public function getPaymentRecord($array) * @param array $array * associative array containing disablePaymentRecord parameters */ - public function disablePaymentRecord($array) + public function disablePaymentRecord(array $array) { $WSRequest = array( - 'contractNumber' => $array['contractNumber'], + 'contractNumber' => $array['contractNumber'], 'paymentRecordId' => $array['paymentRecordId'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'disablePaymentRecord'); @@ -1587,17 +1671,18 @@ public function disablePaymentRecord($array) * @param array $array * associative array containing verifyEnrollment parameters */ - public function verifyEnrollment($array) + public function verifyEnrollment(array $array) { $this->formatRequest($array); $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'card' => $this->card($array['card']), - 'orderRef' => $array['orderRef'], - 'userAgent' => $array['userAgent'], - 'mdFieldValue' => $array['mdFieldValue'], - 'walletId' => $array['walletId'], - 'walletCardInd' => $array['walletCardInd'] + 'payment' => $this->payment($array['payment']), + 'card' => $this->card($array['card']), + 'orderRef' => $array['orderRef'], + 'userAgent' => $array['userAgent'], + 'mdFieldValue' => $array['mdFieldValue'], + 'walletId' => $array['walletId'], + 'walletCardInd' => $array['walletCardInd'], + 'merchantName' => $array['merchantName'] ); if (isset($array['generateVirtualCvx'])) { $WSRequest['generateVirtualCvx'] = $array['generateVirtualCvx']; @@ -1611,13 +1696,13 @@ public function verifyEnrollment($array) * @param array $array * associative array containing verifyAuthentication parameters */ - public function verifyAuthentication($array) + public function verifyAuthentication(array $array) { $WSRequest = array( 'contractNumber' => $array['contractNumber'], - 'pares' => $array['pares'], - 'md' => $array['md'], - 'card' => $this->card($array['card']) + 'pares' => $array['pares'], + 'md' => $array['md'], + 'card' => $this->card($array['card']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'verifyAuthentication'); } @@ -1628,12 +1713,12 @@ public function verifyAuthentication($array) * @param array $array * associative array containing doScoringCheque parameters */ - public function doScoringCheque($array) + public function doScoringCheque(array $array) { $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'cheque' => $this->cheque($array['cheque']), - 'order' => $this->order($array['order']), + 'payment' => $this->payment($array['payment']), + 'cheque' => $this->cheque($array['cheque']), + 'order' => $this->order($array['order']), 'privateDataList' => $this->privateData ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doScoringCheque'); @@ -1645,7 +1730,7 @@ public function doScoringCheque($array) * @param array $array * associative array containing getEncryptionKey parameters */ - public function getEncryptionKey($array) + public function getEncryptionKey(array $array) { $WSRequest = array(); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'getEncryptionKey'); @@ -1657,7 +1742,7 @@ public function getEncryptionKey($array) * @param array $array * associative array containing getMerchantSettings parameters */ - public function getMerchantSettings($array) + public function getMerchantSettings(array $array) { $WSRequest = array(); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'getMerchantSettings'); @@ -1669,7 +1754,7 @@ public function getMerchantSettings($array) * @param array $array * associative array containing getBalance parameters */ - public function getBalance($array) + public function getBalance(array $array) { $WSRequest = array( 'contractNumber' => $array['contractNumber'], @@ -1684,7 +1769,7 @@ public function getBalance($array) * @param array $array * associative array containing getToken parameters */ - public function getToken($array) + public function getToken(array $array) { $WSRequest = array( 'cardNumber' => $array['cardNumber'], @@ -1700,7 +1785,7 @@ public function getToken($array) * @param array $array * associative array containing getBalance parameters */ - public function unBlock($array) + public function unBlock(array $array) { $WSRequest = array( 'transactionID' => $array['transactionID'], @@ -1715,12 +1800,12 @@ public function unBlock($array) * @param array $array * associative array containing updatePaymentRecord parameters */ - public function updatePaymentRecord($array) + public function updatePaymentRecord(array $array) { $WSRequest = array( - 'contractNumber' => $array['contractNumber'], + 'contractNumber' => $array['contractNumber'], 'paymentRecordId' => $array['paymentRecordId'], - 'recurring' => $this->recurring($array['recurring']) + 'recurring' => $this->recurring($array['recurring']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'updatePaymentRecord'); } @@ -1731,10 +1816,10 @@ public function updatePaymentRecord($array) * @param array $array * associative array containing getBillingRecord parameters */ - public function getBillingRecord($array) + public function getBillingRecord(array $array) { $WSRequest = array( - 'contractNumber' => $array['contractNumber'], + 'contractNumber' => $array['contractNumber'], 'paymentRecordId' => $array['paymentRecordId'], 'billingRecordId' => $array['billingRecordId'] ); @@ -1747,12 +1832,12 @@ public function getBillingRecord($array) * @param array $array * associative array containing updateBillingRecord parameters */ - public function updateBillingRecord($array) + public function updateBillingRecord(array $array) { $WSRequest = array( - 'contractNumber' => $array['contractNumber'], - 'paymentRecordId' => $array['paymentRecordId'], - 'billingRecordId' => $array['billingRecordId'], + 'contractNumber' => $array['contractNumber'], + 'paymentRecordId' => $array['paymentRecordId'], + 'billingRecordId' => $array['billingRecordId'], 'billingRecordForUpdate' => $this->billingRecordForUpdate($array['billingRecordForUpdate']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'updateBillingRecord'); @@ -1764,15 +1849,15 @@ public function updateBillingRecord($array) * @param array $array * associative array containing doBankTransfer parameters */ - public function doBankTransfer($array) + public function doBankTransfer(array $array) { $this->formatRequest($array); $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'creditor' => $this->creditor($array['creditor']), - 'comment' => $array['comment'], + 'payment' => $this->payment($array['payment']), + 'creditor' => $this->creditor($array['creditor']), + 'comment' => $array['comment'], 'transactionID' => $array['transactionID'], - 'orderID' => $array['orderID'] + 'orderID' => $array['orderID'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doBankTransfer'); } @@ -1791,26 +1876,28 @@ public function doBankTransfer($array) * @param array $array * associative array containing doWebPayment parameters */ - public function doWebPayment($array) + public function doWebPayment(array $array) { $this->formatRequest($array); $WSRequest = array( - 'payment' => $this->payment($array['payment']), - 'returnURL' => $array['returnURL'], - 'cancelURL' => $array['cancelURL'], - 'order' => $this->order($array['order']), - 'notificationURL' => $array['notificationURL'], - 'customPaymentTemplateURL' => $array['customPaymentTemplateURL'], - 'selectedContractList' => $array['contracts'], + 'payment' => $this->payment($array['payment']), + 'returnURL' => $array['returnURL'], + 'cancelURL' => $array['cancelURL'], + 'order' => $this->order($array['order']), + 'notificationURL' => $array['notificationURL'], + 'customPaymentTemplateURL' => $array['customPaymentTemplateURL'], + 'selectedContractList' => $array['contracts'], 'secondSelectedContractList' => $array['secondContracts'], - 'privateDataList' => $this->privateData, - 'languageCode' => $array['languageCode'], - 'customPaymentPageCode' => $array['customPaymentPageCode'], - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), - 'securityMode' => $array['securityMode'], - 'contractNumberWalletList' => $array['walletContracts'] + 'privateDataList' => $this->privateData, + 'languageCode' => $array['languageCode'], + 'customPaymentPageCode' => $array['customPaymentPageCode'], + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'owner' => $this->owner($array['owner'], $array['ownerAddress']), + 'securityMode' => $array['securityMode'], + 'contractNumberWalletList' => $array['walletContracts'], + 'merchantName' => $array['merchantName'] ); - + if (isset($array['payment']['mode'])) { if (($array['payment']['mode'] == "REC") || ($array['payment']['mode'] == "NX")) { $WSRequest['recurring'] = $this->recurring($array['recurring']); @@ -1825,7 +1912,7 @@ public function doWebPayment($array) * @param array $array * associative array containing getWebPaymentDetails parameters */ - public function getWebPaymentDetails($array) + public function getWebPaymentDetails(array $array) { return $this->webServiceRequest($array, $array, PaylineSDK::WEB_API, 'getWebPaymentDetails'); } @@ -1836,24 +1923,25 @@ public function getWebPaymentDetails($array) * @param array $array * associative array containing manageWebWallet parameters */ - public function manageWebWallet($array) + public function manageWebWallet(array $array) { $this->formatRequest($array); $WSRequest = array( - 'contractNumber' => $array['contractNumber'], - 'selectedContractList' => $array['contracts'], - 'updatePersonalDetails' => $array['updatePersonalDetails'], - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), - 'owner' => $this->owner($array['owner'], $array['ownerAddress']), - 'languageCode' => $array['languageCode'], - 'customPaymentPageCode' => $array['customPaymentPageCode'], - 'securityMode' => $array['securityMode'], - 'returnURL' => $array['returnURL'], - 'cancelURL' => $array['cancelURL'], - 'notificationURL' => $array['notificationURL'], - 'privateDataList' => $this->privateData, + 'contractNumber' => $array['contractNumber'], + 'selectedContractList' => $array['contracts'], + 'updatePersonalDetails' => $array['updatePersonalDetails'], + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'owner' => $this->owner($array['owner'], $array['ownerAddress']), + 'languageCode' => $array['languageCode'], + 'customPaymentPageCode' => $array['customPaymentPageCode'], + 'securityMode' => $array['securityMode'], + 'returnURL' => $array['returnURL'], + 'cancelURL' => $array['cancelURL'], + 'notificationURL' => $array['notificationURL'], + 'privateDataList' => $this->privateData, 'customPaymentTemplateURL' => $array['customPaymentTemplateURL'], - 'contractNumberWalletList' => $array['walletContracts'] + 'contractNumberWalletList' => $array['walletContracts'], + 'merchantName' => $array['merchantName'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::WEB_API, 'manageWebWallet'); } @@ -1864,21 +1952,21 @@ public function manageWebWallet($array) * @param array $array * associative array containing createWebWallet parameters */ - public function createWebWallet($array) + public function createWebWallet(array $array) { $this->formatRequest($array); $WSRequest = array( - 'contractNumber' => $array['contractNumber'], - 'selectedContractList' => $array['contracts'], - 'updatePersonalDetails' => $array['updatePersonalDetails'], - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), - 'languageCode' => $array['languageCode'], - 'customPaymentPageCode' => $array['customPaymentPageCode'], - 'securityMode' => $array['securityMode'], - 'returnURL' => $array['returnURL'], - 'cancelURL' => $array['cancelURL'], - 'notificationURL' => $array['notificationURL'], - 'privateDataList' => $this->privateData, + 'contractNumber' => $array['contractNumber'], + 'selectedContractList' => $array['contracts'], + 'updatePersonalDetails' => $array['updatePersonalDetails'], + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'languageCode' => $array['languageCode'], + 'customPaymentPageCode' => $array['customPaymentPageCode'], + 'securityMode' => $array['securityMode'], + 'returnURL' => $array['returnURL'], + 'cancelURL' => $array['cancelURL'], + 'notificationURL' => $array['notificationURL'], + 'privateDataList' => $this->privateData, 'customPaymentTemplateURL' => $array['customPaymentTemplateURL'], 'contractNumberWalletList' => $array['walletContracts'] ); @@ -1891,24 +1979,24 @@ public function createWebWallet($array) * @param array $array * associative array containing updateWebWallet parameters */ - public function updateWebWallet($array) + public function updateWebWallet(array $array) { $this->formatRequest($array); $WSRequest = array( - 'contractNumber' => $array['contractNumber'], - 'cardInd' => $array['cardInd'], - 'walletId' => $array['walletId'], - 'updatePersonalDetails' => $array['updatePersonalDetails'], - 'updateOwnerDetails' => $array['updateOwnerDetails'], - 'updatePaymentDetails' => $array['updatePaymentDetails'], - 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), - 'languageCode' => $array['languageCode'], - 'customPaymentPageCode' => $array['customPaymentPageCode'], - 'securityMode' => $array['securityMode'], - 'returnURL' => $array['returnURL'], - 'cancelURL' => $array['cancelURL'], - 'notificationURL' => $array['notificationURL'], - 'privateDataList' => $this->privateData, + 'contractNumber' => $array['contractNumber'], + 'cardInd' => $array['cardInd'], + 'walletId' => $array['walletId'], + 'updatePersonalDetails' => $array['updatePersonalDetails'], + 'updateOwnerDetails' => $array['updateOwnerDetails'], + 'updatePaymentDetails' => $array['updatePaymentDetails'], + 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), + 'languageCode' => $array['languageCode'], + 'customPaymentPageCode' => $array['customPaymentPageCode'], + 'securityMode' => $array['securityMode'], + 'returnURL' => $array['returnURL'], + 'cancelURL' => $array['cancelURL'], + 'notificationURL' => $array['notificationURL'], + 'privateDataList' => $this->privateData, 'customPaymentTemplateURL' => $array['customPaymentTemplateURL'], 'contractNumberWalletList' => $array['walletContracts'] ); @@ -1921,7 +2009,7 @@ public function updateWebWallet($array) * @param array $array * associative array containing getWebWallet parameters */ - public function getWebWallet($array) + public function getWebWallet(array $array) { return $this->webServiceRequest($array, $array, PaylineSDK::WEB_API, 'getWebWallet'); } @@ -1940,16 +2028,16 @@ public function getWebWallet($array) * @param array $array * associative array containing getWebWallet parameters */ - public function getTransactionDetails($array) + public function getTransactionDetails(array $array) { $this->formatRequest($array); $WSRequest = array( - 'transactionId' => $array['transactionId'], - 'orderRef' => $array['orderRef'], - 'startDate' => $array['startDate'], - 'endDate' => $array['endDate'], + 'transactionId' => $array['transactionId'], + 'orderRef' => $array['orderRef'], + 'startDate' => $array['startDate'], + 'endDate' => $array['endDate'], 'transactionHistory' => $array['transactionHistory'], - 'archiveSearch' => $array['archiveSearch'] + 'archiveSearch' => $array['archiveSearch'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::EXTENDED_API, 'getTransactionDetails'); } @@ -1960,28 +2048,28 @@ public function getTransactionDetails($array) * @param array $array * associative array containing getWebWallet parameters */ - public function transactionsSearch($array) + public function transactionsSearch(array $array) { $WSRequest = array( - 'transactionId' => $array['transactionId'], - 'orderRef' => $array['orderRef'], - 'startDate' => $array['startDate'], - 'endDate' => $array['endDate'], - 'contractNumber' => $array['contractNumber'], + 'transactionId' => $array['transactionId'], + 'orderRef' => $array['orderRef'], + 'startDate' => $array['startDate'], + 'endDate' => $array['endDate'], + 'contractNumber' => $array['contractNumber'], 'authorizationNumber' => $array['authorizationNumber'], - 'returnCode' => $array['returnCode'], - 'paymentMean' => $array['paymentMean'], - 'transactionType' => $array['transactionType'], - 'name' => $array['name'], - 'firstName' => $array['firstName'], - 'email' => $array['email'], - 'cardNumber' => $array['cardNumber'], - 'currency' => $array['currency'], - 'minAmount' => $array['minAmount'], - 'maxAmount' => $array['maxAmount'], - 'walletId' => $array['walletId'], - 'sequenceNumber' => $array['sequenceNumber'], - 'token' => $array['token'] + 'returnCode' => $array['returnCode'], + 'paymentMean' => $array['paymentMean'], + 'transactionType' => $array['transactionType'], + 'name' => $array['name'], + 'firstName' => $array['firstName'], + 'email' => $array['email'], + 'cardNumber' => $array['cardNumber'], + 'currency' => $array['currency'], + 'minAmount' => $array['minAmount'], + 'maxAmount' => $array['maxAmount'], + 'walletId' => $array['walletId'], + 'sequenceNumber' => $array['sequenceNumber'], + 'token' => $array['token'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::EXTENDED_API, 'transactionsSearch'); } @@ -1992,11 +2080,10 @@ public function transactionsSearch($array) * @param array $array * associative array containing getAlertDetails parameters */ - public function getAlertDetails($array) - { + public function getAlertDetails(array $array) { $WSRequest = array( - 'AlertId' => $array['AlertId'], - 'TransactionId' => $array['TransactionId'], + 'AlertId' => $array['AlertId'], + 'TransactionId' => $array['TransactionId'], 'TransactionDate' => $array['TransactionDate'] ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::EXTENDED_API, 'getAlertDetails'); @@ -2047,16 +2134,12 @@ public function base64_url_decode($input) * merchant access key (SHA256 encrypted) * @return string encrypted message */ - // TODO remplacer mcrypt par OpenSSL - public function getEncrypt($message, $accessKey) + public function getEncrypt($message, $accessKey) { - /* - $block = mcrypt_get_block_size('rijndael_128', 'ecb'); - $pad = $block - (strlen($message) % $block); + $block = mcrypt_get_block_size('rijndael_128', 'ecb'); + $pad = $block - (strlen($message) % $block); $message .= str_repeat(chr($pad), $pad); return $this->base64_url_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $accessKey, $message, MCRYPT_MODE_ECB)); - */ - return $this->base64_url_encode(openssl_encrypt($message, 'AES-128-CBC', $accessKey)); // 7 stands for OPENSSL_CIPHER_AES_256_CBC } /** @@ -2193,4 +2276,4 @@ public function gzdecode($data, &$filename = '', &$error = '', $maxlength = null } return $data; } -} +} diff --git a/vendor/monext/payline-sdk/src/Payline/Payment.class.php b/vendor/monext/payline-sdk/src/Payline/Payment.php similarity index 94% rename from vendor/monext/payline-sdk/src/Payline/Payment.class.php rename to vendor/monext/payline-sdk/src/Payline/Payment.php index 9f0125a..b5b6cdc 100644 --- a/vendor/monext/payline-sdk/src/Payline/Payment.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Payment.php @@ -1,32 +1,32 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Payment -{ - - public $amount; - - public $currency; - - public $action; - - public $mode; - - public $method; - - public $contractNumber; - - public $differedActionDate; - - public $softDescriptor; - - public $cardBrand; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Payment +{ + + public $amount; + + public $currency; + + public $action; + + public $mode; + + public $method; + + public $contractNumber; + + public $differedActionDate; + + public $softDescriptor; + + public $cardBrand; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/PaymentData.php b/vendor/monext/payline-sdk/src/Payline/PaymentData.php new file mode 100644 index 0000000..8fc3f17 --- /dev/null +++ b/vendor/monext/payline-sdk/src/Payline/PaymentData.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class PaymentData +{ + public $transactionID; + + public $network; + + public $tokenData; +} \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/PrivateData.class.php b/vendor/monext/payline-sdk/src/Payline/PrivateData.php similarity index 94% rename from vendor/monext/payline-sdk/src/Payline/PrivateData.class.php rename to vendor/monext/payline-sdk/src/Payline/PrivateData.php index 4b66eb4..5abaa2b 100644 --- a/vendor/monext/payline-sdk/src/Payline/PrivateData.class.php +++ b/vendor/monext/payline-sdk/src/Payline/PrivateData.php @@ -1,18 +1,18 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class PrivateData -{ - - public $key; - - public $value; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class PrivateData +{ + + public $key; + + public $value; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Recurring.class.php b/vendor/monext/payline-sdk/src/Payline/Recurring.php similarity index 94% rename from vendor/monext/payline-sdk/src/Payline/Recurring.class.php rename to vendor/monext/payline-sdk/src/Payline/Recurring.php index 3e9c706..03c75b3 100644 --- a/vendor/monext/payline-sdk/src/Payline/Recurring.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Recurring.php @@ -1,28 +1,28 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Recurring -{ - - public $firstAmount; - - public $amount; - - public $billingCycle; - - public $billingLeft; - - public $billingDay; - - public $startDate; - - public $endDate; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Recurring +{ + + public $firstAmount; + + public $amount; + + public $billingCycle; + + public $billingLeft; + + public $billingDay; + + public $startDate; + + public $endDate; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/Wallet.class.php b/vendor/monext/payline-sdk/src/Payline/Wallet.php similarity index 93% rename from vendor/monext/payline-sdk/src/Payline/Wallet.class.php rename to vendor/monext/payline-sdk/src/Payline/Wallet.php index d107b23..0c8f015 100644 --- a/vendor/monext/payline-sdk/src/Payline/Wallet.class.php +++ b/vendor/monext/payline-sdk/src/Payline/Wallet.php @@ -1,34 +1,34 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Wallet -{ - - public $walletId; - - public $lastName; - - public $firstName; - - public $email; - - public $shippingAddress; - - public $card; - - public $comment; - - public $default; - - public $cardStatus; - - public $cardBrand; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Wallet +{ + + public $walletId; + + public $lastName; + + public $firstName; + + public $email; + + public $shippingAddress; + + public $card; + + public $comment; + + public $default; + + public $cardStatus; + + public $cardBrand; } \ No newline at end of file diff --git a/vendor/monext/payline-sdk/src/Payline/v4.49.wsdl b/vendor/monext/payline-sdk/src/Payline/v4.52.wsdl similarity index 93% rename from vendor/monext/payline-sdk/src/Payline/v4.49.wsdl rename to vendor/monext/payline-sdk/src/Payline/v4.52.wsdl index 3fdd0d0..7c8a69f 100644 --- a/vendor/monext/payline-sdk/src/Payline/v4.49.wsdl +++ b/vendor/monext/payline-sdk/src/Payline/v4.52.wsdl @@ -1,3518 +1,3408 @@ - - - - - - - - - - This element is the request for the - doWebPayment - method - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - doWebPayment - method - - - - - - - - - - - - - - - - - This element is the reponse from the - getWebPayment - method - - - - - - - - - - - - - This element is the reponse from the - doWebPayment - method - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element is the request for the - doAuthorization - method - - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - doAuthorization method - - - - - - - - - - - - - - - - - - This element is the request for the - doCapture method - - - - - - - - - - - - - - - - - This element is the reponse from the - doCapture - method - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element is the request for the doRefund - method - - - - - - - - - - - - - - - - - - This element is the reponse from the - doRefund method - - - - - - - - - - - - - This element is the request for the doReset - method - - - - - - - - - - - - - - - This element is the reponse from the doReset - method - - - - - - - - - - - - - This element is the request for the doCredit - method - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - doCredit method - - - - - - - - - - - - - - - This element is the request for the - createWallet - method - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - createWallet - method - - - - - - - - - - - - - - - - This element is the request for the - updateWallet - method - - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - updateWallet - method - - - - - - - - - - - - - - - This element is the request for the - getWallet method - - - - - - - - - - - - - - - - This element is the reponse from the - getWallet - method - - - - - - - - - - - - - - - - - - - - This element is the request for the - getCards method - - - - - - - - - - - - - - - This element is the reponse from the - getCards method - - - - - - - - - - - - - - - This element is the request for the - disableWallet - method - - - - - - - - - - - - - - This element is the reponse from the - disableWallet - method - - - - - - - - - - - - - This element is the request for the - enableWallet - method - - - - - - - - - - - - - - This element is the reponse from the - enableWallet - method - - - - - - - - - - - - This element is the request for the - doImmediateWalletPayment method - - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - doImmediateWalletPayment method - - - - - - - - - - - - - - This element is the request for the - doScheduledWalletPayment method - - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - doScheduledWalletPayment method - - - - - - - - - - - - - This element is the request for the - doRecurrentWalletPayment method - - - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - doRecurrentWalletPayment method - - - - - - - - - - - - - - This element is the request for the - getPaymentRecord method - - - - - - - - - - - - - - This element is the reponse from the - getPaymentRecord method - - - - - - - - - - - - - - - - - - - This element is the request for the - disablePaymentRecord method - - - - - - - - - - - - - This element is the reponse from the - disablePaymentRecord method - - - - - - - - - - - - This element is the request for the - manageWebWallet - method - - - - - - - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - manageWebWallet method - - - - - - - - - - - - - - This element is the request for the - createWebWallet - method - - - - - - - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - createWebWallet method - - - - - - - - - - - - - - This element is the request for the - updateWebWallet - method - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - updateWebWallet method - - - - - - - - - - - - - - This element is the request for the - getWebWallet - method - - - - - - - - - - - - - This element is the reponse from the - getWebWallet - method - - - - - - - - - - - - - - - - - - - This element is the request for the - getTransactionDetails method - - - - - - - - - - - - - - - - - - This element is the response for the - getTransactionDetails method - - - - - - - - - - - - - - - - - - - - - - - - - - This element is the request for the - transactionsSearch method - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element is the response for the - transactionsSearch method - - - - - - - - - - - - - This element is the request for the - verifyEnrollment method - - - - - - - - - - - - - - - - - - - - This element is the reponse from the - verifyEnrollment method - - - - - - - - - - - - - - - - - - - - - - - - This element is the request for the - doAuthentication method - - - - - - - - - - - - - - - - This element is the reponse from the - doAuthentication method - - - - - - - - - - - - - - This element is the request for the - createMerchant - method - - - - - - - - currency in ISO 4217 numeric format - - - - - - - - - - - unique national merchant ID - - - - - - Systeme d identification du Repertoire des - ENtreprises - - - - - - - - - - - to use if country is not France - - - - - - - - - Payline Distributor ID - - - - - - - - - list of point of sell - - - - - - - - - - Billing partner. 1:monext, 2:cetib, 3:payline.com - - - - - - - - - - - This element is the reponse from the - createMerchant - method - - - - - - - - - - - - - This element is the request for the - doScoringCheque - method - - - - - - - - - - - - - - - - - This element is the reponse from the - doScoringCheque method - - - - - - - - - - - - - - This element is the request for the - getEncryptionKeyRequest method - - - - - - - - - This element is the reponse from the - getEncryptionKeyResponse method - - - - - - - - - - - - - This element is the request for the - doReAuthorization method - - - - - - - - - - - - - - - - - This element is the reponse from the - doReAuthorization method - - - - - - - - - - - - - - - This element is the request for the - getMerchantSettings method - - - - - - - - - - - - This element is the response from the - getMerchantSettings method - - - - - - - - - - - - - - - - - - - This element is the request for the - getBalance - method - - - - - - - - - - - - - - This element is the reponse from the - getBalance - method - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element is the request for the doBankTransfer - method - - - - - - - - - - - - - - - - - This element is the reponse from the - doBankTransfer method - - - - - - - - - - - - - - - - This element contains information about the - process - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element contains information about the - order - - - - - - - - - - - - - - - - - - - - - This element contains information about the - encryptionKey - - - - - - - - - - - - - This element contains an array of orderDetail - - - - - - - - - - - This element contains information about the - order - product - - - - - - - - - - - - - - - - - - - This element contains information about the - merchant - private data - - - - - - - - - - - This element contains information about the - transaction - - - - - - - - - - - - - - - - - - - - - - This element contains information about the - fraud - result details - - - - - - - - - - - - This element contains information about the - payment - - - - - - - - - - - - - - - - - - This element contains information about the - authorization - - - - - - - - - - - This element contains information about the card - - - - - - - - - - - - - - - - - - - - This element contains information about the - buyer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element contains information about the - owner - - - - - - - - - - - - - This element contains information about the - address - - - - - - - - - - - - - - - - - - - - - - This element contains information about the - address - - - - - - - - - - - - - - This element contains information about the - capture - - - - - - - - - - - This element contains information about the - refund - - - - - - - - - - - This element contains the list of selected card - - - - - - - - - - An array of private data - - - - - - - - - - An array of contract number of a wallet - - - - - - - - - - An array of cards - - - - - - - - - - This element contains element for recurring - operation - - - - - - - - - - - - - - - - - - This element contains element for update a recurring - operation - - - - - - - - - - - - - - This element contains element for a billing - record - - - - - - - - - - - - - - - - - An array of billing record - - - - - - - - - - - This element contains element for update a recurring - operation - - - - - - - - - - - - - - This element contains element for a wallet - - - - - - - - - - - - - - - - - - - This element contains element for a wallet - - - - - - - - - - - - - - - - - - - - - This element contains the list of selected card - - - - - - - - - - This element contains the list of selected card - - - - - - - - - - This element contains element for a 3DSecure - transaction - - - - - - - - - - - - - - - - - - - This element contains the merchant connection - parameters - - - - - - - - - - - - - - This element contains the scoring cheque parameters - - - - - - - - - - - - - This element contains information about Interlocutor - address - - - - - - - - - - - - - - - This element contains information about Interlocutor - - - - - - - - - - - - - - - - An array of subscribed options - - - - - - - - - - - - This element contains information about the payline - package subscribed by the merchant - - - - - - - - - - - This element contains IBAN information - - - - - - - - - - - - - This element contains RIB information - - - - - - - - - - - - This element contains bankAccount information - - - - - - - - - - - - - This element contains bank Account information - - - - - - - - - - - - - This element contains technical data used to define - acquirer service - - - - - - - - - - - - This element contains all information about contract - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element contains all information about - customPaymentPageCode - - - - - - - - - - - - This element contains information e-ticket - - - - - - - - - - - This element contains all information about point of - sell - - - - - - - Merchant Category Code - - - - - - - - - - - - - - - - - - - - list of contract - - - - - - - - - - - list of custom payment page code - - - - - - - - - - - - virtualTerminal - - - - - - http session timeout delay - - - - - path to logo - - - - - list of functions - - - - - - - - - - - - functions availbe in virtual terminal - - - - - - Please refer to Payline documentation - - - - - - - - - - - - - - - Value of parameter - - - - - Parameter ID. Refer to payline documentation - - - - - - - - - - - - This element contains information about the - cheque - - - - - - - - - - This element contains all information about - contrinution - - - - - - - - - - - - - - - This element contains information about the - associated transactions - - - - - - - - - - - - - - - - An array of associatedTransactions - - - - - - - - - - - This element contains information about the - status - History - - - - - - - - - - - - - - - - An array of statusHistory - - - - - - - - - - This element contains information about the - paymentAdditional - - - - - - - - - - - - - - - - An array of paymentAdditionalList - - - - - - - - - - - An array of CustomerTrans - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - An array of PaymentMeansTrans - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - An array of AlertsTrans - - - - - - - - - - - - - - - - - - - - - - - - - - - - This element contains information about the - creditor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + This element is the request for the + doWebPayment + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doWebPayment + method + + + + + + + + + + + + + + + + + This element is the reponse from the + getWebPayment + method + + + + + + + + + + + + + This element is the reponse from the + doWebPayment + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the + doAuthorization + method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doAuthorization method + + + + + + + + + + + + + + + + + + This element is the request for the + doCapture method + + + + + + + + + + + + + + + + + This element is the reponse from the + doCapture + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the doRefund + method + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doRefund method + + + + + + + + + + + + + This element is the request for the doReset + method + + + + + + + + + + + + + + + This element is the reponse from the doReset + method + + + + + + + + + + + + + This element is the request for the doCredit + method + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doCredit method + + + + + + + + + + + + + + + This element is the request for the + createWallet + method + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + createWallet + method + + + + + + + + + + + + + + + + This element is the request for the + updateWallet + method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + updateWallet + method + + + + + + + + + + + + + + + This element is the request for the + getWallet method + + + + + + + + + + + + + + + + This element is the reponse from the + getWallet + method + + + + + + + + + + + + + + + + + + + + This element is the request for the + getCards method + + + + + + + + + + + + + + + This element is the reponse from the + getCards method + + + + + + + + + + + + + + + This element is the request for the + disableWallet + method + + + + + + + + + + + + + + This element is the reponse from the + disableWallet + method + + + + + + + + + + + + + This element is the request for the + enableWallet + method + + + + + + + + + + + + + + This element is the reponse from the + enableWallet + method + + + + + + + + + + + + This element is the request for the + doImmediateWalletPayment method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doImmediateWalletPayment method + + + + + + + + + + + + + + This element is the request for the + doScheduledWalletPayment method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doScheduledWalletPayment method + + + + + + + + + + + + + This element is the request for the + doRecurrentWalletPayment method + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doRecurrentWalletPayment method + + + + + + + + + + + + + + This element is the request for the + getPaymentRecord method + + + + + + + + + + + + + + This element is the reponse from the + getPaymentRecord method + + + + + + + + + + + + + + + + + + + This element is the request for the + disablePaymentRecord method + + + + + + + + + + + + + This element is the reponse from the + disablePaymentRecord method + + + + + + + + + + + + This element is the request for the + manageWebWallet + method + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + manageWebWallet method + + + + + + + + + + + + + + This element is the request for the + createWebWallet + method + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + createWebWallet method + + + + + + + + + + + + + + This element is the request for the + updateWebWallet + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + updateWebWallet method + + + + + + + + + + + + + + This element is the request for the + getWebWallet + method + + + + + + + + + + + + + This element is the reponse from the + getWebWallet + method + + + + + + + + + + + + + + + + + + + This element is the request for the + getTransactionDetails method + + + + + + + + + + + + + + + + + + This element is the response for the + getTransactionDetails method + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the + transactionsSearch method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the response for the + transactionsSearch method + + + + + + + + + + + + + This element is the request for the + verifyEnrollment method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + verifyEnrollment method + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the + doAuthentication method + + + + + + + + + + + + + + + + This element is the reponse from the + doAuthentication method + + + + + + + + + + + + + + This element is the request for the + doScoringCheque + method + + + + + + + + + + + + + + + + + This element is the reponse from the + doScoringCheque method + + + + + + + + + + + + + + This element is the request for the + getEncryptionKeyRequest method + + + + + + + + + This element is the reponse from the + getEncryptionKeyResponse method + + + + + + + + + + + + + This element is the request for the + doReAuthorization method + + + + + + + + + + + + + + + + + This element is the reponse from the + doReAuthorization method + + + + + + + + + + + + + + + This element is the request for the + getMerchantSettings method + + + + + + + + + + + + This element is the response from the + getMerchantSettings method + + + + + + + + + + + + + + + + + + + This element is the request for the + getBalance + method + + + + + + + + + + + + + + This element is the reponse from the + getBalance + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the doBankTransfer + method + + + + + + + + + + + + + + + + + This element is the reponse from the + doBankTransfer method + + + + + + + + + + + + + + + + This element contains information about the + process + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + order + + + + + + + + + + + + + + + + + + + + + This element contains information about the + encryptionKey + + + + + + + + + + + + + This element contains an array of orderDetail + + + + + + + + + + + This element contains information about the + order + product + + + + + + + + + + + + + + + + + + + This element contains information about the + merchant + private data + + + + + + + + + + + This element contains information about the + transaction + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + fraud + result details + + + + + + + + + + + + This element contains information about the + payment + + + + + + + + + + + + + + + + + + This element contains information about the + authorization + + + + + + + + + + + This element contains information about the paymentData + + + + + + + + + + + + This element contains information about the card + + + + + + + + + + + + + + + + + + + + + This element contains information about the + buyer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + owner + + + + + + + + + + + + + This element contains information about the + address + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + address + + + + + + + + + + + + + + This element contains information about the + capture + + + + + + + + + + + This element contains information about the + refund + + + + + + + + + + + This element contains the list of selected card + + + + + + + + + + An array of private data + + + + + + + + + + This element contains the result of the address verification service + + + + + + + + + + + An array of contract number of a wallet + + + + + + + + + + An array of cards + + + + + + + + + + This element contains element for recurring + operation + + + + + + + + + + + + + + + + + + This element contains element for update a recurring + operation + + + + + + + + + + + + + + This element contains element for a billing + record + + + + + + + + + + + + + + + + + An array of billing record + + + + + + + + + + + This element contains element for update a recurring + operation + + + + + + + + + + + + + + This element contains element for a wallet + + + + + + + + + + + + + + + + + + + This element contains element for a wallet + + + + + + + + + + + + + + + + + + + + + This element contains the list of selected card + + + + + + + + + + This element contains the list of selected card + + + + + + + + + + This element contains element for a 3DSecure + transaction + + + + + + + + + + + + + + + + + + + This element contains the merchant connection + parameters + + + + + + + + + + + + + + This element contains the scoring cheque parameters + + + + + + + + + + + + + This element contains information about Interlocutor + address + + + + + + + + + + + + + + + This element contains information about Interlocutor + + + + + + + + + + + + + + + + This element contains IBAN information + + + + + + + + + + + + + This element contains RIB information + + + + + + + + + + + + This element contains bankAccount information + + + + + + + + + + + + + This element contains bank Account information + + + + + + + + + + + + + This element contains technical data used to define + acquirer service + + + + + + + + + + + + This element contains all information about contract + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains all information about + customPaymentPageCode + + + + + + + + + + + + This element contains information e-ticket + + + + + + + + + + + This element contains all information about point of + sell + + + + + + + Merchant Category Code + + + + + + + + + + + + + + + + + + + + list of contract + + + + + + + + + + + list of custom payment page code + + + + + + + + + + + + virtualTerminal + + + + + + http session timeout delay + + + + + path to logo + + + + + list of functions + + + + + + + + + + + + functions availbe in virtual terminal + + + + + + Please refer to Payline documentation + + + + + + + + + + + + + + + Value of parameter + + + + + Parameter ID. Refer to payline documentation + + + + + + + + + + + + This element contains information about the + cheque + + + + + + + + + + This element contains all information about + contrinution + + + + + + + + + + + + + + + This element contains information about the + associated transactions + + + + + + + + + + + + + + + + An array of associatedTransactions + + + + + + + + + + + This element contains information about the + status + History + + + + + + + + + + + + + + + + An array of statusHistory + + + + + + + + + + This element contains information about the + paymentAdditional + + + + + + + + + + + + + + + + An array of paymentAdditionalList + + + + + + + + + + + An array of CustomerTrans + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An array of PaymentMeansTrans + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An array of AlertsTrans + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + creditor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 54610d414591f3fd9d7350cc78ab43bec74344a0 Mon Sep 17 00:00:00 2001 From: neopheus Date: Wed, 3 Jan 2018 13:32:13 +0100 Subject: [PATCH 2/2] UPDATE COMPOSER MONOLOG --- composer.lock | 12 +- vendor/composer/installed.json | 160 +++++++++--------- .../monolog/{CHANGELOG.mdown => CHANGELOG.md} | 14 ++ .../monolog/{README.mdown => README.md} | 0 vendor/monolog/monolog/composer.json | 2 +- .../monolog/src/Monolog/ErrorHandler.php | 3 + .../Formatter/GelfMessageFormatter.php | 33 ++-- .../src/Monolog/Formatter/JsonFormatter.php | 2 + .../src/Monolog/Formatter/LineFormatter.php | 6 +- .../src/Monolog/Handler/ChromePHPHandler.php | 2 +- .../src/Monolog/Handler/DynamoDbHandler.php | 4 +- .../src/Monolog/Handler/HandlerWrapper.php | 18 +- .../src/Monolog/Handler/RavenHandler.php | 3 +- .../src/Monolog/Handler/RollbarHandler.php | 1 + .../src/Monolog/Handler/Slack/SlackRecord.php | 128 +++++++++----- .../src/Monolog/Handler/SlackHandler.php | 17 +- .../Monolog/Handler/SlackWebhookHandler.php | 21 ++- .../Monolog/Handler/SwiftMailerHandler.php | 7 +- .../src/Monolog/Handler/SyslogUdpHandler.php | 25 ++- .../Processor/IntrospectionProcessor.php | 7 +- .../Formatter/GelfMessageFormatterTest.php | 32 +++- .../Monolog/Handler/ChromePHPHandlerTest.php | 17 +- .../Monolog/Handler/DynamoDbHandlerTest.php | 11 +- .../Monolog/Handler/RavenHandlerTest.php | 4 +- .../Monolog/Handler/RollbarHandlerTest.php | 84 +++++++++ .../Handler/RotatingFileHandlerTest.php | 4 +- .../Monolog/Handler/Slack/SlackRecordTest.php | 156 +++++++++++------ .../Handler/SlackWebhookHandlerTest.php | 9 +- .../Handler/SwiftMailerHandlerTest.php | 2 +- .../Monolog/Handler/SyslogUdpHandlerTest.php | 17 +- 30 files changed, 558 insertions(+), 243 deletions(-) rename vendor/monolog/monolog/{CHANGELOG.mdown => CHANGELOG.md} (96%) rename vendor/monolog/monolog/{README.mdown => README.md} (100%) create mode 100644 vendor/monolog/monolog/tests/Monolog/Handler/RollbarHandlerTest.php diff --git a/composer.lock b/composer.lock index aab4a93..5a350b2 100644 --- a/composer.lock +++ b/composer.lock @@ -97,16 +97,16 @@ }, { "name": "monolog/monolog", - "version": "1.22.0", + "version": "1.23.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", "shasum": "" }, "require": { @@ -127,7 +127,7 @@ "phpunit/phpunit-mock-objects": "2.3.0", "ruflin/elastica": ">=0.90 <3.0", "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "~5.3" + "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", @@ -171,7 +171,7 @@ "logging", "psr-3" ], - "time": "2016-11-26T00:15:39+00:00" + "time": "2017-06-19T01:22:40+00:00" }, { "name": "psr/log", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 8e8b5bf..5796a06 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -48,86 +48,6 @@ "psr-3" ] }, - { - "name": "monolog/monolog", - "version": "1.22.0", - "version_normalized": "1.22.0.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558", - "reference": "bad29cb8d18ab0315e6c477751418a82c850d558", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "~5.3" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "time": "2016-11-26T00:15:39+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ] - }, { "name": "monext/payline-tools-sdk", "version": "0.9", @@ -220,5 +140,85 @@ "Payline", "payment" ] + }, + { + "name": "monolog/monolog", + "version": "1.23.0", + "version_normalized": "1.23.0.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "time": "2017-06-19T01:22:40+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ] } ] diff --git a/vendor/monolog/monolog/CHANGELOG.mdown b/vendor/monolog/monolog/CHANGELOG.md similarity index 96% rename from vendor/monolog/monolog/CHANGELOG.mdown rename to vendor/monolog/monolog/CHANGELOG.md index 76ea0ea..cd1142d 100644 --- a/vendor/monolog/monolog/CHANGELOG.mdown +++ b/vendor/monolog/monolog/CHANGELOG.md @@ -1,3 +1,17 @@ +### 1.23.0 (2017-06-19) + + * Improved SyslogUdpHandler's support for RFC5424 and added optional `$ident` argument + * Fixed GelfHandler truncation to be per field and not per message + * Fixed compatibility issue with PHP <5.3.6 + * Fixed support for headless Chrome in ChromePHPHandler + * Fixed support for latest Aws SDK in DynamoDbHandler + * Fixed support for SwiftMailer 6.0+ in SwiftMailerHandler + +### 1.22.1 (2017-03-13) + + * Fixed lots of minor issues in the new Slack integrations + * Fixed support for allowInlineLineBreaks in LineFormatter when formatting exception backtraces + ### 1.22.0 (2016-11-26) * Added SlackbotHandler and SlackWebhookHandler to set up Slack integration more easily diff --git a/vendor/monolog/monolog/README.mdown b/vendor/monolog/monolog/README.md similarity index 100% rename from vendor/monolog/monolog/README.mdown rename to vendor/monolog/monolog/README.md diff --git a/vendor/monolog/monolog/composer.json b/vendor/monolog/monolog/composer.json index f74b7b9..3b0c880 100644 --- a/vendor/monolog/monolog/composer.json +++ b/vendor/monolog/monolog/composer.json @@ -24,7 +24,7 @@ "doctrine/couchdb": "~1.0@dev", "aws/aws-sdk-php": "^2.4.9 || ^3.0", "php-amqplib/php-amqplib": "~2.4", - "swiftmailer/swiftmailer": "~5.3", + "swiftmailer/swiftmailer": "^5.3|^6.0", "php-console/php-console": "^3.1.3", "phpunit/phpunit-mock-objects": "2.3.0", "jakub-onderka/php-parallel-lint": "0.9" diff --git a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php index 0152298..7bfcd83 100644 --- a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +++ b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php @@ -58,6 +58,9 @@ public function __construct(LoggerInterface $logger) */ public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null) { + //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929 + class_exists('\\Psr\\Log\\LogLevel', true); + $handler = new static($logger); if ($errorLevelMap !== false) { $handler->registerErrorHandler($errorLevelMap); diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php index 64e7665..2c1b0e8 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php @@ -22,7 +22,7 @@ */ class GelfMessageFormatter extends NormalizerFormatter { - const MAX_LENGTH = 32766; + const DEFAULT_MAX_LENGTH = 32766; /** * @var string the name of the system for the Gelf log message @@ -39,6 +39,11 @@ class GelfMessageFormatter extends NormalizerFormatter */ protected $contextPrefix; + /** + * @var int max length per field + */ + protected $maxLength; + /** * Translates Monolog log levels to Graylog2 log priorities. */ @@ -53,7 +58,7 @@ class GelfMessageFormatter extends NormalizerFormatter Logger::EMERGENCY => 0, ); - public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_') + public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $maxLength = null) { parent::__construct('U.u'); @@ -61,6 +66,7 @@ public function __construct($systemName = null, $extraPrefix = null, $contextPre $this->extraPrefix = $extraPrefix; $this->contextPrefix = $contextPrefix; + $this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength; } /** @@ -81,35 +87,30 @@ public function format(array $record) ->setHost($this->systemName) ->setLevel($this->logLevels[$record['level']]); - // start count with message length + system name length + 200 for padding / metadata + // message length + system name length + 200 for padding / metadata $len = 200 + strlen((string) $record['message']) + strlen($this->systemName); - if ($len > self::MAX_LENGTH) { - $message->setShortMessage(substr($record['message'], 0, self::MAX_LENGTH - 200)); - - return $message; + if ($len > $this->maxLength) { + $message->setShortMessage(substr($record['message'], 0, $this->maxLength)); } if (isset($record['channel'])) { $message->setFacility($record['channel']); - $len += strlen($record['channel']); } if (isset($record['extra']['line'])) { $message->setLine($record['extra']['line']); - $len += 10; unset($record['extra']['line']); } if (isset($record['extra']['file'])) { $message->setFile($record['extra']['file']); - $len += strlen($record['extra']['file']); unset($record['extra']['file']); } foreach ($record['extra'] as $key => $val) { $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); - $len += strlen($this->extraPrefix . $key . $val); - if ($len > self::MAX_LENGTH) { - $message->setAdditional($this->extraPrefix . $key, substr($val, 0, self::MAX_LENGTH - $len)); + $len = strlen($this->extraPrefix . $key . $val); + if ($len > $this->maxLength) { + $message->setAdditional($this->extraPrefix . $key, substr($val, 0, $this->maxLength)); break; } $message->setAdditional($this->extraPrefix . $key, $val); @@ -117,9 +118,9 @@ public function format(array $record) foreach ($record['context'] as $key => $val) { $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); - $len += strlen($this->contextPrefix . $key . $val); - if ($len > self::MAX_LENGTH) { - $message->setAdditional($this->contextPrefix . $key, substr($val, 0, self::MAX_LENGTH - $len)); + $len = strlen($this->contextPrefix . $key . $val); + if ($len > $this->maxLength) { + $message->setAdditional($this->contextPrefix . $key, substr($val, 0, $this->maxLength)); break; } $message->setAdditional($this->contextPrefix . $key, $val); diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index 4b2be77..0782f14 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -28,6 +28,7 @@ class JsonFormatter extends NormalizerFormatter protected $batchMode; protected $appendNewline; + /** * @var bool */ @@ -35,6 +36,7 @@ class JsonFormatter extends NormalizerFormatter /** * @param int $batchMode + * @param bool $appendNewline */ public function __construct($batchMode = self::BATCH_MODE_JSON, $appendNewline = true) { diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php index 8ffe601..d3e209e 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php @@ -141,7 +141,7 @@ protected function normalizeException($e) $str = '[object] ('.get_class($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')'; if ($this->includeStacktraces) { - $str .= "\n[stacktrace]\n".$e->getTraceAsString(); + $str .= "\n[stacktrace]\n".$e->getTraceAsString()."\n"; } return $str; @@ -167,6 +167,10 @@ protected function convertToString($data) protected function replaceNewlines($str) { if ($this->allowInlineLineBreaks) { + if (0 === strpos($str, '{')) { + return str_replace(array('\r', '\n'), array("\r", "\n"), $str); + } + return $str; } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php index b00fa84..785cb0c 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php @@ -36,7 +36,7 @@ class ChromePHPHandler extends AbstractProcessingHandler /** * Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+) */ - const USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}'; + const USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}'; protected static $initialized = false; diff --git a/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php index ad1011d..237b71f 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php @@ -11,7 +11,7 @@ namespace Monolog\Handler; -use Aws\Common\Aws; +use Aws\Sdk; use Aws\DynamoDb\DynamoDbClient; use Aws\DynamoDb\Marshaler; use Monolog\Formatter\ScalarFormatter; @@ -55,7 +55,7 @@ class DynamoDbHandler extends AbstractProcessingHandler */ public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true) { - if (defined('Aws\Common\Aws::VERSION') && version_compare(Aws::VERSION, '3.0', '>=')) { + if (defined('Aws\Sdk::VERSION') && version_compare(Sdk::VERSION, '3.0', '>=')) { $this->version = 3; $this->marshaler = new Marshaler; } else { diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php b/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php index 56bc270..e540d80 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php @@ -16,15 +16,17 @@ /** * This simple wrapper class can be used to extend handlers functionality. * - * Example: A filtering handle. Inherit from this class, override isHandling() like this + * Example: A custom filtering that can be applied to any handler. * - * public function isHandling(array $record) - * { - * if ($record meets certain conditions) { - * return false; - * } - * return $this->handler->isHandling($record); - * } + * Inherit from this class and override handle() like this: + * + * public function handle(array $record) + * { + * if ($record meets certain conditions) { + * return false; + * } + * return $this->handler->handle($record); + * } * * @author Alexey Karapetov */ diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php index d3f9ed8..53a8b39 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php @@ -216,11 +216,12 @@ protected function getDefaultBatchFormatter() */ protected function getExtraParameters() { - return array('checksum', 'release'); + return array('checksum', 'release', 'event_id'); } /** * @param string $value + * @return self */ public function setRelease($value) { diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php index 0d9de1a..6c8a3e3 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php @@ -97,6 +97,7 @@ protected function write(array $record) )); if (isset($context['exception']) && $context['exception'] instanceof Exception) { + $payload['level'] = $context['level']; $exception = $context['exception']; unset($context['exception']); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php b/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php index cb0b871..38bc838 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php @@ -12,7 +12,7 @@ namespace Monolog\Handler\Slack; use Monolog\Logger; -use Monolog\Formatter\LineFormatter; +use Monolog\Formatter\NormalizerFormatter; use Monolog\Formatter\FormatterInterface; /** @@ -41,15 +41,15 @@ class SlackRecord /** * Name of a bot - * @var string + * @var string|null */ private $username; /** - * Emoji icon name + * User icon e.g. 'ghost', 'http://example.com/user.png' * @var string */ - private $iconEmoji; + private $userIcon; /** * Whether the message should be added to Slack as attachment (plain text otherwise) @@ -69,43 +69,52 @@ class SlackRecord */ private $includeContextAndExtra; + /** + * Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] + * @var array + */ + private $excludeFields; + /** * @var FormatterInterface */ private $formatter; /** - * @var LineFormatter + * @var NormalizerFormatter */ - private $lineFormatter; + private $normalizerFormatter; - public function __construct($channel = null, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, FormatterInterface $formatter = null) + public function __construct($channel = null, $username = null, $useAttachment = true, $userIcon = null, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array(), FormatterInterface $formatter = null) { $this->channel = $channel; $this->username = $username; - $this->iconEmoji = trim($iconEmoji, ':'); + $this->userIcon = trim($userIcon, ':'); $this->useAttachment = $useAttachment; $this->useShortAttachment = $useShortAttachment; $this->includeContextAndExtra = $includeContextAndExtra; + $this->excludeFields = $excludeFields; $this->formatter = $formatter; if ($this->includeContextAndExtra) { - $this->lineFormatter = new LineFormatter(); + $this->normalizerFormatter = new NormalizerFormatter(); } } public function getSlackData(array $record) { - $dataArray = array( - 'username' => $this->username, - 'text' => '', - ); + $dataArray = array(); + $record = $this->excludeFields($record); + + if ($this->username) { + $dataArray['username'] = $this->username; + } if ($this->channel) { $dataArray['channel'] = $this->channel; } - if ($this->formatter) { + if ($this->formatter && !$this->useAttachment) { $message = $this->formatter->format($record); } else { $message = $record['message']; @@ -113,19 +122,22 @@ public function getSlackData(array $record) if ($this->useAttachment) { $attachment = array( - 'fallback' => $message, - 'text' => $message, - 'color' => $this->getAttachmentColor($record['level']), - 'fields' => array(), + 'fallback' => $message, + 'text' => $message, + 'color' => $this->getAttachmentColor($record['level']), + 'fields' => array(), + 'mrkdwn_in' => array('fields'), + 'ts' => $record['datetime']->getTimestamp() ); if ($this->useShortAttachment) { $attachment['title'] = $record['level_name']; } else { $attachment['title'] = 'Message'; - $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name'], true); + $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']); } + if ($this->includeContextAndExtra) { foreach (array('extra', 'context') as $key) { if (empty($record[$key])) { @@ -135,8 +147,7 @@ public function getSlackData(array $record) if ($this->useShortAttachment) { $attachment['fields'][] = $this->generateAttachmentField( ucfirst($key), - $this->stringify($record[$key]), - true + $record[$key] ); } else { // Add all extra fields as individual fields in attachment @@ -153,8 +164,12 @@ public function getSlackData(array $record) $dataArray['text'] = $message; } - if ($this->iconEmoji) { - $dataArray['icon_emoji'] = ":{$this->iconEmoji}:"; + if ($this->userIcon) { + if (filter_var($this->userIcon, FILTER_VALIDATE_URL)) { + $dataArray['icon_url'] = $this->userIcon; + } else { + $dataArray['icon_emoji'] = ":{$this->userIcon}:"; + } } return $dataArray; @@ -184,23 +199,21 @@ public function getAttachmentColor($level) /** * Stringifies an array of key/value pairs to be used in attachment fields * - * @param array $fields - * @return string|null + * @param array $fields + * + * @return string */ public function stringify($fields) { - if (!$this->lineFormatter) { - return null; - } - - $string = ''; - foreach ($fields as $var => $val) { - $string .= $var.': '.$this->lineFormatter->stringify($val)." | "; - } + $normalized = $this->normalizerFormatter->format($fields); + $prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; - $string = rtrim($string, " |"); + $hasSecondDimension = count(array_filter($normalized, 'is_array')); + $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric')); - return $string; + return $hasSecondDimension || $hasNonNumericKeys + ? json_encode($normalized, $prettyPrintFlag) + : json_encode($normalized); } /** @@ -217,16 +230,20 @@ public function setFormatter(FormatterInterface $formatter) * Generates attachment field * * @param string $title - * @param string|array $value - * @param bool $short + * @param string|array $value\ + * * @return array */ - private function generateAttachmentField($title, $value, $short) + private function generateAttachmentField($title, $value) { + $value = is_array($value) + ? sprintf('```%s```', $this->stringify($value)) + : $value; + return array( 'title' => $title, - 'value' => is_array($value) ? $this->lineFormatter->stringify($value) : $value, - 'short' => $short + 'value' => $value, + 'short' => false ); } @@ -234,15 +251,44 @@ private function generateAttachmentField($title, $value, $short) * Generates a collection of attachment fields from array * * @param array $data + * * @return array */ private function generateAttachmentFields(array $data) { $fields = array(); foreach ($data as $key => $value) { - $fields[] = $this->generateAttachmentField($key, $value, false); + $fields[] = $this->generateAttachmentField($key, $value); } return $fields; } + + /** + * Get a copy of record with fields excluded according to $this->excludeFields + * + * @param array $record + * + * @return array + */ + private function excludeFields(array $record) + { + foreach ($this->excludeFields as $field) { + $keys = explode('.', $field); + $node = &$record; + $lastKey = end($keys); + foreach ($keys as $key) { + if (!isset($node[$key])) { + break; + } + if ($lastKey === $key) { + unset($node[$key]); + break; + } + $node = &$node[$key]; + } + } + + return $record; + } } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php index c2cca0c..3ac4d83 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php @@ -38,16 +38,17 @@ class SlackHandler extends SocketHandler /** * @param string $token Slack API token * @param string $channel Slack channel (encoded ID or name) - * @param string $username Name of a bot + * @param string|null $username Name of a bot * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) * @param string|null $iconEmoji The emoji name to use (or null) * @param int $level The minimum logging level at which this handler will be triggered * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style * @param bool $includeContextAndExtra Whether the attachment should include context and extra data + * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] * @throws MissingExtensionException If no OpenSSL PHP extension configured */ - public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false) + public function __construct($token, $channel, $username = null, $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array()) { if (!extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler'); @@ -62,6 +63,7 @@ public function __construct($token, $channel, $username = 'Monolog', $useAttachm $iconEmoji, $useShortAttachment, $includeContextAndExtra, + $excludeFields, $this->formatter ); @@ -142,6 +144,17 @@ private function buildHeader($content) protected function write(array $record) { parent::write($record); + $this->finalizeWrite(); + } + + /** + * Finalizes the request by reading some bytes and then closing the socket + * + * If we do not read some but close the socket too early, slack sometimes + * drops the request entirely. + */ + protected function finalizeWrite() + { $res = $this->getResource(); if (is_resource($res)) { @fread($res, 2048); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php index a2df0f1..9a1bbb4 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php @@ -38,15 +38,16 @@ class SlackWebhookHandler extends AbstractProcessingHandler /** * @param string $webhookUrl Slack Webhook URL * @param string|null $channel Slack channel (encoded ID or name) - * @param string $username Name of a bot + * @param string|null $username Name of a bot * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) * @param string|null $iconEmoji The emoji name to use (or null) * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style * @param bool $includeContextAndExtra Whether the attachment should include context and extra data * @param int $level The minimum logging level at which this handler will be triggered * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] */ - public function __construct($webhookUrl, $channel = null, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true) + public function __construct($webhookUrl, $channel = null, $username = null, $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true, array $excludeFields = array()) { parent::__construct($level, $bubble); @@ -59,6 +60,7 @@ public function __construct($webhookUrl, $channel = null, $username = 'Monolog', $iconEmoji, $useShortAttachment, $includeContextAndExtra, + $excludeFields, $this->formatter ); } @@ -79,13 +81,18 @@ protected function write(array $record) $postString = json_encode($postData); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $this->webhookUrl); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $options = array( + CURLOPT_URL => $this->webhookUrl, + CURLOPT_POST => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HTTPHEADER => array('Content-type: application/json'), + CURLOPT_POSTFIELDS => $postString + ); if (defined('CURLOPT_SAFE_UPLOAD')) { - curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true); + $options[CURLOPT_SAFE_UPLOAD] = true; } - curl_setopt($ch, CURLOPT_POSTFIELDS, array('payload' => $postString)); + + curl_setopt_array($ch, $options); Curl\Util::execute($ch); } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php index aba1396..72f44a5 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php @@ -13,6 +13,7 @@ use Monolog\Logger; use Monolog\Formatter\LineFormatter; +use Swift; /** * SwiftMailerHandler uses Swift_Mailer to send the emails @@ -73,7 +74,11 @@ protected function buildMessage($content, array $records) } $message->setBody($content); - $message->setDate(time()); + if (version_compare(Swift::VERSION, '6.0.0', '>=')) { + $message->setDate(new \DateTimeImmutable()); + } else { + $message->setDate(time()); + } return $message; } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php index 74d946a..4718711 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php @@ -22,6 +22,7 @@ class SyslogUdpHandler extends AbstractSyslogHandler { protected $socket; + protected $ident; /** * @param string $host @@ -29,11 +30,14 @@ class SyslogUdpHandler extends AbstractSyslogHandler * @param mixed $facility * @param int $level The minimum logging level at which this handler will be triggered * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not + * @param string $ident Program name or tag for each log message. */ - public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true) + public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $ident = 'php') { parent::__construct($facility, $level, $bubble); + $this->ident = $ident; + $this->socket = new UdpSocket($host, $port ?: 514); } @@ -69,7 +73,24 @@ protected function makeCommonSyslogHeader($severity) { $priority = $severity + $this->facility; - return "<$priority>1 "; + if (!$pid = getmypid()) { + $pid = '-'; + } + + if (!$hostname = gethostname()) { + $hostname = '-'; + } + + return "<$priority>1 " . + $this->getDateTime() . " " . + $hostname . " " . + $this->ident . " " . + $pid . " - - "; + } + + protected function getDateTime() + { + return date(\DateTime::RFC3339); } /** diff --git a/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php index 2691630..2c07cae 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php @@ -55,7 +55,12 @@ public function __invoke(array $record) return $record; } - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + /* + * http://php.net/manual/en/function.debug-backtrace.php + * As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added. + * Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'. + */ + $trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS); // skip first since it's always the current method array_shift($trace); diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php index e6bd309..4a24761 100644 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php @@ -221,10 +221,34 @@ public function testFormatWithLargeData() } } - // in graylog2/gelf-php before 1.4.1 empty strings are filtered and won't be included in the message - // though it should be sufficient to ensure that the entire message length does not exceed the maximum - // length being allowed - $this->assertLessThanOrEqual(32766, $length, 'The message length is no longer than the maximum allowed length'); + $this->assertLessThanOrEqual(65792, $length, 'The message length is no longer than the maximum allowed length'); + } + + public function testFormatWithUnlimitedLength() + { + $formatter = new GelfMessageFormatter('LONG_SYSTEM_NAME', null, 'ctxt_', PHP_INT_MAX); + $record = array( + 'level' => Logger::ERROR, + 'level_name' => 'ERROR', + 'channel' => 'meh', + 'context' => array('exception' => str_repeat(' ', 32767 * 2)), + 'datetime' => new \DateTime("@0"), + 'extra' => array('key' => str_repeat(' ', 32767 * 2)), + 'message' => 'log' + ); + $message = $formatter->format($record); + $messageArray = $message->toArray(); + + // 200 for padding + metadata + $length = 200; + + foreach ($messageArray as $key => $value) { + if (!in_array($key, array('level', 'timestamp'))) { + $length += strlen($value); + } + } + + $this->assertGreaterThanOrEqual(131289, $length, 'The message should not be truncated'); } private function isLegacy() diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php index ef3cd1c..0449f8b 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php @@ -25,8 +25,13 @@ protected function setUp() $_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; Chrome/1.0'; } - public function testHeaders() + /** + * @dataProvider agentsProvider + */ + public function testHeaders($agent) { + $_SERVER['HTTP_USER_AGENT'] = $agent; + $handler = new TestChromePHPHandler(); $handler->setFormatter($this->getIdentityFormatter()); $handler->handle($this->getRecord(Logger::DEBUG)); @@ -47,6 +52,16 @@ public function testHeaders() $this->assertEquals($expected, $handler->getHeaders()); } + public static function agentsProvider() + { + return array( + array('Monolog Test; Chrome/1.0'), + array('Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'), + array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36'), + array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36'), + ); + } + public function testHeadersOverflow() { $handler = new TestChromePHPHandler(); diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php index f3a6968..2e6c348 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php @@ -52,13 +52,20 @@ public function testHandle() $handler = new DynamoDbHandler($this->client, 'foo'); $handler->setFormatter($formatter); + $isV3 = defined('Aws\Sdk::VERSION') && version_compare(\Aws\Sdk::VERSION, '3.0', '>='); + if ($isV3) { + $expFormatted = array('foo' => array('N' => 1), 'bar' => array('N' => 2)); + } else { + $expFormatted = $formatted; + } + $formatter ->expects($this->once()) ->method('format') ->with($record) ->will($this->returnValue($formatted)); $this->client - ->expects($this->once()) + ->expects($isV3 ? $this->never() : $this->once()) ->method('formatAttributes') ->with($this->isType('array')) ->will($this->returnValue($formatted)); @@ -67,7 +74,7 @@ public function testHandle() ->method('__call') ->with('putItem', array(array( 'TableName' => 'foo', - 'Item' => $formatted, + 'Item' => $expFormatted, ))); $handler->handle($record); diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php index 574077d..26d212b 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php @@ -92,11 +92,13 @@ public function testExtraParameters() $checksum = '098f6bcd4621d373cade4e832627b4f6'; $release = '05a671c66aefea124cc08b76ea6d30bb'; - $record = $this->getRecord(Logger::INFO, 'test', array('checksum' => $checksum, 'release' => $release)); + $eventId = '31423'; + $record = $this->getRecord(Logger::INFO, 'test', array('checksum' => $checksum, 'release' => $release, 'event_id' => $eventId)); $handler->handle($record); $this->assertEquals($checksum, $ravenClient->lastData['checksum']); $this->assertEquals($release, $ravenClient->lastData['release']); + $this->assertEquals($eventId, $ravenClient->lastData['event_id']); } public function testFingerprint() diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RollbarHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RollbarHandlerTest.php new file mode 100644 index 0000000..f302e91 --- /dev/null +++ b/vendor/monolog/monolog/tests/Monolog/Handler/RollbarHandlerTest.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Exception; +use Monolog\TestCase; +use Monolog\Logger; +use PHPUnit_Framework_MockObject_MockObject as MockObject; + +/** + * @author Erik Johansson + * @see https://rollbar.com/docs/notifier/rollbar-php/ + * + * @coversDefaultClass Monolog\Handler\RollbarHandler + */ +class RollbarHandlerTest extends TestCase +{ + /** + * @var MockObject + */ + private $rollbarNotifier; + + /** + * @var array + */ + public $reportedExceptionArguments = null; + + protected function setUp() + { + parent::setUp(); + + $this->setupRollbarNotifierMock(); + } + + /** + * When reporting exceptions to Rollbar the + * level has to be set in the payload data + */ + public function testExceptionLogLevel() + { + $handler = $this->createHandler(); + + $handler->handle($this->createExceptionRecord(Logger::DEBUG)); + + $this->assertEquals('debug', $this->reportedExceptionArguments['payload']['level']); + } + + private function setupRollbarNotifierMock() + { + $this->rollbarNotifier = $this->getMockBuilder('RollbarNotifier') + ->setMethods(array('report_message', 'report_exception', 'flush')) + ->getMock(); + + $that = $this; + + $this->rollbarNotifier + ->expects($this->any()) + ->method('report_exception') + ->willReturnCallback(function ($exception, $context, $payload) use ($that) { + $that->reportedExceptionArguments = compact('exception', 'context', 'payload'); + }); + } + + private function createHandler() + { + return new RollbarHandler($this->rollbarNotifier, Logger::DEBUG); + } + + private function createExceptionRecord($level = Logger::DEBUG, $message = 'test', $exception = null) + { + return $this->getRecord($level, $message, array( + 'exception' => $exception ?: new Exception() + )); + } +} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php index c510617..f1feb22 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php @@ -111,10 +111,10 @@ public function rotationTests() return $now + 86400 * $ago; }; $monthCallback = function($ago) { - return gmmktime(0, 0, 0, date('n') + $ago, date('d'), date('Y')); + return gmmktime(0, 0, 0, date('n') + $ago, 1, date('Y')); }; $yearCallback = function($ago) { - return gmmktime(0, 0, 0, date('n'), date('d'), date('Y') + $ago); + return gmmktime(0, 0, 0, 1, 1, date('Y') + $ago); }; return array( diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php index d6c6c22..e1aa96d 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php @@ -19,11 +19,11 @@ */ class SlackRecordTest extends TestCase { - private $channel; + private $jsonPrettyPrintFlag; protected function setUp() { - $this->channel = 'monolog_alerts'; + $this->jsonPrettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; } public function dataGetAttachmentColor() @@ -39,6 +39,7 @@ public function dataGetAttachmentColor() array(Logger::EMERGENCY, SlackRecord::COLOR_DANGER), ); } + /** * @dataProvider dataGetAttachmentColor * @param int $logLevel @@ -47,7 +48,7 @@ public function dataGetAttachmentColor() */ public function testGetAttachmentColor($logLevel, $expectedColour) { - $slackRecord = new SlackRecord('#test'); + $slackRecord = new SlackRecord(); $this->assertSame( $expectedColour, $slackRecord->getAttachmentColor($logLevel) @@ -56,26 +57,20 @@ public function testGetAttachmentColor($logLevel, $expectedColour) public function testAddsChannel() { - $record = new SlackRecord($this->channel); + $channel = '#test'; + $record = new SlackRecord($channel); $data = $record->getSlackData($this->getRecord()); $this->assertArrayHasKey('channel', $data); - $this->assertSame($this->channel, $data['channel']); + $this->assertSame($channel, $data['channel']); } - public function testStringifyReturnsNullWithNoLineFormatter() + public function testNoUsernameByDefault() { - $slackRecord = new SlackRecord('#test'); - $this->assertNull($slackRecord->stringify(array('foo' => 'bar'))); - } - - public function testAddsDefaultUsername() - { - $record = new SlackRecord($this->channel); + $record = new SlackRecord(); $data = $record->getSlackData($this->getRecord()); - $this->assertArrayHasKey('username', $data); - $this->assertSame('Monolog', $data['username']); + $this->assertArrayNotHasKey('username', $data); } /** @@ -83,17 +78,24 @@ public function testAddsDefaultUsername() */ public function dataStringify() { + $jsonPrettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; + + $multipleDimensions = array(array(1, 2)); + $numericKeys = array('library' => 'monolog'); + $singleDimension = array(1, 'Hello', 'Jordi'); + return array( - array(array(), ''), - array(array('foo' => 'bar'), 'foo: bar'), - array(array('Foo' => 'bAr'), 'Foo: bAr'), + array(array(), '[]'), + array($multipleDimensions, json_encode($multipleDimensions, $jsonPrettyPrintFlag)), + array($numericKeys, json_encode($numericKeys, $jsonPrettyPrintFlag)), + array($singleDimension, json_encode($singleDimension)) ); } /** * @dataProvider dataStringify */ - public function testStringifyWithLineFormatter($fields, $expectedResult) + public function testStringify($fields, $expectedResult) { $slackRecord = new SlackRecord( '#test', @@ -110,7 +112,7 @@ public function testStringifyWithLineFormatter($fields, $expectedResult) public function testAddsCustomUsername() { $username = 'Monolog bot'; - $record = new SlackRecord($this->channel, $username); + $record = new SlackRecord(null, $username); $data = $record->getSlackData($this->getRecord()); $this->assertArrayHasKey('username', $data); @@ -119,7 +121,7 @@ public function testAddsCustomUsername() public function testNoIcon() { - $record = new SlackRecord($this->channel); + $record = new SlackRecord(); $data = $record->getSlackData($this->getRecord()); $this->assertArrayNotHasKey('icon_emoji', $data); @@ -127,25 +129,22 @@ public function testNoIcon() public function testAddsIcon() { - $record = new SlackRecord($this->channel, 'Monolog', true, 'ghost'); - $data = $record->getSlackData($this->getRecord()); + $record = $this->getRecord(); + $slackRecord = new SlackRecord(null, null, false, 'ghost'); + $data = $slackRecord->getSlackData($record); + + $slackRecord2 = new SlackRecord(null, null, false, 'http://github.com/Seldaek/monolog'); + $data2 = $slackRecord2->getSlackData($record); $this->assertArrayHasKey('icon_emoji', $data); $this->assertSame(':ghost:', $data['icon_emoji']); - } - - public function testAddsEmptyTextIfUseAttachment() - { - $record = new SlackRecord($this->channel); - $data = $record->getSlackData($this->getRecord()); - - $this->assertArrayHasKey('text', $data); - $this->assertSame('', $data['text']); + $this->assertArrayHasKey('icon_url', $data2); + $this->assertSame('http://github.com/Seldaek/monolog', $data2['icon_url']); } public function testAttachmentsNotPresentIfNoAttachment() { - $record = new SlackRecord($this->channel, 'Monolog', false); + $record = new SlackRecord(null, null, false); $data = $record->getSlackData($this->getRecord()); $this->assertArrayNotHasKey('attachments', $data); @@ -153,7 +152,7 @@ public function testAttachmentsNotPresentIfNoAttachment() public function testAddsOneAttachment() { - $record = new SlackRecord($this->channel); + $record = new SlackRecord(); $data = $record->getSlackData($this->getRecord()); $this->assertArrayHasKey('attachments', $data); @@ -161,10 +160,10 @@ public function testAddsOneAttachment() $this->assertInternalType('array', $data['attachments'][0]); } - public function testTextEqualsMessageIfNoFormatter() + public function testTextEqualsMessageIfNoAttachment() { $message = 'Test message'; - $record = new SlackRecord($this->channel, 'Monolog', false); + $record = new SlackRecord(null, null, false); $data = $record->getSlackData($this->getRecord(Logger::WARNING, $message)); $this->assertArrayHasKey('text', $data); @@ -186,7 +185,7 @@ public function testTextEqualsFormatterOutput() ->will($this->returnCallback(function ($record) { return $record['message'] . 'test1'; })); $message = 'Test message'; - $record = new SlackRecord($this->channel, 'Monolog', false, null, false, false, $formatter); + $record = new SlackRecord(null, null, false, null, false, false, array(), $formatter); $data = $record->getSlackData($this->getRecord(Logger::WARNING, $message)); $this->assertArrayHasKey('text', $data); @@ -202,7 +201,7 @@ public function testTextEqualsFormatterOutput() public function testAddsFallbackAndTextToAttachment() { $message = 'Test message'; - $record = new SlackRecord($this->channel); + $record = new SlackRecord(null); $data = $record->getSlackData($this->getRecord(Logger::WARNING, $message)); $this->assertSame($message, $data['attachments'][0]['text']); @@ -211,7 +210,7 @@ public function testAddsFallbackAndTextToAttachment() public function testMapsLevelToColorAttachmentColor() { - $record = new SlackRecord($this->channel); + $record = new SlackRecord(null); $errorLoggerRecord = $this->getRecord(Logger::ERROR); $emergencyLoggerRecord = $this->getRecord(Logger::EMERGENCY); $warningLoggerRecord = $this->getRecord(Logger::WARNING); @@ -238,7 +237,7 @@ public function testAddsShortAttachmentWithoutContextAndExtra() { $level = Logger::ERROR; $levelName = Logger::getLevelName($level); - $record = new SlackRecord($this->channel, 'Monolog', true, null, true); + $record = new SlackRecord(null, null, true, null, true); $data = $record->getSlackData($this->getRecord($level, 'test', array('test' => 1))); $attachment = $data['attachments'][0]; @@ -252,9 +251,11 @@ public function testAddsShortAttachmentWithContextAndExtra() { $level = Logger::ERROR; $levelName = Logger::getLevelName($level); - $record = new SlackRecord($this->channel, 'Monolog', true, null, true, true); - $loggerRecord = $this->getRecord($level, 'test', array('test' => 1)); - $loggerRecord['extra'] = array('tags' => array('web')); + $context = array('test' => 1); + $extra = array('tags' => array('web')); + $record = new SlackRecord(null, null, true, null, true, true); + $loggerRecord = $this->getRecord($level, 'test', $context); + $loggerRecord['extra'] = $extra; $data = $record->getSlackData($loggerRecord); $attachment = $data['attachments'][0]; @@ -266,13 +267,13 @@ public function testAddsShortAttachmentWithContextAndExtra() array( array( 'title' => 'Extra', - 'value' => 'tags: ["web"]', - 'short' => true + 'value' => sprintf('```%s```', json_encode($extra, $this->jsonPrettyPrintFlag)), + 'short' => false ), array( 'title' => 'Context', - 'value' => 'test: 1', - 'short' => true + 'value' => sprintf('```%s```', json_encode($context, $this->jsonPrettyPrintFlag)), + 'short' => false ) ), $attachment['fields'] @@ -283,7 +284,7 @@ public function testAddsLongAttachmentWithoutContextAndExtra() { $level = Logger::ERROR; $levelName = Logger::getLevelName($level); - $record = new SlackRecord($this->channel, 'Monolog', true, null); + $record = new SlackRecord(null, null, true, null); $data = $record->getSlackData($this->getRecord($level, 'test', array('test' => 1))); $attachment = $data['attachments'][0]; @@ -295,7 +296,7 @@ public function testAddsLongAttachmentWithoutContextAndExtra() array(array( 'title' => 'Level', 'value' => $levelName, - 'short' => true + 'short' => false )), $attachment['fields'] ); @@ -305,25 +306,27 @@ public function testAddsLongAttachmentWithContextAndExtra() { $level = Logger::ERROR; $levelName = Logger::getLevelName($level); - $record = new SlackRecord($this->channel, 'Monolog', true, null, false, true); - $loggerRecord = $this->getRecord($level, 'test', array('test' => 1)); - $loggerRecord['extra'] = array('tags' => array('web')); + $context = array('test' => 1); + $extra = array('tags' => array('web')); + $record = new SlackRecord(null, null, true, null, false, true); + $loggerRecord = $this->getRecord($level, 'test', $context); + $loggerRecord['extra'] = $extra; $data = $record->getSlackData($loggerRecord); $expectedFields = array( array( 'title' => 'Level', 'value' => $levelName, - 'short' => true, + 'short' => false, ), array( 'title' => 'tags', - 'value' => '["web"]', + 'value' => sprintf('```%s```', json_encode($extra['tags'])), 'short' => false ), array( 'title' => 'test', - 'value' => 1, + 'value' => $context['test'], 'short' => false ) ); @@ -338,4 +341,47 @@ public function testAddsLongAttachmentWithContextAndExtra() $attachment['fields'] ); } + + public function testAddsTimestampToAttachment() + { + $record = $this->getRecord(); + $slackRecord = new SlackRecord(); + $data = $slackRecord->getSlackData($this->getRecord()); + + $attachment = $data['attachments'][0]; + $this->assertArrayHasKey('ts', $attachment); + $this->assertSame($record['datetime']->getTimestamp(), $attachment['ts']); + } + + public function testExcludeExtraAndContextFields() + { + $record = $this->getRecord( + Logger::WARNING, + 'test', + array('info' => array('library' => 'monolog', 'author' => 'Jordi')) + ); + $record['extra'] = array('tags' => array('web', 'cli')); + + $slackRecord = new SlackRecord(null, null, true, null, false, true, array('context.info.library', 'extra.tags.1')); + $data = $slackRecord->getSlackData($record); + $attachment = $data['attachments'][0]; + + $expected = array( + array( + 'title' => 'info', + 'value' => sprintf('```%s```', json_encode(array('author' => 'Jordi'), $this->jsonPrettyPrintFlag)), + 'short' => false + ), + array( + 'title' => 'tags', + 'value' => sprintf('```%s```', json_encode(array('web'))), + 'short' => false + ), + ); + + foreach ($expected as $field) { + $this->assertNotFalse(array_search($field, $attachment['fields'])); + break; + } + } } diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SlackWebhookHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SlackWebhookHandlerTest.php index cc9b7ba..c9229e2 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SlackWebhookHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/SlackWebhookHandlerTest.php @@ -32,11 +32,10 @@ class SlackWebhookHandlerTest extends TestCase public function testConstructorMinimal() { $handler = new SlackWebhookHandler(self::WEBHOOK_URL); + $record = $this->getRecord(); $slackRecord = $handler->getSlackRecord(); $this->assertInstanceOf('Monolog\Handler\Slack\SlackRecord', $slackRecord); $this->assertEquals(array( - 'username' => 'Monolog', - 'text' => '', 'attachments' => array( array( 'fallback' => 'test', @@ -46,13 +45,15 @@ public function testConstructorMinimal() array( 'title' => 'Level', 'value' => 'WARNING', - 'short' => true, + 'short' => false, ), ), 'title' => 'Message', + 'mrkdwn_in' => array('fields'), + 'ts' => $record['datetime']->getTimestamp(), ), ), - ), $slackRecord->getSlackData($this->getRecord())); + ), $slackRecord->getSlackData($record)); } /** diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php index 8588691..1d62940 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php @@ -98,7 +98,7 @@ public function testMessageSubjectFormatting() public function testMessageHaveUniqueId() { - $messageTemplate = \Swift_Message::newInstance(); + $messageTemplate = new \Swift_Message(); $handler = new SwiftMailerHandler($this->mailer, $messageTemplate); $method = new \ReflectionMethod('Monolog\Handler\SwiftMailerHandler', 'buildMessage'); diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php index aa4a334..7ee8a98 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php @@ -28,16 +28,27 @@ public function testWeValidateFacilities() public function testWeSplitIntoLines() { - $handler = new SyslogUdpHandler("127.0.0.1", 514, "authpriv"); + $time = '2014-01-07T12:34'; + $pid = getmypid(); + $host = gethostname(); + + $handler = $this->getMockBuilder('\Monolog\Handler\SyslogUdpHandler') + ->setConstructorArgs(array("127.0.0.1", 514, "authpriv")) + ->setMethods(array('getDateTime')) + ->getMock(); + + $handler->method('getDateTime') + ->willReturn($time); + $handler->setFormatter(new \Monolog\Formatter\ChromePHPFormatter()); $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('write'), array('lol', 'lol')); $socket->expects($this->at(0)) ->method('write') - ->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 "); + ->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 $time $host php $pid - - "); $socket->expects($this->at(1)) ->method('write') - ->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 "); + ->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 $time $host php $pid - - "); $handler->setSocket($socket);