diff --git a/src/Adyen/AdyenException.php b/src/Adyen/AdyenException.php index 3d793303e..35ddaa58c 100644 --- a/src/Adyen/AdyenException.php +++ b/src/Adyen/AdyenException.php @@ -9,12 +9,12 @@ class AdyenException extends Exception /** * @var null */ - protected $_status; + protected $status; /** * @var null */ - protected $_errorType; + protected $errorType; /** * AdyenException constructor. @@ -27,8 +27,8 @@ class AdyenException extends Exception */ public function __construct($message = "", $code = 0, Exception $previous = null, $status = null, $errorType = null) { - $this->_status = $status; - $this->_errorType = $errorType; + $this->status = $status; + $this->errorType = $errorType; parent::__construct($message, (int)$code, $previous); } @@ -39,7 +39,7 @@ public function __construct($message = "", $code = 0, Exception $previous = null */ public function getStatus() { - return $this->_status; + return $this->status; } /** @@ -47,6 +47,6 @@ public function getStatus() */ public function getErrorType() { - return $this->_errorType; + return $this->errorType; } } diff --git a/src/Adyen/ApiKeyAuthenticatedService.php b/src/Adyen/ApiKeyAuthenticatedService.php index 5a45f7c60..1608b464e 100644 --- a/src/Adyen/ApiKeyAuthenticatedService.php +++ b/src/Adyen/ApiKeyAuthenticatedService.php @@ -7,5 +7,5 @@ class ApiKeyAuthenticatedService extends Service /** * @var bool */ - protected $_requiresApiKey = true; + protected $requiresApiKey = true; } diff --git a/src/Adyen/Client.php b/src/Adyen/Client.php index f0feaee2f..dac4c9990 100644 --- a/src/Adyen/Client.php +++ b/src/Adyen/Client.php @@ -8,7 +8,7 @@ class Client { - const LIB_VERSION = "1.5.4"; + const LIB_VERSION = "1.6.0"; const LIB_NAME = "adyen-php-api-library"; const USER_AGENT_SUFFIX = "adyen-php-api-library/"; const ENDPOINT_TEST = "https://pal-test.adyen.com"; @@ -17,231 +17,247 @@ class Client const ENDPOINT_TEST_DIRECTORY_LOOKUP = "https://test.adyen.com/hpp/directory/v2.shtml"; const ENDPOINT_LIVE_DIRECTORY_LOOKUP = "https://live.adyen.com/hpp/directory/v2.shtml"; const API_PAYMENT_VERSION = "v40"; - const API_PAYOUT_VERSION = "v30"; + const API_PAYOUT_VERSION = "v30"; const API_RECURRING_VERSION = "v25"; const API_CHECKOUT_VERSION = "v40"; const API_CHECKOUT_UTILITY_VERSION = "v1"; + const API_NOTIFICATION_VERSION = "v1"; + const API_ACCOUNT_VERSION = "v4"; + const API_FUND_VERSION = "v3"; const ENDPOINT_TERMINAL_CLOUD_TEST = "https://terminal-api-test.adyen.com"; const ENDPOINT_TERMINAL_CLOUD_LIVE = "https://terminal-api-live.adyen.com"; const ENDPOINT_CHECKOUT_TEST = "https://checkout-test.adyen.com/checkout"; const ENDPOINT_CHECKOUT_LIVE_SUFFIX = "-checkout-live.adyenpayments.com/checkout"; const ENDPOINT_PROTOCOL = "https://"; + const ENDPOINT_NOTIFICATION_TEST = "https://cal-test.adyen.com/cal/services/Notification"; + const ENDPOINT_NOTIFICATION_LIVE = "https://cal-live.adyen.com/cal/services/Notification"; + const ENDPOINT_ACCOUNT_TEST = "https://cal-test.adyen.com/cal/services/Account"; + const ENDPOINT_ACCOUNT_LIVE = "https://cal-live.adyen.com/cal/services/Account"; + const ENDPOINT_FUND_TEST = "https://cal-test.adyen.com/cal/services/Fund"; + const ENDPOINT_FUND_LIVE = "https://cal-live.adyen.com/cal/services/Fund"; - /** - * @var \Adyen\Config $config - */ - private $_config; - - /** - * @var - */ - private $_httpClient; - - /** - * @var Logger $logger - */ - private $logger; - - /** - * Client constructor. - * - * @param null $config - * @throws AdyenException - */ - public function __construct($config = null) - { - if (!$config) { - // create config - $this->_config = new \Adyen\Config(); - } elseif ($config instanceof \Adyen\ConfigInterface) { - $this->_config = $config; - } else { - throw new \Adyen\AdyenException("This config object is not supported, you need to implement the ConfigInterface"); - } - } - - /** - * @return Config|ConfigInterface|null - */ - public function getConfig() - { - return $this->_config; - } - - /** - * Set Username of Web Service User - * - * @param $username - */ - public function setUsername($username) - { - $this->_config->set('username', $username); - } - - /** - * Set Password of Web Service User - * - * @param $password - */ - public function setPassword($password) - { - $this->_config->set('password', $password); - } - - /** - * Set x-api-key for Web Service Client - * - * @param $xapikey - */ - public function setXApiKey($xApiKey) - { - $this->_config->set('x-api-key', $xApiKey); - } - - /** - * Set environment to connect to test or live platform of Adyen - * For live please specify the unique identifier. - * - * @param string $environment - * @param null $liveEndpointUrlPrefix Provide the unique live url prefix from the "API URLs and Response" menu in the Adyen Customer Area - * @throws AdyenException - */ - public function setEnvironment($environment, $liveEndpointUrlPrefix = null) - { - if ($environment == \Adyen\Environment::TEST) { - $this->_config->set('environment', \Adyen\Environment::TEST); - $this->_config->set('endpoint', self::ENDPOINT_TEST); - $this->_config->set('endpointDirectorylookup', self::ENDPOINT_TEST_DIRECTORY_LOOKUP); - $this->_config->set('endpointTerminalCloud', self::ENDPOINT_TERMINAL_CLOUD_TEST); - $this->_config->set('endpointCheckout', self::ENDPOINT_CHECKOUT_TEST); - } elseif ($environment == \Adyen\Environment::LIVE) { - $this->_config->set('environment', \Adyen\Environment::LIVE); - $this->_config->set('endpointDirectorylookup', self::ENDPOINT_LIVE_DIRECTORY_LOOKUP); - $this->_config->set('endpointTerminalCloud', self::ENDPOINT_TERMINAL_CLOUD_LIVE); - - if ($liveEndpointUrlPrefix) { - $this->_config->set('endpoint', - self::ENDPOINT_PROTOCOL . $liveEndpointUrlPrefix . self::ENDPOINT_LIVE_SUFFIX); - $this->_config->set('endpointCheckout', - self::ENDPOINT_PROTOCOL . $liveEndpointUrlPrefix . self::ENDPOINT_CHECKOUT_LIVE_SUFFIX); - } else { - $this->_config->set('endpoint', self::ENDPOINT_LIVE); - $this->_config->set('endpointCheckout', null); // not supported please specify unique identifier - } - } else { - // environment does not exist - $msg = "This environment does not exist, use " . \Adyen\Environment::TEST . ' or ' . \Adyen\Environment::LIVE; - throw new \Adyen\AdyenException($msg); - } - } - - /** - * Set Request URl - * - * @param $url - */ - public function setRequestUrl($url) - { - $this->_config->set('endpoint', $url); - } - - /** - * Set directory lookup URL - * - * @param $url - */ - public function setDirectoryLookupUrl($url) - { - $this->_config->set('endpointDirectorylookup', $url); - } - - /** - * @param $merchantAccount - */ - public function setMerchantAccount($merchantAccount) - { - $this->_config->set('merchantAccount', $merchantAccount); - } - - /** - * @param $applicationName - */ - public function setApplicationName($applicationName) - { - $this->_config->set('applicationName', $applicationName); - } - - /** - * Set external platform name, version and integrator - * - * @param string $name - * @param string $version - * @param string $integrator - */ - public function setExternalPlatform($name, $version, $integrator = "") - { - $this->_config->set('externalPlatform', - array('name' => $name, 'version' => $version, 'integrator' => $integrator)); - } - - /** - * Set Adyen payment source name and version - * - * @param string $name - * @param string $version - */ - public function setAdyenPaymentSource($name, $version) - { - $this->_config->set('adyenPaymentSource', array('name' => $name, 'version' => $version)); - } - - /** - * Type can be json or array - * - * @param $value - */ - public function setInputType($value) - { - $this->_config->set('inputType', $value); - } - - /** - * Type can be json or array - * - * @param $value - */ - public function setOutputType($value) - { - $this->_config->set('outputType', $value); - } - - /** - * @param $value - */ - public function setTimeout($value) - { - $this->_config->set('timeout', $value); - } - - /** - * Get the library name - * - * @return string - */ - public function getLibraryName() - { - return self::LIB_NAME; - } - - /** - * Get the library version - * - * @return string - */ - public function getLibraryVersion() - { - return self::LIB_VERSION; - } + + /** + * @var \Adyen\Config $config + */ + private $config; + + /** + * @var + */ + private $httpClient; + + /** + * @var Logger $logger + */ + private $logger; + + /** + * Client constructor. + * + * @param null $config + * @throws AdyenException + */ + public function __construct($config = null) + { + if (!$config) { + // create config + $this->config = new \Adyen\Config(); + } elseif ($config instanceof \Adyen\ConfigInterface) { + $this->config = $config; + } else { + throw new \Adyen\AdyenException("This config object is not supported, you need to implement the ConfigInterface"); + } + } + + /** + * @return Config|ConfigInterface|null + */ + public function getConfig() + { + return $this->config; + } + + /** + * Set Username of Web Service User + * + * @param $username + */ + public function setUsername($username) + { + $this->config->set('username', $username); + } + + /** + * Set Password of Web Service User + * + * @param $password + */ + public function setPassword($password) + { + $this->config->set('password', $password); + } + + /** + * Set x-api-key for Web Service Client + * + * @param $xApiKey + */ + public function setXApiKey($xApiKey) + { + $this->config->set('x-api-key', $xApiKey); + } + + /** + * Set environment to connect to test or live platform of Adyen + * For live please specify the unique identifier. + * + * @param string $environment + * @param null $liveEndpointUrlPrefix Provide the unique live url prefix from the "API URLs and Response" menu in the Adyen Customer Area + * @throws AdyenException + */ + public function setEnvironment($environment, $liveEndpointUrlPrefix = null) + { + if ($environment == \Adyen\Environment::TEST) { + $this->config->set('environment', \Adyen\Environment::TEST); + $this->config->set('endpoint', self::ENDPOINT_TEST); + $this->config->set('endpointDirectorylookup', self::ENDPOINT_TEST_DIRECTORY_LOOKUP); + $this->config->set('endpointTerminalCloud', self::ENDPOINT_TERMINAL_CLOUD_TEST); + $this->config->set('endpointCheckout', self::ENDPOINT_CHECKOUT_TEST); + $this->config->set('endpointNotification', self::ENDPOINT_NOTIFICATION_TEST); + $this->config->set('endpointAccount', self::ENDPOINT_ACCOUNT_TEST); + $this->config->set('endpointFund', self::ENDPOINT_FUND_TEST); + } elseif ($environment == \Adyen\Environment::LIVE) { + $this->config->set('environment', \Adyen\Environment::LIVE); + $this->config->set('endpointDirectorylookup', self::ENDPOINT_LIVE_DIRECTORY_LOOKUP); + $this->config->set('endpointTerminalCloud', self::ENDPOINT_TERMINAL_CLOUD_LIVE); + $this->config->set('endpointNotification', self::ENDPOINT_NOTIFICATION_LIVE); + $this->config->set('endpointAccount', self::ENDPOINT_ACCOUNT_LIVE); + $this->config->set('endpointFund', self::ENDPOINT_FUND_LIVE); + + if ($liveEndpointUrlPrefix) { + $this->config->set('endpoint', + self::ENDPOINT_PROTOCOL . $liveEndpointUrlPrefix . self::ENDPOINT_LIVE_SUFFIX); + $this->config->set('endpointCheckout', + self::ENDPOINT_PROTOCOL . $liveEndpointUrlPrefix . self::ENDPOINT_CHECKOUT_LIVE_SUFFIX); + } else { + $this->config->set('endpoint', self::ENDPOINT_LIVE); + $this->config->set('endpointCheckout', null); // not supported please specify unique identifier + } + } else { + // environment does not exist + $msg = "This environment does not exist, use " . \Adyen\Environment::TEST . ' or ' . \Adyen\Environment::LIVE; + throw new \Adyen\AdyenException($msg); + } + } + + /** + * Set Request URl + * + * @param $url + */ + public function setRequestUrl($url) + { + $this->config->set('endpoint', $url); + } + + /** + * Set directory lookup URL + * + * @param $url + */ + public function setDirectoryLookupUrl($url) + { + $this->config->set('endpointDirectorylookup', $url); + } + + /** + * @param $merchantAccount + */ + public function setMerchantAccount($merchantAccount) + { + $this->config->set('merchantAccount', $merchantAccount); + } + + /** + * @param $applicationName + */ + public function setApplicationName($applicationName) + { + $this->config->set('applicationName', $applicationName); + } + + /** + * Set external platform name, version and integrator + * + * @param string $name + * @param string $version + * @param string $integrator + */ + public function setExternalPlatform($name, $version, $integrator = "") + { + $this->config->set('externalPlatform', + array('name' => $name, 'version' => $version, 'integrator' => $integrator)); + } + + /** + * Set Adyen payment source name and version + * + * @param string $name + * @param string $version + */ + public function setAdyenPaymentSource($name, $version) + { + $this->config->set('adyenPaymentSource', array('name' => $name, 'version' => $version)); + } + + /** + * Type can be json or array + * + * @param $value + */ + public function setInputType($value) + { + $this->config->set('inputType', $value); + } + + /** + * Type can be json or array + * + * @param $value + */ + public function setOutputType($value) + { + $this->config->set('outputType', $value); + } + + /** + * @param $value + */ + public function setTimeout($value) + { + $this->config->set('timeout', $value); + } + + /** + * Get the library name + * + * @return string + */ + public function getLibraryName() + { + return self::LIB_NAME; + } + + /** + * Get the library version + * + * @return string + */ + public function getLibraryVersion() + { + return self::LIB_VERSION; + } /** * Get the version of the API Payment endpoint @@ -253,104 +269,135 @@ public function getApiPaymentVersion() return self::API_PAYMENT_VERSION; } - /** - * Get the version of the API Payout endpoint - * - * @return string - */ - public function getApiPayoutVersion() - { - return self::API_PAYOUT_VERSION; - } - - /** - * Get the version of the Recurring API endpoint - * - * @return string - */ - public function getApiRecurringVersion() - { - return self::API_RECURRING_VERSION; - } - - /** - * Get the version of the Checkout API endpoint - * - * @return string - */ - public function getApiCheckoutVersion() - { - return self::API_CHECKOUT_VERSION; - } - - /** - * Get the version of the Checkout Utility API endpoint - * - * @return string - */ - public function getApiCheckoutUtilityVersion() - { - return self::API_CHECKOUT_UTILITY_VERSION; - } - - /** - * @param HttpClient\ClientInterface $httpClient - */ - public function setHttpClient(\Adyen\HttpClient\ClientInterface $httpClient) - { - $this->_httpClient = $httpClient; - } - - /** - * @return mixed - */ - public function getHttpClient() - { - if (is_null($this->_httpClient)) { - $this->_httpClient = $this->_createDefaultHttpClient(); - } - return $this->_httpClient; - } - - /** - * @return HttpClient\CurlClient - */ - protected function _createDefaultHttpClient() - { - return new \Adyen\HttpClient\CurlClient(); - } - - /** - * Set the Logger object - * - * @param \Psr\Log\LoggerInterface $logger - */ - public function setLogger(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * @return \Psr\Log\LoggerInterface implementation - */ - public function getLogger() - { - if (!isset($this->logger)) { - $this->logger = $this->createDefaultLogger(); - } - - return $this->logger; - } - - /** - * @return Logger - * @throws \Exception - */ - protected function createDefaultLogger() - { - $logger = new Logger('adyen-php-api-library'); - $logger->pushHandler(new StreamHandler('php://stderr', Logger::NOTICE)); - - return $logger; - } + /** + * Get the version of the API Payout endpoint + * + * @return string + */ + public function getApiPayoutVersion() + { + return self::API_PAYOUT_VERSION; + } + + /** + * Get the version of the Recurring API endpoint + * + * @return string + */ + public function getApiRecurringVersion() + { + return self::API_RECURRING_VERSION; + } + + /** + * Get the version of the Checkout API endpoint + * + * @return string + */ + public function getApiCheckoutVersion() + { + return self::API_CHECKOUT_VERSION; + } + + /** + * Get the version of the Checkout Utility API endpoint + * + * @return string + */ + public function getApiCheckoutUtilityVersion() + { + return self::API_CHECKOUT_UTILITY_VERSION; + } + + /** + * Get the version of the Notification API endpoint + * + * @return string + */ + public function getApiNotificationVersion() + { + return self::API_NOTIFICATION_VERSION; + } + + /** + * Get the version of the Account API endpoint + * + * @return string + */ + public function getApiAccountVersion() + { + return self::API_ACCOUNT_VERSION; + } + + /** + * Get the version of the Fund API endpoint + * + * @return string + */ + public function getApiFundVersion() + { + return self::API_FUND_VERSION; + } + + /** + * @param HttpClient\ClientInterface $httpClient + */ + public function setHttpClient(\Adyen\HttpClient\ClientInterface $httpClient) + { + $this->httpClient = $httpClient; + } + + /** + * @return mixed + */ + public function getHttpClient() + { + if (is_null($this->httpClient)) { + $this->httpClient = $this->createDefaultHttpClient(); + } + return $this->httpClient; + } + + /** + * @return HttpClient\CurlClient + */ + protected function createDefaultHttpClient() + { + return new \Adyen\HttpClient\CurlClient(); + } + + /** + * Set the Logger object + * + * @param \Psr\Log\LoggerInterface $logger + */ + public function setLogger(LoggerInterface $logger) + { + $this->logger = $logger; + } + + /** + * @return Logger + * @throws \Exception + */ + public function getLogger() + { + if (!isset($this->logger)) { + $this->logger = $this->createDefaultLogger(); + } + + return $this->logger; + } + + /** + * @return Logger + * @throws \Exception + */ + protected function createDefaultLogger() + { + $logger = new Logger('adyen-php-api-library'); + $logger->pushHandler(new StreamHandler('php://stderr', Logger::NOTICE)); + + return $logger; + } } diff --git a/src/Adyen/Service.php b/src/Adyen/Service.php index cfe030032..d2263c73e 100644 --- a/src/Adyen/Service.php +++ b/src/Adyen/Service.php @@ -12,7 +12,7 @@ class Service /** * @var bool */ - protected $_requiresApiKey = false; + protected $requiresApiKey = false; /** * Service constructor. @@ -47,6 +47,6 @@ public function getClient() */ public function requiresApiKey() { - return $this->_requiresApiKey; + return $this->requiresApiKey; } } diff --git a/src/Adyen/Service/AbstractResource.php b/src/Adyen/Service/AbstractResource.php index 6bc9f1b06..67fe5b80b 100644 --- a/src/Adyen/Service/AbstractResource.php +++ b/src/Adyen/Service/AbstractResource.php @@ -7,12 +7,12 @@ abstract class AbstractResource /** * @var \Adyen\Service */ - protected $_service; + protected $service; /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * @var bool @@ -28,8 +28,8 @@ abstract class AbstractResource */ public function __construct(\Adyen\Service $service, $endpoint, $allowApplicationInfo = false) { - $this->_service = $service; - $this->_endpoint = $endpoint; + $this->service = $service; + $this->endpoint = $endpoint; $this->allowApplicationInfo = $allowApplicationInfo; } @@ -43,18 +43,18 @@ public function __construct(\Adyen\Service $service, $endpoint, $allowApplicatio public function request($params) { // convert to PHP Array if type is inputType is json - if ($this->_service->getClient()->getConfig()->getInputType() == 'json') { + if ($this->service->getClient()->getConfig()->getInputType() == 'json') { $params = json_decode($params, true); if ($params === null && json_last_error() !== JSON_ERROR_NONE) { $msg = 'The parameters in the request expect valid JSON but JSON error code found: ' . json_last_error(); - $this->_service->getClient()->getLogger()->error($msg); + $this->service->getClient()->getLogger()->error($msg); throw new \Adyen\AdyenException($msg); } } if (!is_array($params)) { $msg = 'The parameter is not valid array'; - $this->_service->getClient()->getLogger()->error($msg); + $this->service->getClient()->getLogger()->error($msg); throw new \Adyen\AdyenException($msg); } @@ -62,8 +62,8 @@ public function request($params) $params = $this->handleApplicationInfoInRequest($params); - $curlClient = $this->_service->getClient()->getHttpClient(); - return $curlClient->requestJson($this->_service, $this->_endpoint, $params); + $curlClient = $this->service->getClient()->getHttpClient(); + return $curlClient->requestJson($this->service, $this->endpoint, $params); } /** @@ -76,12 +76,12 @@ public function requestPost($params) // check if paramenters has a value if (!$params) { $msg = 'The parameters in the request are empty'; - $this->_service->getClient()->getLogger()->error($msg); + $this->service->getClient()->getLogger()->error($msg); throw new \Adyen\AdyenException($msg); } - $curlClient = $this->_service->getClient()->getHttpClient(); - return $curlClient->requestPost($this->_service, $this->_endpoint, $params); + $curlClient = $this->service->getClient()->getHttpClient(); + return $curlClient->requestPost($this->service, $this->endpoint, $params); } /** @@ -93,8 +93,8 @@ public function requestPost($params) private function addDefaultParametersToRequest($params) { // check if merchantAccount is setup in client and request is missing merchantAccount then add it - if (!isset($params['merchantAccount']) && $this->_service->getClient()->getConfig()->getMerchantAccount()) { - $params['merchantAccount'] = $this->_service->getClient()->getConfig()->getMerchantAccount(); + if (!isset($params['merchantAccount']) && $this->service->getClient()->getConfig()->getMerchantAccount()) { + $params['merchantAccount'] = $this->service->getClient()->getConfig()->getMerchantAccount(); } return $params; @@ -112,15 +112,15 @@ private function handleApplicationInfoInRequest($params) // Only add if allowed if ($this->allowApplicationInfo) { // add/overwrite applicationInfo adyenLibrary even if it's already set - $params['applicationInfo']['adyenLibrary']['name'] = $this->_service->getClient()->getLibraryName(); - $params['applicationInfo']['adyenLibrary']['version'] = $this->_service->getClient()->getLibraryVersion(); + $params['applicationInfo']['adyenLibrary']['name'] = $this->service->getClient()->getLibraryName(); + $params['applicationInfo']['adyenLibrary']['version'] = $this->service->getClient()->getLibraryVersion(); - if ($adyenPaymentSource = $this->_service->getClient()->getConfig()->getAdyenPaymentSource()) { + if ($adyenPaymentSource = $this->service->getClient()->getConfig()->getAdyenPaymentSource()) { $params['applicationInfo']['adyenPaymentSource']['version'] = $adyenPaymentSource['version']; $params['applicationInfo']['adyenPaymentSource']['name'] = $adyenPaymentSource['name']; } - if ($externalPlatform = $this->_service->getClient()->getConfig()->getExternalPlatform()) { + if ($externalPlatform = $this->service->getClient()->getConfig()->getExternalPlatform()) { $params['applicationInfo']['externalPlatform']['version'] = $externalPlatform['version']; $params['applicationInfo']['externalPlatform']['name'] = $externalPlatform['name']; diff --git a/src/Adyen/Service/Account.php b/src/Adyen/Service/Account.php new file mode 100755 index 000000000..c5d4faef6 --- /dev/null +++ b/src/Adyen/Service/Account.php @@ -0,0 +1,242 @@ +createAccount = new \Adyen\Service\ResourceModel\Account\CreateAccount($this); + $this->createAccountHolder = new \Adyen\Service\ResourceModel\Account\CreateAccountHolder($this); + $this->updateAccountHolder = new \Adyen\Service\ResourceModel\Account\UpdateAccountHolder($this); + $this->getAccountHolder = new \Adyen\Service\ResourceModel\Account\GetAccountHolder($this); + $this->updateAccount = new \Adyen\Service\ResourceModel\Account\UpdateAccount($this); + $this->uploadDocument = new \Adyen\Service\ResourceModel\Account\UploadDocument($this); + $this->getUploadedDocuments = new \Adyen\Service\ResourceModel\Account\GetUploadedDocuments($this); + $this->updateAccountHolderState = new \Adyen\Service\ResourceModel\Account\UpdateAccountHolderState($this); + $this->deleteBankAccounts = new \Adyen\Service\ResourceModel\Account\DeleteBankAccounts($this); + $this->deleteShareholders = new \Adyen\Service\ResourceModel\Account\DeleteShareholders($this); + $this->closeAccount = new \Adyen\Service\ResourceModel\Account\CloseAccount($this); + $this->closeAccountHolder = new \Adyen\Service\ResourceModel\Account\CloseAccountHolder($this); + $this->suspendAccountHolder = new \Adyen\Service\ResourceModel\Account\SuspendAccountHolder($this); + $this->unSuspendAccountHolder = new \Adyen\Service\ResourceModel\Account\UnSuspendAccountHolder($this); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function createAccount($params) + { + return $this->createAccount->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function createAccountHolder($params) + { + return $this->createAccountHolder->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function updateAccountHolder($params) + { + return $this->updateAccountHolder->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function getAccountHolder($params) + { + return $this->getAccountHolder->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function updateAccount($params) + { + return $this->updateAccount->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function uploadDocument($params) + { + return $this->uploadDocument->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function getUploadedDocuments($params) + { + return $this->getUploadedDocuments->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function updateAccountHolderState($params) + { + return $this->updateAccountHolderState->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function deleteBankAccounts($params) + { + return $this->deleteBankAccounts->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function deleteShareholders($params) + { + return $this->deleteShareholders->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function closeAccount($params) + { + return $this->closeAccount->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function closeAccountHolder($params) + { + return $this->closeAccountHolder->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function suspendAccountHolder($params) + { + return $this->suspendAccountHolder->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function unSuspendAccountHolder($params) + { + return $this->unSuspendAccountHolder->request($params); + } +} diff --git a/src/Adyen/Service/Checkout.php b/src/Adyen/Service/Checkout.php index 884d0692c..a8cb0a271 100644 --- a/src/Adyen/Service/Checkout.php +++ b/src/Adyen/Service/Checkout.php @@ -7,27 +7,27 @@ class Checkout extends \Adyen\ApiKeyAuthenticatedService /** * @var ResourceModel\Checkout\PaymentSession */ - protected $_paymentSession; + protected $paymentSession; /** * @var ResourceModel\Checkout\PaymentsResult */ - protected $_paymentsResult; + protected $paymentsResult; /** * @var ResourceModel\Checkout\PaymentMethods */ - protected $_paymentMethods; + protected $paymentMethods; /** * @var ResourceModel\Checkout\Payments */ - protected $_payments; + protected $payments; /** * @var ResourceModel\Checkout\PaymentsDetails */ - protected $_paymentsDetails; + protected $paymentsDetails; /** * Checkout constructor. @@ -38,11 +38,11 @@ class Checkout extends \Adyen\ApiKeyAuthenticatedService public function __construct(\Adyen\Client $client) { parent::__construct($client); - $this->_paymentSession = new \Adyen\Service\ResourceModel\Checkout\PaymentSession($this); - $this->_paymentsResult = new \Adyen\Service\ResourceModel\Checkout\PaymentsResult($this); - $this->_paymentMethods = new \Adyen\Service\ResourceModel\Checkout\PaymentMethods($this); - $this->_payments = new \Adyen\Service\ResourceModel\Checkout\Payments($this); - $this->_paymentsDetails = new \Adyen\Service\ResourceModel\Checkout\PaymentsDetails($this); + $this->paymentSession = new \Adyen\Service\ResourceModel\Checkout\PaymentSession($this); + $this->paymentsResult = new \Adyen\Service\ResourceModel\Checkout\PaymentsResult($this); + $this->paymentMethods = new \Adyen\Service\ResourceModel\Checkout\PaymentMethods($this); + $this->payments = new \Adyen\Service\ResourceModel\Checkout\Payments($this); + $this->paymentsDetails = new \Adyen\Service\ResourceModel\Checkout\PaymentsDetails($this); } /** @@ -52,7 +52,7 @@ public function __construct(\Adyen\Client $client) */ public function paymentSession($params) { - $result = $this->_paymentSession->request($params); + $result = $this->paymentSession->request($params); return $result; } @@ -63,7 +63,7 @@ public function paymentSession($params) */ public function paymentsResult($params) { - $result = $this->_paymentsResult->request($params); + $result = $this->paymentsResult->request($params); return $result; } @@ -74,7 +74,7 @@ public function paymentsResult($params) */ public function paymentMethods($params) { - $result = $this->_paymentMethods->request($params); + $result = $this->paymentMethods->request($params); return $result; } @@ -85,7 +85,7 @@ public function paymentMethods($params) */ public function payments($params) { - $result = $this->_payments->request($params); + $result = $this->payments->request($params); return $result; } @@ -96,7 +96,7 @@ public function payments($params) */ public function paymentsDetails($params) { - $result = $this->_paymentsDetails->request($params); + $result = $this->paymentsDetails->request($params); return $result; } } diff --git a/src/Adyen/Service/CheckoutUtility.php b/src/Adyen/Service/CheckoutUtility.php index d30e7856c..42469b3b5 100644 --- a/src/Adyen/Service/CheckoutUtility.php +++ b/src/Adyen/Service/CheckoutUtility.php @@ -7,7 +7,7 @@ class CheckoutUtility extends \Adyen\ApiKeyAuthenticatedService /** * @var ResourceModel\CheckoutUtility\OriginKeys */ - protected $_originKeys; + protected $originKeys; /** * CheckoutUtility constructor. @@ -18,7 +18,7 @@ class CheckoutUtility extends \Adyen\ApiKeyAuthenticatedService public function __construct(\Adyen\Client $client) { parent::__construct($client); - $this->_originKeys = new \Adyen\Service\ResourceModel\CheckoutUtility\OriginKeys($this); + $this->originKeys = new \Adyen\Service\ResourceModel\CheckoutUtility\OriginKeys($this); } /** @@ -28,7 +28,7 @@ public function __construct(\Adyen\Client $client) */ public function originKeys($params) { - $result = $this->_originKeys->request($params); + $result = $this->originKeys->request($params); return $result; } } diff --git a/src/Adyen/Service/DirectoryLookup.php b/src/Adyen/Service/DirectoryLookup.php index 8429f951b..f3fd897d0 100644 --- a/src/Adyen/Service/DirectoryLookup.php +++ b/src/Adyen/Service/DirectoryLookup.php @@ -7,7 +7,7 @@ class DirectoryLookup extends \Adyen\Service /** * @var ResourceModel\DirectoryLookup\Directory */ - protected $_directoryLookup; + protected $directoryLookup; /** * DirectoryLookup constructor. @@ -18,7 +18,7 @@ class DirectoryLookup extends \Adyen\Service public function __construct(\Adyen\Client $client) { parent::__construct($client); - $this->_directoryLookup = new \Adyen\Service\ResourceModel\DirectoryLookup\Directory($this); + $this->directoryLookup = new \Adyen\Service\ResourceModel\DirectoryLookup\Directory($this); } /** @@ -28,7 +28,7 @@ public function __construct(\Adyen\Client $client) */ public function directoryLookup($params) { - $result = $this->_directoryLookup->requestPost($params); + $result = $this->directoryLookup->requestPost($params); return $result; } } diff --git a/src/Adyen/Service/Fund.php b/src/Adyen/Service/Fund.php new file mode 100755 index 000000000..6c5dd0793 --- /dev/null +++ b/src/Adyen/Service/Fund.php @@ -0,0 +1,115 @@ +payoutAccountHolder = new \Adyen\Service\ResourceModel\Fund\PayoutAccountHolder($this); + $this->accountHolderBalance = new \Adyen\Service\ResourceModel\Fund\AccountHolderBalance($this); + $this->accountHolderTransactionList = new \Adyen\Service\ResourceModel\Fund\AccountHolderTransactionList($this); + $this->refundNotPaidOutTransfers = new \Adyen\Service\ResourceModel\Fund\RefundNotPaidOutTransfers($this); + $this->setupBeneficiary = new \Adyen\Service\ResourceModel\Fund\SetupBeneficiary($this); + $this->transferFunds = new \Adyen\Service\ResourceModel\Fund\TransferFunds($this); + + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function payoutAccountHolder($params) + { + return $this->payoutAccountHolder->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function accountHolderBalance($params) + { + return $this->accountHolderBalance->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function accountHolderTransactionList($params) + { + return $this->accountHolderTransactionList->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function refundNotPaidOutTransfers($params) + { + return $this->refundNotPaidOutTransfers->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function setupBeneficiary($params) + { + return $this->setupBeneficiary->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function transferFunds($params) + { + return $this->transferFunds->request($params); + } +} diff --git a/src/Adyen/Service/Modification.php b/src/Adyen/Service/Modification.php index f79ced28c..3d024669a 100644 --- a/src/Adyen/Service/Modification.php +++ b/src/Adyen/Service/Modification.php @@ -7,27 +7,27 @@ class Modification extends \Adyen\Service /** * @var ResourceModel\Modification\Cancel */ - protected $_cancel; + protected $cancel; /** * @var ResourceModel\Modification\CancelOrRefund */ - protected $_cancelOrRefund; + protected $cancelOrRefund; /** * @var ResourceModel\Modification\Capture */ - protected $_capture; + protected $capture; /** * @var ResourceModel\Modification\Refund */ - protected $_refund; + protected $refund; /** * @var ResourceModel\Modification\AdjustAuthorisation */ - protected $_adjustAuthorisation; + protected $adjustAuthorisation; /** * Modification constructor. @@ -38,11 +38,11 @@ class Modification extends \Adyen\Service public function __construct(\Adyen\Client $client) { parent::__construct($client); - $this->_cancel = new \Adyen\Service\ResourceModel\Modification\Cancel($this); - $this->_cancelOrRefund = new \Adyen\Service\ResourceModel\Modification\CancelOrRefund($this); - $this->_capture = new \Adyen\Service\ResourceModel\Modification\Capture($this); - $this->_refund = new \Adyen\Service\ResourceModel\Modification\Refund($this); - $this->_adjustAuthorisation = new \Adyen\Service\ResourceModel\Modification\AdjustAuthorisation($this); + $this->cancel = new \Adyen\Service\ResourceModel\Modification\Cancel($this); + $this->cancelOrRefund = new \Adyen\Service\ResourceModel\Modification\CancelOrRefund($this); + $this->capture = new \Adyen\Service\ResourceModel\Modification\Capture($this); + $this->refund = new \Adyen\Service\ResourceModel\Modification\Refund($this); + $this->adjustAuthorisation = new \Adyen\Service\ResourceModel\Modification\AdjustAuthorisation($this); } /** @@ -52,7 +52,7 @@ public function __construct(\Adyen\Client $client) */ public function cancel($params) { - $result = $this->_cancel->request($params); + $result = $this->cancel->request($params); return $result; } @@ -63,7 +63,7 @@ public function cancel($params) */ public function cancelOrRefund($params) { - $result = $this->_cancelOrRefund->request($params); + $result = $this->cancelOrRefund->request($params); return $result; } @@ -74,7 +74,7 @@ public function cancelOrRefund($params) */ public function capture($params) { - $result = $this->_capture->request($params); + $result = $this->capture->request($params); return $result; } @@ -85,7 +85,7 @@ public function capture($params) */ public function refund($params) { - $result = $this->_refund->request($params); + $result = $this->refund->request($params); return $result; } @@ -96,7 +96,7 @@ public function refund($params) */ public function adjustAuthorisation($params) { - $result = $this->_adjustAuthorisation->request($params); + $result = $this->adjustAuthorisation->request($params); return $result; } } diff --git a/src/Adyen/Service/Notification.php b/src/Adyen/Service/Notification.php new file mode 100644 index 000000000..b997c4ea3 --- /dev/null +++ b/src/Adyen/Service/Notification.php @@ -0,0 +1,114 @@ +createNotificationConfiguration = new \Adyen\Service\ResourceModel\Notification\CreateNotificationConfiguration($this); + $this->updateNotificationConfiguration = new \Adyen\Service\ResourceModel\Notification\UpdateNotificationConfiguration($this); + $this->getNotificationConfiguration = new \Adyen\Service\ResourceModel\Notification\GetNotificationConfiguration($this); + $this->deleteNotificationConfigurations = new \Adyen\Service\ResourceModel\Notification\DeleteNotificationConfigurations($this); + $this->getNotificationConfigurationList = new \Adyen\Service\ResourceModel\Notification\GetNotificationConfigurationList($this); + $this->testNotificationConfiguration = new \Adyen\Service\ResourceModel\Notification\TestNotificationConfiguration($this); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function createNotificationConfiguration($params) + { + return $this->createNotificationConfiguration->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function updateNotificationConfiguration($params) + { + return $this->updateNotificationConfiguration->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function getNotificationConfiguration($params) + { + return $this->getNotificationConfiguration->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function deleteNotificationConfigurations($params) + { + return $this->deleteNotificationConfigurations->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function getNotificationConfigurationList($params) + { + return $this->getNotificationConfigurationList->request($params); + } + + /** + * @param $params + * @return mixed + * @throws \Adyen\AdyenException + */ + public function testNotificationConfiguration($params) + { + return $this->testNotificationConfiguration->request($params); + } +} diff --git a/src/Adyen/Service/Payment.php b/src/Adyen/Service/Payment.php index deffb56ec..ac9310ed1 100644 --- a/src/Adyen/Service/Payment.php +++ b/src/Adyen/Service/Payment.php @@ -7,17 +7,17 @@ class Payment extends \Adyen\Service /** * @var ResourceModel\Payment\Authorise */ - protected $_authorise; + protected $authorise; /** * @var ResourceModel\Payment\Authorise3D */ - protected $_authorise3D; + protected $authorise3D; /** * @var ResourceModel\Payment\Authorise3DS2 */ - protected $_authorise3DS2; + protected $authorise3DS2; /** * Payment constructor. @@ -28,9 +28,9 @@ class Payment extends \Adyen\Service public function __construct(\Adyen\Client $client) { parent::__construct($client); - $this->_authorise = new \Adyen\Service\ResourceModel\Payment\Authorise($this); - $this->_authorise3D = new \Adyen\Service\ResourceModel\Payment\Authorise3D($this); - $this->_authorise3DS2 = new \Adyen\Service\ResourceModel\Payment\Authorise3DS2($this); + $this->authorise = new \Adyen\Service\ResourceModel\Payment\Authorise($this); + $this->authorise3D = new \Adyen\Service\ResourceModel\Payment\Authorise3D($this); + $this->authorise3DS2 = new \Adyen\Service\ResourceModel\Payment\Authorise3DS2($this); } /** @@ -40,7 +40,7 @@ public function __construct(\Adyen\Client $client) */ public function authorise($params) { - $result = $this->_authorise->request($params); + $result = $this->authorise->request($params); return $result; } @@ -51,7 +51,7 @@ public function authorise($params) */ public function authorise3D($params) { - $result = $this->_authorise3D->request($params); + $result = $this->authorise3D->request($params); return $result; } @@ -62,7 +62,7 @@ public function authorise3D($params) */ public function authorise3DS2($params) { - $result = $this->_authorise3DS2->request($params); + $result = $this->authorise3DS2->request($params); return $result; } } diff --git a/src/Adyen/Service/Payout.php b/src/Adyen/Service/Payout.php index 2e7934a3a..3cf198bd5 100644 --- a/src/Adyen/Service/Payout.php +++ b/src/Adyen/Service/Payout.php @@ -7,47 +7,47 @@ class Payout extends \Adyen\Service /** * @var ResourceModel\Payout\Confirm */ - protected $_confirm; + protected $confirm; /** * @var ResourceModel\Payout\Decline */ - protected $_decline; + protected $decline; /** * @var ResourceModel\Payout\StoreDetailsAndSubmit */ - protected $_storeDetailsAndSubmit; + protected $storeDetailsAndSubmit; /** * @var ResourceModel\Payout\Submit */ - protected $_submit; + protected $submit; /** * @var ResourceModel\Payout\ThirdParty\ConfirmThirdParty */ - protected $_confirmThirdParty; + protected $confirmThirdParty; /** * @var ResourceModel\Payout\ThirdParty\DeclineThirdParty */ - protected $_declineThirdParty; + protected $declineThirdParty; /** * @var ResourceModel\Payout\ThirdParty\StoreDetailsAndSubmitThirdParty */ - protected $_storeDetailsAndSubmitThirdParty; + protected $storeDetailsAndSubmitThirdParty; /** * @var ResourceModel\Payout\ThirdParty\SubmitThirdParty */ - protected $_submitThirdParty; + protected $submitThirdParty; /** * @var ResourceModel\Payout\ThirdParty\StoreDetail */ - protected $_storeDetail; + protected $storeDetail; /** * Payout constructor. @@ -58,15 +58,15 @@ class Payout extends \Adyen\Service public function __construct(\Adyen\Client $client) { parent::__construct($client); - $this->_confirm = new \Adyen\Service\ResourceModel\Payout\Confirm($this); - $this->_decline = new \Adyen\Service\ResourceModel\Payout\Decline($this); - $this->_storeDetailsAndSubmit = new \Adyen\Service\ResourceModel\Payout\StoreDetailsAndSubmit($this); - $this->_submit = new \Adyen\Service\ResourceModel\Payout\Submit($this); - $this->_confirmThirdParty = new \Adyen\Service\ResourceModel\Payout\ThirdParty\ConfirmThirdParty($this); - $this->_declineThirdParty = new \Adyen\Service\ResourceModel\Payout\ThirdParty\DeclineThirdParty($this); - $this->_storeDetailsAndSubmitThirdParty = new \Adyen\Service\ResourceModel\Payout\ThirdParty\StoreDetailsAndSubmitThirdParty($this); - $this->_submitThirdParty = new \Adyen\Service\ResourceModel\Payout\ThirdParty\SubmitThirdParty($this); - $this->_storeDetail = new \Adyen\Service\ResourceModel\Payout\ThirdParty\StoreDetail($this); + $this->confirm = new \Adyen\Service\ResourceModel\Payout\Confirm($this); + $this->decline = new \Adyen\Service\ResourceModel\Payout\Decline($this); + $this->storeDetailsAndSubmit = new \Adyen\Service\ResourceModel\Payout\StoreDetailsAndSubmit($this); + $this->submit = new \Adyen\Service\ResourceModel\Payout\Submit($this); + $this->confirmThirdParty = new \Adyen\Service\ResourceModel\Payout\ThirdParty\ConfirmThirdParty($this); + $this->declineThirdParty = new \Adyen\Service\ResourceModel\Payout\ThirdParty\DeclineThirdParty($this); + $this->storeDetailsAndSubmitThirdParty = new \Adyen\Service\ResourceModel\Payout\ThirdParty\StoreDetailsAndSubmitThirdParty($this); + $this->submitThirdParty = new \Adyen\Service\ResourceModel\Payout\ThirdParty\SubmitThirdParty($this); + $this->storeDetail = new \Adyen\Service\ResourceModel\Payout\ThirdParty\StoreDetail($this); } /** @@ -76,7 +76,7 @@ public function __construct(\Adyen\Client $client) */ public function confirm($params) { - $result = $this->_confirm->request($params); + $result = $this->confirm->request($params); return $result; } @@ -87,7 +87,7 @@ public function confirm($params) */ public function decline($params) { - $result = $this->_decline->request($params); + $result = $this->decline->request($params); return $result; } @@ -98,7 +98,7 @@ public function decline($params) */ public function storeDetailsAndSubmit($params) { - $result = $this->_storeDetailsAndSubmit->request($params); + $result = $this->storeDetailsAndSubmit->request($params); return $result; } @@ -109,7 +109,7 @@ public function storeDetailsAndSubmit($params) */ public function submit($params) { - $result = $this->_submit->request($params); + $result = $this->submit->request($params); return $result; } @@ -120,7 +120,7 @@ public function submit($params) */ public function confirmThirdParty($params) { - $result = $this->_confirmThirdParty->request($params); + $result = $this->confirmThirdParty->request($params); return $result; } @@ -131,7 +131,7 @@ public function confirmThirdParty($params) */ public function declineThirdParty($params) { - $result = $this->_declineThirdParty->request($params); + $result = $this->declineThirdParty->request($params); return $result; } @@ -142,7 +142,7 @@ public function declineThirdParty($params) */ public function storeDetailsAndSubmitThirdParty($params) { - $result = $this->_storeDetailsAndSubmitThirdParty->request($params); + $result = $this->storeDetailsAndSubmitThirdParty->request($params); return $result; } @@ -153,7 +153,7 @@ public function storeDetailsAndSubmitThirdParty($params) */ public function submitThirdParty($params) { - $result = $this->_submitThirdParty->request($params); + $result = $this->submitThirdParty->request($params); return $result; } @@ -164,7 +164,7 @@ public function submitThirdParty($params) */ public function storeDetail($params) { - $result = $this->_storeDetail->request($params); + $result = $this->storeDetail->request($params); return $result; } } diff --git a/src/Adyen/Service/PosPayment.php b/src/Adyen/Service/PosPayment.php index e78703f7c..3b75e0037 100644 --- a/src/Adyen/Service/PosPayment.php +++ b/src/Adyen/Service/PosPayment.php @@ -7,17 +7,17 @@ class PosPayment extends \Adyen\ApiKeyAuthenticatedService /** * @var ResourceModel\Payment\TerminalCloudAPI */ - protected $_runTenderSync; + protected $runTenderSync; /** * @var ResourceModel\Payment\TerminalCloudAPI */ - protected $_runTenderAsync; + protected $runTenderAsync; /** * @var */ - protected $_txType; + protected $txType; /** * PosPayment constructor. @@ -28,8 +28,8 @@ class PosPayment extends \Adyen\ApiKeyAuthenticatedService public function __construct(\Adyen\Client $client) { parent::__construct($client); - $this->_runTenderSync = new \Adyen\Service\ResourceModel\Payment\TerminalCloudAPI($this, false); - $this->_runTenderAsync = new \Adyen\Service\ResourceModel\Payment\TerminalCloudAPI($this, true); + $this->runTenderSync = new \Adyen\Service\ResourceModel\Payment\TerminalCloudAPI($this, false); + $this->runTenderAsync = new \Adyen\Service\ResourceModel\Payment\TerminalCloudAPI($this, true); } /** @@ -39,7 +39,7 @@ public function __construct(\Adyen\Client $client) */ public function runTenderSync($params) { - $result = $this->_runTenderSync->request($params); + $result = $this->runTenderSync->request($params); return $result; } @@ -50,7 +50,7 @@ public function runTenderSync($params) */ public function runTenderAsync($params) { - $result = $this->_runTenderAsync->request($params); + $result = $this->runTenderAsync->request($params); return $result; } diff --git a/src/Adyen/Service/Recurring.php b/src/Adyen/Service/Recurring.php index 3300d7acb..281515375 100644 --- a/src/Adyen/Service/Recurring.php +++ b/src/Adyen/Service/Recurring.php @@ -7,12 +7,12 @@ class Recurring extends \Adyen\Service /** * @var ResourceModel\Recurring\ListRecurringDetails */ - protected $_listRecurringDetails; + protected $listRecurringDetails; /** * @var ResourceModel\Recurring\Disable */ - protected $_disable; + protected $disable; /** * Recurring constructor. @@ -23,9 +23,9 @@ class Recurring extends \Adyen\Service public function __construct(\Adyen\Client $client) { parent::__construct($client); - $this->_listRecurringDetails = new \Adyen\Service\ResourceModel\Recurring\ListRecurringDetails($this); + $this->listRecurringDetails = new \Adyen\Service\ResourceModel\Recurring\ListRecurringDetails($this); - $this->_disable = new \Adyen\Service\ResourceModel\Recurring\Disable( + $this->disable = new \Adyen\Service\ResourceModel\Recurring\Disable( $this, $this->getClient()->getConfig()->get('endpoint') . '/disable', array('merchantAccount', 'shopperReference')); @@ -38,7 +38,7 @@ public function __construct(\Adyen\Client $client) */ public function listRecurringDetails($params) { - $result = $this->_listRecurringDetails->request($params); + $result = $this->listRecurringDetails->request($params); return $result; } @@ -49,7 +49,7 @@ public function listRecurringDetails($params) */ public function disable($params) { - $result = $this->_disable->request($params); + $result = $this->disable->request($params); return $result; } } diff --git a/src/Adyen/Service/ResourceModel/Account/CloseAccount.php b/src/Adyen/Service/ResourceModel/Account/CloseAccount.php new file mode 100755 index 000000000..767d4a79d --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/CloseAccount.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/closeAccount'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/CloseAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/CloseAccountHolder.php new file mode 100755 index 000000000..7324c7b34 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/CloseAccountHolder.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/closeAccountHolder'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/CreateAccount.php b/src/Adyen/Service/ResourceModel/Account/CreateAccount.php new file mode 100755 index 000000000..db2a906bd --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/CreateAccount.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/createAccount'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/CreateAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/CreateAccountHolder.php new file mode 100755 index 000000000..279758806 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/CreateAccountHolder.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/createAccountHolder'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/DeleteBankAccounts.php b/src/Adyen/Service/ResourceModel/Account/DeleteBankAccounts.php new file mode 100755 index 000000000..6a6168704 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/DeleteBankAccounts.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/deleteBankAccounts'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/DeleteShareholders.php b/src/Adyen/Service/ResourceModel/Account/DeleteShareholders.php new file mode 100755 index 000000000..16aa02e82 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/DeleteShareholders.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/deleteShareholders'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/GetAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/GetAccountHolder.php new file mode 100755 index 000000000..39e6f552d --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/GetAccountHolder.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/getAccountHolder'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/GetUploadedDocuments.php b/src/Adyen/Service/ResourceModel/Account/GetUploadedDocuments.php new file mode 100755 index 000000000..2dc1703b5 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/GetUploadedDocuments.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/getUploadedDocuments'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/SuspendAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/SuspendAccountHolder.php new file mode 100755 index 000000000..1aba26084 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/SuspendAccountHolder.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/suspendAccountHolder'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/UnSuspendAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/UnSuspendAccountHolder.php new file mode 100755 index 000000000..1ad5ad729 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/UnSuspendAccountHolder.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/unSuspendAccountHolder'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/UpdateAccount.php b/src/Adyen/Service/ResourceModel/Account/UpdateAccount.php new file mode 100755 index 000000000..391a112b6 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/UpdateAccount.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/updateAccount'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolder.php b/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolder.php new file mode 100755 index 000000000..b504f8725 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolder.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/updateAccountHolder'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolderState.php b/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolderState.php new file mode 100755 index 000000000..fd42f12ab --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/UpdateAccountHolderState.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/updateAccountHolderState'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Account/UploadDocument.php b/src/Adyen/Service/ResourceModel/Account/UploadDocument.php new file mode 100755 index 000000000..2329aa298 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Account/UploadDocument.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointAccount') . '/' . $service->getClient()->getApiAccountVersion() . '/uploadDocument'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Checkout/PaymentMethods.php b/src/Adyen/Service/ResourceModel/Checkout/PaymentMethods.php index 7d9c5020d..b386921c0 100644 --- a/src/Adyen/Service/ResourceModel/Checkout/PaymentMethods.php +++ b/src/Adyen/Service/ResourceModel/Checkout/PaymentMethods.php @@ -7,7 +7,7 @@ class PaymentMethods extends \Adyen\Service\AbstractCheckoutResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * PaymentMethods constructor. @@ -17,7 +17,7 @@ class PaymentMethods extends \Adyen\Service\AbstractCheckoutResource */ public function __construct($service) { - $this->_endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/paymentMethods'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/paymentMethods'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Checkout/PaymentSession.php b/src/Adyen/Service/ResourceModel/Checkout/PaymentSession.php index 5f7ac1f61..ce6386416 100644 --- a/src/Adyen/Service/ResourceModel/Checkout/PaymentSession.php +++ b/src/Adyen/Service/ResourceModel/Checkout/PaymentSession.php @@ -7,7 +7,7 @@ class PaymentSession extends \Adyen\Service\AbstractCheckoutResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * PaymentSession constructor. @@ -17,7 +17,7 @@ class PaymentSession extends \Adyen\Service\AbstractCheckoutResource */ public function __construct($service) { - $this->_endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/paymentSession'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/paymentSession'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Checkout/Payments.php b/src/Adyen/Service/ResourceModel/Checkout/Payments.php index 6d284f513..e77aa4b55 100644 --- a/src/Adyen/Service/ResourceModel/Checkout/Payments.php +++ b/src/Adyen/Service/ResourceModel/Checkout/Payments.php @@ -7,7 +7,7 @@ class Payments extends \Adyen\Service\AbstractCheckoutResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Include applicationInfo key in the request parameters @@ -24,7 +24,7 @@ class Payments extends \Adyen\Service\AbstractCheckoutResource */ public function __construct($service) { - $this->_endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/payments'; - parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); + $this->endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/payments'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); } } diff --git a/src/Adyen/Service/ResourceModel/Checkout/PaymentsDetails.php b/src/Adyen/Service/ResourceModel/Checkout/PaymentsDetails.php index b29d0ffdc..3417efef1 100644 --- a/src/Adyen/Service/ResourceModel/Checkout/PaymentsDetails.php +++ b/src/Adyen/Service/ResourceModel/Checkout/PaymentsDetails.php @@ -7,7 +7,7 @@ class PaymentsDetails extends \Adyen\Service\AbstractCheckoutResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * PaymentsDetails constructor. @@ -17,7 +17,7 @@ class PaymentsDetails extends \Adyen\Service\AbstractCheckoutResource */ public function __construct($service) { - $this->_endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/payments/details'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/payments/details'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Checkout/PaymentsResult.php b/src/Adyen/Service/ResourceModel/Checkout/PaymentsResult.php index 9e6c6cad5..c5187ee82 100644 --- a/src/Adyen/Service/ResourceModel/Checkout/PaymentsResult.php +++ b/src/Adyen/Service/ResourceModel/Checkout/PaymentsResult.php @@ -7,7 +7,7 @@ class PaymentsResult extends \Adyen\Service\AbstractCheckoutResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * PaymentsResult constructor. @@ -17,7 +17,7 @@ class PaymentsResult extends \Adyen\Service\AbstractCheckoutResource */ public function __construct($service) { - $this->_endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/payments/result'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutVersion() . '/payments/result'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/CheckoutUtility/OriginKeys.php b/src/Adyen/Service/ResourceModel/CheckoutUtility/OriginKeys.php index 8baacaf4d..41a7d5004 100644 --- a/src/Adyen/Service/ResourceModel/CheckoutUtility/OriginKeys.php +++ b/src/Adyen/Service/ResourceModel/CheckoutUtility/OriginKeys.php @@ -7,7 +7,7 @@ class OriginKeys extends \Adyen\Service\AbstractCheckoutResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * OriginKeys constructor. @@ -17,7 +17,7 @@ class OriginKeys extends \Adyen\Service\AbstractCheckoutResource */ public function __construct($service) { - $this->_endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutUtilityVersion() . '/originKeys'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $this->getCheckoutEndpoint($service) . '/' . $service->getClient()->getApiCheckoutUtilityVersion() . '/originKeys'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/DirectoryLookup/Directory.php b/src/Adyen/Service/ResourceModel/DirectoryLookup/Directory.php index 0cecf425c..117ee3690 100644 --- a/src/Adyen/Service/ResourceModel/DirectoryLookup/Directory.php +++ b/src/Adyen/Service/ResourceModel/DirectoryLookup/Directory.php @@ -7,7 +7,7 @@ class Directory extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Directory constructor. @@ -17,7 +17,7 @@ class Directory extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpointDirectorylookup'); - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpointDirectorylookup'); + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Fund/AccountHolderBalance.php b/src/Adyen/Service/ResourceModel/Fund/AccountHolderBalance.php new file mode 100755 index 000000000..941aff81c --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Fund/AccountHolderBalance.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointFund') . '/' . $service->getClient()->getApiFundVersion() . '/accountHolderBalance'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Fund/AccountHolderTransactionList.php b/src/Adyen/Service/ResourceModel/Fund/AccountHolderTransactionList.php new file mode 100755 index 000000000..4649dca33 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Fund/AccountHolderTransactionList.php @@ -0,0 +1,22 @@ +endpoint = $service->getClient()->getConfig()->get('endpointFund') . '/' . $service->getClient()->getApiFundVersion() . '/accountHolderTransactionList'; + + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Fund/PayoutAccountHolder.php b/src/Adyen/Service/ResourceModel/Fund/PayoutAccountHolder.php new file mode 100755 index 000000000..d8e38c18e --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Fund/PayoutAccountHolder.php @@ -0,0 +1,23 @@ +endpoint = $service->getClient()->getConfig()->get('endpointFund') . '/' . $service->getClient()->getApiFundVersion() . '/payoutAccountHolder'; + + parent::__construct($service, $this->endpoint); + } + +} diff --git a/src/Adyen/Service/ResourceModel/Fund/RefundNotPaidOutTransfers.php b/src/Adyen/Service/ResourceModel/Fund/RefundNotPaidOutTransfers.php new file mode 100755 index 000000000..792cf9ff5 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Fund/RefundNotPaidOutTransfers.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointFund') . '/' . $service->getClient()->getApiFundVersion() . '/refundNotPaidOutTransfers'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Fund/SetupBeneficiary.php b/src/Adyen/Service/ResourceModel/Fund/SetupBeneficiary.php new file mode 100755 index 000000000..9db289e81 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Fund/SetupBeneficiary.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointFund') . '/' . $service->getClient()->getApiFundVersion() . '/setupBeneficiary'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Fund/TransferFunds.php b/src/Adyen/Service/ResourceModel/Fund/TransferFunds.php new file mode 100755 index 000000000..981c55401 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Fund/TransferFunds.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointFund') . '/' . $service->getClient()->getApiFundVersion() . '/transferFunds'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Modification/AdjustAuthorisation.php b/src/Adyen/Service/ResourceModel/Modification/AdjustAuthorisation.php index a3145c11a..799234441 100644 --- a/src/Adyen/Service/ResourceModel/Modification/AdjustAuthorisation.php +++ b/src/Adyen/Service/ResourceModel/Modification/AdjustAuthorisation.php @@ -7,7 +7,7 @@ class AdjustAuthorisation extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Include applicationInfo key in the request parameters @@ -23,7 +23,7 @@ class AdjustAuthorisation extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint').'/pal/servlet/Payment/'.$service->getClient()->getApiPaymentVersion().'/adjustAuthorisation'; - parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint').'/pal/servlet/Payment/'.$service->getClient()->getApiPaymentVersion().'/adjustAuthorisation'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); } } diff --git a/src/Adyen/Service/ResourceModel/Modification/Cancel.php b/src/Adyen/Service/ResourceModel/Modification/Cancel.php index dc3c4c13f..750ae4dac 100644 --- a/src/Adyen/Service/ResourceModel/Modification/Cancel.php +++ b/src/Adyen/Service/ResourceModel/Modification/Cancel.php @@ -7,7 +7,7 @@ class Cancel extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Include applicationInfo key in the request parameters @@ -23,7 +23,7 @@ class Cancel extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/cancel'; - parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/cancel'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); } } diff --git a/src/Adyen/Service/ResourceModel/Modification/CancelOrRefund.php b/src/Adyen/Service/ResourceModel/Modification/CancelOrRefund.php index 1b9077a9f..d09dc02d8 100644 --- a/src/Adyen/Service/ResourceModel/Modification/CancelOrRefund.php +++ b/src/Adyen/Service/ResourceModel/Modification/CancelOrRefund.php @@ -7,7 +7,7 @@ class CancelOrRefund extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Include applicationInfo key in the request parameters @@ -23,7 +23,7 @@ class CancelOrRefund extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/'. $service->getClient()->getApiPaymentVersion() . '/cancelOrRefund'; - parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/'. $service->getClient()->getApiPaymentVersion() . '/cancelOrRefund'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); } } diff --git a/src/Adyen/Service/ResourceModel/Modification/Capture.php b/src/Adyen/Service/ResourceModel/Modification/Capture.php index b4cb46566..eaa4aea5c 100644 --- a/src/Adyen/Service/ResourceModel/Modification/Capture.php +++ b/src/Adyen/Service/ResourceModel/Modification/Capture.php @@ -7,7 +7,7 @@ class Capture extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Include applicationInfo key in the request parameters @@ -23,7 +23,7 @@ class Capture extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/capture'; - parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/capture'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); } } diff --git a/src/Adyen/Service/ResourceModel/Modification/Refund.php b/src/Adyen/Service/ResourceModel/Modification/Refund.php index cad285a08..c5714f8c6 100644 --- a/src/Adyen/Service/ResourceModel/Modification/Refund.php +++ b/src/Adyen/Service/ResourceModel/Modification/Refund.php @@ -7,7 +7,7 @@ class Refund extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Include applicationInfo key in the request parameters @@ -23,7 +23,7 @@ class Refund extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/refund'; - parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/refund'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); } } diff --git a/src/Adyen/Service/ResourceModel/Notification/CreateNotificationConfiguration.php b/src/Adyen/Service/ResourceModel/Notification/CreateNotificationConfiguration.php new file mode 100755 index 000000000..4c3bf6223 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Notification/CreateNotificationConfiguration.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointNotification') . '/' . $service->getClient()->getApiNotificationVersion() . '/createNotificationConfiguration'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Notification/DeleteNotificationConfigurations.php b/src/Adyen/Service/ResourceModel/Notification/DeleteNotificationConfigurations.php new file mode 100755 index 000000000..7a3ba538c --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Notification/DeleteNotificationConfigurations.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointNotification') . '/' . $service->getClient()->getApiNotificationVersion() . '/deleteNotificationConfigurations'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfiguration.php b/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfiguration.php new file mode 100755 index 000000000..842f2ae5b --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfiguration.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointNotification') . '/' . $service->getClient()->getApiNotificationVersion() . '/getNotificationConfiguration'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfigurationList.php b/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfigurationList.php new file mode 100755 index 000000000..aa885c95f --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Notification/GetNotificationConfigurationList.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointNotification') . '/' . $service->getClient()->getApiNotificationVersion() . '/getNotificationConfigurationList'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Notification/TestNotificationConfiguration.php b/src/Adyen/Service/ResourceModel/Notification/TestNotificationConfiguration.php new file mode 100755 index 000000000..150c8bce8 --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Notification/TestNotificationConfiguration.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointNotification') . '/' . $service->getClient()->getApiNotificationVersion() . '/testNotificationConfiguration'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Notification/UpdateNotificationConfiguration.php b/src/Adyen/Service/ResourceModel/Notification/UpdateNotificationConfiguration.php new file mode 100755 index 000000000..8601ba04c --- /dev/null +++ b/src/Adyen/Service/ResourceModel/Notification/UpdateNotificationConfiguration.php @@ -0,0 +1,21 @@ +endpoint = $service->getClient()->getConfig()->get('endpointNotification') . '/' . $service->getClient()->getApiNotificationVersion() . '/updateNotificationConfiguration'; + parent::__construct($service, $this->endpoint); + } +} diff --git a/src/Adyen/Service/ResourceModel/Payment/Authorise.php b/src/Adyen/Service/ResourceModel/Payment/Authorise.php index 01ff66ff1..162bc3064 100644 --- a/src/Adyen/Service/ResourceModel/Payment/Authorise.php +++ b/src/Adyen/Service/ResourceModel/Payment/Authorise.php @@ -7,7 +7,7 @@ class Authorise extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Include applicationInfo key in the request parameters @@ -23,7 +23,7 @@ class Authorise extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/authorise'; - parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/authorise'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); } } diff --git a/src/Adyen/Service/ResourceModel/Payment/Authorise3D.php b/src/Adyen/Service/ResourceModel/Payment/Authorise3D.php index 2ea15dbf4..34818ba21 100644 --- a/src/Adyen/Service/ResourceModel/Payment/Authorise3D.php +++ b/src/Adyen/Service/ResourceModel/Payment/Authorise3D.php @@ -7,7 +7,7 @@ class Authorise3D extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Include applicationInfo key in the request parameters @@ -23,7 +23,7 @@ class Authorise3D extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/authorise3d'; - parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/authorise3d'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); } } diff --git a/src/Adyen/Service/ResourceModel/Payment/Authorise3DS2.php b/src/Adyen/Service/ResourceModel/Payment/Authorise3DS2.php index 780ee2373..894d3a605 100644 --- a/src/Adyen/Service/ResourceModel/Payment/Authorise3DS2.php +++ b/src/Adyen/Service/ResourceModel/Payment/Authorise3DS2.php @@ -7,7 +7,7 @@ class Authorise3DS2 extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Include applicationInfo key in the request parameters @@ -23,7 +23,7 @@ class Authorise3DS2 extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/authorise3ds2'; - parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/authorise3ds2'; + parent::__construct($service, $this->endpoint, $this->allowApplicationInfo); } } diff --git a/src/Adyen/Service/ResourceModel/Payment/TerminalCloudAPI.php b/src/Adyen/Service/ResourceModel/Payment/TerminalCloudAPI.php index 82dda716c..18efafbd8 100644 --- a/src/Adyen/Service/ResourceModel/Payment/TerminalCloudAPI.php +++ b/src/Adyen/Service/ResourceModel/Payment/TerminalCloudAPI.php @@ -7,7 +7,7 @@ class TerminalCloudAPI extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * TerminalCloudAPI constructor. @@ -18,10 +18,10 @@ class TerminalCloudAPI extends \Adyen\Service\AbstractResource public function __construct($service, $asynchronous) { if ($asynchronous) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpointTerminalCloud') . '/async'; + $this->endpoint = $service->getClient()->getConfig()->get('endpointTerminalCloud') . '/async'; } else { - $this->_endpoint = $service->getClient()->getConfig()->get('endpointTerminalCloud') . '/sync'; + $this->endpoint = $service->getClient()->getConfig()->get('endpointTerminalCloud') . '/sync'; } - parent::__construct($service, $this->_endpoint); + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Payout/Confirm.php b/src/Adyen/Service/ResourceModel/Payout/Confirm.php index 576395be3..d325f6831 100644 --- a/src/Adyen/Service/ResourceModel/Payout/Confirm.php +++ b/src/Adyen/Service/ResourceModel/Payout/Confirm.php @@ -7,7 +7,7 @@ class Confirm extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Confirm constructor. @@ -16,7 +16,7 @@ class Confirm extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/confirm'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/confirm'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Payout/Decline.php b/src/Adyen/Service/ResourceModel/Payout/Decline.php index 351531f60..b96a07085 100644 --- a/src/Adyen/Service/ResourceModel/Payout/Decline.php +++ b/src/Adyen/Service/ResourceModel/Payout/Decline.php @@ -7,7 +7,7 @@ class Decline extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Decline constructor. @@ -16,7 +16,7 @@ class Decline extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/decline'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/decline'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Payout/StoreDetailsAndSubmit.php b/src/Adyen/Service/ResourceModel/Payout/StoreDetailsAndSubmit.php index 0faac78f7..8b7cdbe01 100644 --- a/src/Adyen/Service/ResourceModel/Payout/StoreDetailsAndSubmit.php +++ b/src/Adyen/Service/ResourceModel/Payout/StoreDetailsAndSubmit.php @@ -7,7 +7,7 @@ class StoreDetailsAndSubmit extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * StoreDetailsAndSubmit constructor. @@ -16,7 +16,7 @@ class StoreDetailsAndSubmit extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/storeDetailAndSubmit'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/storeDetailAndSubmit'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Payout/Submit.php b/src/Adyen/Service/ResourceModel/Payout/Submit.php index 8706801a7..5b707b66a 100644 --- a/src/Adyen/Service/ResourceModel/Payout/Submit.php +++ b/src/Adyen/Service/ResourceModel/Payout/Submit.php @@ -7,7 +7,7 @@ class Submit extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * Submit constructor. @@ -16,7 +16,7 @@ class Submit extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/submit'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/submit'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/ConfirmThirdParty.php b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/ConfirmThirdParty.php index 78d9c5bd9..102dde64e 100644 --- a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/ConfirmThirdParty.php +++ b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/ConfirmThirdParty.php @@ -7,7 +7,7 @@ class ConfirmThirdParty extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * ConfirmThirdParty constructor. @@ -16,7 +16,7 @@ class ConfirmThirdParty extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/confirmThirdParty'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/confirmThirdParty'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/DeclineThirdParty.php b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/DeclineThirdParty.php index e9802b131..0ec9b46a0 100644 --- a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/DeclineThirdParty.php +++ b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/DeclineThirdParty.php @@ -7,7 +7,7 @@ class DeclineThirdParty extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * DeclineThirdParty constructor. @@ -16,7 +16,7 @@ class DeclineThirdParty extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/declineThirdParty'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/declineThirdParty'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/StoreDetail.php b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/StoreDetail.php index 89467f91c..7407bd468 100644 --- a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/StoreDetail.php +++ b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/StoreDetail.php @@ -7,7 +7,7 @@ class StoreDetail extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * StoreDetail constructor. @@ -16,7 +16,7 @@ class StoreDetail extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/storeDetail'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/storeDetail'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/StoreDetailsAndSubmitThirdParty.php b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/StoreDetailsAndSubmitThirdParty.php index bf3de71d5..b4ba378d5 100644 --- a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/StoreDetailsAndSubmitThirdParty.php +++ b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/StoreDetailsAndSubmitThirdParty.php @@ -7,7 +7,7 @@ class StoreDetailsAndSubmitThirdParty extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * StoreDetailsAndSubmitThirdParty constructor. @@ -16,7 +16,7 @@ class StoreDetailsAndSubmitThirdParty extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/storeDetailAndSubmitThirdParty'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/storeDetailAndSubmitThirdParty'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/SubmitThirdParty.php b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/SubmitThirdParty.php index bca9898fd..9f59ff48e 100644 --- a/src/Adyen/Service/ResourceModel/Payout/ThirdParty/SubmitThirdParty.php +++ b/src/Adyen/Service/ResourceModel/Payout/ThirdParty/SubmitThirdParty.php @@ -7,7 +7,7 @@ class SubmitThirdParty extends \Adyen\Service\AbstractResource /** * @var string */ - protected $_endpoint; + protected $endpoint; /** * SubmitThirdParty constructor. @@ -16,7 +16,7 @@ class SubmitThirdParty extends \Adyen\Service\AbstractResource */ public function __construct($service) { - $this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/submitThirdParty'; - parent::__construct($service, $this->_endpoint); + $this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/submitThirdParty'; + parent::__construct($service, $this->endpoint); } } diff --git a/src/Adyen/Util/Util.php b/src/Adyen/Util/Util.php index 043ce25d9..6401baaea 100644 --- a/src/Adyen/Util/Util.php +++ b/src/Adyen/Util/Util.php @@ -35,4 +35,4 @@ public static function calculateSha256Signature($hmacKey, $params) $merchantSig = base64_encode(hash_hmac('sha256', $signData, pack("H*", $hmacKey), true)); return $merchantSig; } -} \ No newline at end of file +} diff --git a/tests/CheckoutTest.php b/tests/CheckoutTest.php index c7f246561..f85458314 100644 --- a/tests/CheckoutTest.php +++ b/tests/CheckoutTest.php @@ -15,7 +15,7 @@ public function testPaymentMethods() 'amount' => 1000, 'countryCode' => 'NL', 'shopperLocale' => 'nl_NL', - 'merchantAccount' => $this->_merchantAccount, + 'merchantAccount' => $this->merchantAccount, ); $result = $service->paymentMethods($params); @@ -43,7 +43,7 @@ public function testBlockedPaymentMethods() 'amount' => 1000, 'countryCode' => 'NL', 'shopperLocale' => 'nl_NL', - 'merchantAccount' => $this->_merchantAccount, + 'merchantAccount' => $this->merchantAccount, 'blockedPaymentMethods' => array('ideal'), ); diff --git a/tests/CreatePaymentRequestTest.php b/tests/CreatePaymentRequestTest.php index dd52e5765..debc9200f 100644 --- a/tests/CreatePaymentRequestTest.php +++ b/tests/CreatePaymentRequestTest.php @@ -32,7 +32,7 @@ public function testCreatePaymentSuccess() "currency": "EUR" }, "reference": "payment-test", - "merchantAccount": "' . $this->_merchantAccount .'" + "merchantAccount": "' . $this->merchantAccount .'" }'; $params = json_decode($json, true); @@ -74,7 +74,7 @@ public function testCreatePaymentWithRecurringSuccess() "holderName": "John Smith", "number": "4111111111111111" }, - "merchantAccount": "' . $this->_merchantAccount .'", + "merchantAccount": "' . $this->merchantAccount .'", "recurring": { "contract": "' . \Adyen\Contract::RECURRING . '", "recurringDetailName": "1" @@ -173,7 +173,7 @@ public function testCreatePaymentSuccessJson() "currency": "EUR" }, "reference": "payment-test", - "merchantAccount": "' . $this->_merchantAccount .'" + "merchantAccount": "' . $this->merchantAccount .'" }'; @@ -222,7 +222,7 @@ public function testCreatePaymentWrongCvc() "currency": "EUR" }, "reference": "payment-test", - "merchantAccount": "' . $this->_merchantAccount .'" + "merchantAccount": "' . $this->merchantAccount .'" }'; $params = json_decode($json, true); diff --git a/tests/DirectoryLookupTest.php b/tests/DirectoryLookupTest.php index 2d4ec3923..737331a6b 100644 --- a/tests/DirectoryLookupTest.php +++ b/tests/DirectoryLookupTest.php @@ -16,7 +16,7 @@ class DirectoryLookupTest extends TestCase public function testDirectoryLookup() { - $this->_needSkinCode(); + $this->needSkinCode(); // initialize client $client = $this->createClient(); @@ -31,8 +31,8 @@ public function testDirectoryLookup() "paymentAmount": "1000", "currencyCode": "EUR", "merchantReference": "Get Payment methods", - "skinCode": "' . $this->_skinCode .'", - "merchantAccount": "' . $this->_merchantAccount .'", + "skinCode": "' . $this->skinCode .'", + "merchantAccount": "' . $this->merchantAccount .'", "sessionValidity": "'.$sessionValidity.'", "countryCode": "NL", "shopperLocale": "nl_NL" @@ -43,7 +43,7 @@ public function testDirectoryLookup() $params = json_decode($json, true); // calculate the signature - $hmacKey = $this->_hmacSignature; + $hmacKey = $this->hmacSignature; // add signature in request $params["merchantSig"] = Util::calculateSha256Signature($hmacKey, $params); @@ -87,7 +87,7 @@ public function testDirectoryLookupEmptyParameters() public function testDirectoryLookupFailed() { - $this->_needSkinCode(); + $this->needSkinCode(); // initialize client $client = $this->createClient(); @@ -103,7 +103,7 @@ public function testDirectoryLookupFailed() "paymentAmount": "1000", "currencyCode": "EUR", "merchantReference": "Get Payment methods", - "skinCode": "' . $this->_skinCode .'", + "skinCode": "' . $this->skinCode .'", "merchantAccount": "A MERCHANT ACCOUNT THAT DOES NOT EXISTS", "sessionValidity": "'.$sessionValidity.'", "countryCode": "NL", diff --git a/tests/MockTest/AccountTest.php b/tests/MockTest/AccountTest.php new file mode 100755 index 000000000..4e729153e --- /dev/null +++ b/tests/MockTest/AccountTest.php @@ -0,0 +1,56 @@ +createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Account($client); + + $params = json_decode(' + { + "accountHolderCode": "TestAccountHolderCode", + "accountHolderDetails": { + "email": "tim@green.com", + "individualDetails": { + "name": { + "firstName": "Tim", + "gender": "MALE", + "lastName": "Green" + } + }, + "address": { + "country": "US" + } + }, + "legalEntity": "Individual" + }', + true + ); + + $result = $service->createAccount($params); + + $this->assertContains($result['accountHolderStatus']['status'], "Active"); + } + + /** + * @return array + */ + public static function successAccountCreateProvider() + { + return array( + array('tests/Resources/Account/create-account-success.json', 200), + ); + } +} diff --git a/tests/MockTest/CheckoutUtilityTest.php b/tests/MockTest/CheckoutUtilityTest.php index bc1e3a495..ef10aa3cf 100644 --- a/tests/MockTest/CheckoutUtilityTest.php +++ b/tests/MockTest/CheckoutUtilityTest.php @@ -40,4 +40,4 @@ public static function successOriginKeysProvider() array('tests/Resources/CheckoutUtility/origin-keys-success.json', 200) ); } -} \ No newline at end of file +} diff --git a/tests/MockTest/FundTest.php b/tests/MockTest/FundTest.php new file mode 100755 index 000000000..8479e1bc3 --- /dev/null +++ b/tests/MockTest/FundTest.php @@ -0,0 +1,236 @@ +createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Fund($client); + + $params = json_decode(' + { + "accountHolderCode": "TestAccountHolder877209" + }', + true + ); + + $result = $service->accountHolderBalance($params); + + $this->assertContains($result['resultCode'], array('Success')); + } + + /** + * @return array + */ + public static function successAccountHolderBalanceProvider() + { + return array( + array('tests/Resources/Fund/accountHolderBalance-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successAccountHolderTransactionListProvider + * @throws \Adyen\AdyenException + */ + public function testAccountHolderTransactionListSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Fund($client); + + $params = json_decode(' + { + "accountHolderCode": "TestAccountHolder423978", + "transactionStatuses": [], + "transactionListsPerAccount": [] + }', + true + ); + + $result = $service->accountHolderTransactionList($params); + + $this->assertContains($result['resultCode'], array('Success')); + } + + /** + * @return array + */ + public static function successAccountHolderTransactionListProvider() + { + return array( + array('tests/Resources/Fund/accountHolderTransactionList-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successPayoutAccountHolderProvider + * @throws \Adyen\AdyenException + */ + public function testPayoutAccountHolderSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Fund($client); + + $params = json_decode(' + { + "accountCode": "118731451", + "amount": { + "currency": "EUR", + "value": 99792 + }, + "accountHolderCode": "TestAccountHolder877209", + "merchantReference": "myreference", + "description": "12345 – Test", + "bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c" + }', + true + ); + + $result = $service->payoutAccountHolder($params); + + $this->assertContains($result['bankAccountUUID'], array('000b81aa-ae7e-4492-aa7e-72b2129dce0c')); + } + + public static function successPayoutAccountHolderProvider() + { + return array( + array('tests/Resources/Fund/payoutAccountHolder-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successTransferFundsProvider + * @throws \Adyen\AdyenException + */ + public function testTransferFundsSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Fund($client); + + $params = json_decode(' + { + "sourceAccountCode": "189184578", + "merchantReference": "myreference", + "destinationAccountCode": "190324759", + "amount": { + "currency": "EUR", + "value": 2000 + }, + "transferCode": "TransferCode_1" + }', + true + ); + + $result = $service->transferFunds($params); + + $this->assertContains($result['resultCode'], array('Success')); + } + + /** + * @return array + */ + public static function successTransferFundsProvider() + { + return array( + array('tests/Resources/Fund/transferFunds-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successSetupBeneficiaryProvider + * @throws \Adyen\AdyenException + */ + public function testSetupBeneficiarySuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Fund($client); + + $params = json_decode(' + { + "destinationAccountCode": "118731451", + "merchantReference": "myreference", + "sourceAccountCode": "189184578" + }', + true + ); + + $result = $service->setupBeneficiary($params); + + $this->assertContains($result['resultCode'], array('Success')); + } + + public static function successSetupBeneficiaryProvider() + { + return array( + array('tests/Resources/Fund/setupBeneficiary-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successRefundNotPaidOutTransfersProvider + * @throws \Adyen\AdyenException + */ + public function testRefundNotPaidOutTransfersSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Fund($client); + + $params = json_decode(' + { + "accountHolderCode": "TestAccountHolder877210", + "accountCode": "118731451" + }', + true + ); + + $result = $service->refundNotPaidOutTransfers($params); + + $this->assertContains($result['resultCode'], array('Success')); + } + + /** + * @return array + */ + public static function successRefundNotPaidOutTransfersProvider() + { + return array( + array('tests/Resources/Fund/refundNotPaidOutTransfers-success.json', 200), + ); + } +} diff --git a/tests/MockTest/NotificationTest.php b/tests/MockTest/NotificationTest.php new file mode 100755 index 000000000..b1217eca7 --- /dev/null +++ b/tests/MockTest/NotificationTest.php @@ -0,0 +1,253 @@ +createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Notification($client); + + $params = json_decode(' + { + "configurationDetails": { + "active": "true", + "description": "Test notification769551", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_VERIFICATION", + "includeMode": "INCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notifyURL": "https://www.merchant-domain.com/notification-handler", + "notifyUsername": "testUserName", + "notifyPassword": "testPassword", + "sendActionHeader": "true", + "sslProtocol": "SSL" + } + }', + true + ); + + $result = $service->createNotificationConfiguration($params); + + $this->assertContains($result['configurationDetails']['active'], array(true)); + } + + public static function successNotificationCreateProvider() + { + return array( + array('tests/Resources/Notification/create-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successNotificationGetlistProvider + * @throws \Adyen\AdyenException + */ + public function testNotificationGetlistSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Notification($client); + + $params = json_decode(' + { + "configurationDetails": { + + } + }', + true + ); + $result = $service->getNotificationConfigurationList($params); + + $this->assertContains($result['configurations'][0]['NotificationConfigurationDetails']['active'], array(true)); + + } + + public static function successNotificationGetlistProvider() + { + return array( + array('tests/Resources/Notification/getlist-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successNotificationGetProvider + * @throws \Adyen\AdyenException + */ + public function testNotificationGetSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Notification($client); + + $params = json_decode(' + { + "notificationId": 15007 + }', + true + ); + $result = $service->getNotificationConfiguration($params); + + $this->assertContains($result['configurationDetails']['notificationId'], array(15007)); + + } + + public static function successNotificationGetProvider() + { + return array( + array('tests/Resources/Notification/get-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successNotificationUpdateProvider + * @throws \Adyen\AdyenException + */ + public function testNotificationUpdateSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Notification($client); + + $params = json_decode(' + { + "configurationDetails": { + "active": "false", + "description": "new yolo 1", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_CREATED", + "includeMode": "EXCLUDE" + } + }, + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_CREATED", + "includeMode": "INCLUDE" + } + } + ], + "notificationId": 15007, + "notifyPassword": "testPassword2", + "notifyURL": "http://www.adyen.com", + "notifyUsername": "testUserName2", + "sendActionHeader": "false", + "sslProtocol": "TLSv10" + } + }', + true + ); + $result = $service->updateNotificationConfiguration($params); + + $this->assertContains($result['configurationDetails']['notificationId'], array(15007)); + + } + + public static function successNotificationUpdateProvider() + { + return array( + array('tests/Resources/Notification/update-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successNotificationDeleteProvider + * @throws \Adyen\AdyenException + */ + public function testNotificationDeleteSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Notification($client); + + $params = json_decode(' + { + "notificationIds": [ + 15007, + 15008 + ] + }', + true + ); + $result = $service->deleteNotificationConfigurations($params); + + $this->assertContains($result['pspReference'], array('8815324250627802')); + + } + + public static function successNotificationDeleteProvider() + { + return array( + array('tests/Resources/Notification/delete-success.json', 200), + ); + } + + /** + * @param $jsonFile + * @param $httpStatus + * @dataProvider successNotificationTestProvider + * @throws \Adyen\AdyenException + */ + public function testNotificationTestSuccess($jsonFile, $httpStatus) + { + // create Checkout client + $client = $this->createMockClient($jsonFile, $httpStatus); + + // initialize service + $service = new \Adyen\Service\Notification($client); + + $params = json_decode(' + { + "eventTypes": [], + "notificationId": 15009 + }', + true + ); + $result = $service->updateNotificationConfiguration($params); + + $this->assertContains($result['eventTypes'][0], array('ACCOUNT_HOLDER_VERIFICATION')); + + } + + /** + * @return array + */ + public static function successNotificationTestProvider() + { + return array( + array('tests/Resources/Notification/test-success.json', 200), + ); + } +} diff --git a/tests/MockTest/TestCaseMock.php b/tests/MockTest/TestCaseMock.php index 40da84c3d..af128d80e 100644 --- a/tests/MockTest/TestCaseMock.php +++ b/tests/MockTest/TestCaseMock.php @@ -26,4 +26,4 @@ protected function createMockClient($jsonFile, $httpStatus, $errno = null) $client->setHttpClient($curlClient); return $client; } -} \ No newline at end of file +} diff --git a/tests/ModificationTest.php b/tests/ModificationTest.php index bd4fe0c53..a1273c992 100644 --- a/tests/ModificationTest.php +++ b/tests/ModificationTest.php @@ -26,7 +26,7 @@ public function testCancelModification() // initialize service $service = new Service\Modification($client); - $params = array('originalReference' => $pspReference, 'merchantAccount' => $this->_merchantAccount); + $params = array('originalReference' => $pspReference, 'merchantAccount' => $this->merchantAccount); $result = $service->cancel($params); $this->assertEquals('[cancel-received]', $result['response']); @@ -51,7 +51,7 @@ public function testRefundModification() $modificationAmount = array('currency' => 'EUR', 'value' => '750'); $params = array( - "merchantAccount" => $this->_merchantAccount, + "merchantAccount" => $this->merchantAccount, "modificationAmount" => $modificationAmount, "reference" => $pspReference.'_refund', "originalReference" => $pspReference @@ -80,7 +80,7 @@ public function testAdjustDecreaseModification() $service = new Service\Modification($client); $params = array( - "merchantAccount" => $this->_merchantAccount, + "merchantAccount" => $this->merchantAccount, "modificationAmount" => array('currency' => 'EUR', 'value' => '750'), "reference" => $pspReference.'_adjustAuthorisation', "originalReference" => $pspReference @@ -108,7 +108,7 @@ public function testAdjustIncreaseModification() $service = new Service\Modification($client); $params = array( - "merchantAccount" => $this->_merchantAccount, + "merchantAccount" => $this->merchantAccount, "modificationAmount" => array('currency' => 'EUR', 'value' => '1600'), "reference" => $pspReference.'_adjustAuthorisation', "originalReference" => $pspReference diff --git a/tests/PayoutThirdPartyTest.php b/tests/PayoutThirdPartyTest.php index 4929f9af7..b3ca698cd 100644 --- a/tests/PayoutThirdPartyTest.php +++ b/tests/PayoutThirdPartyTest.php @@ -34,7 +34,7 @@ public function testStoreDetailAndSubmitPayoutThirdPartyMissingReference() }, "shopperEmail": "john.smith@test.com", "shopperReference": "johnsmithuniqueid", - "merchantAccount": "' . $this->_merchantAccount .'" + "merchantAccount": "' . $this->merchantAccount .'" }'; $params = json_decode($json, true); @@ -76,7 +76,7 @@ public function testStoreDetailAndSubmitPayoutThirdPartyInvalidIban() }, "shopperEmail": "john.smith@test.com", "shopperReference": "johnsmithuniqueid", - "merchantAccount": "' . $this->_merchantAccount .'" + "merchantAccount": "' . $this->merchantAccount .'" }'; $params = json_decode($json, true); @@ -112,7 +112,7 @@ public function testStoreDetailsBankSuccess() }, "shopperEmail": "john.smith@test.com", "shopperReference": "johnsmithuniqueid", - "merchantAccount": "' . $this->_merchantAccount .'" + "merchantAccount": "' . $this->merchantAccount .'" }'; $params = json_decode($json, true); @@ -158,7 +158,7 @@ public function testStoreDetailAndSubmitPayoutThirdPartySuccess() }, "shopperEmail": "john.smith@test.com", "shopperReference": "johnsmithuniqueid", - "merchantAccount": "' . $this->_merchantAccount .'" + "merchantAccount": "' . $this->merchantAccount .'" }'; $params = json_decode($json, true); @@ -200,7 +200,7 @@ public function testSubmitPayoutThirdPartySuccess() "shopperEmail": "john.smith@test.com", "shopperReference": "johnsmithuniqueid", "selectedRecurringDetailReference": "LATEST", - "merchantAccount": "' . $this->_merchantAccount .'" + "merchantAccount": "' . $this->merchantAccount .'" }'; $params = json_decode($json, true); @@ -241,7 +241,7 @@ public function testSubmitPayoutThirdPartyBadRecurringDetailReference() "shopperEmail": "john.smith@test.com", "shopperReference": "johnsmithuniqueid", "selectedRecurringDetailReference": "1234", - "merchantAccount": "' . $this->_merchantAccount .'" + "merchantAccount": "' . $this->merchantAccount .'" }'; $params = json_decode($json, true); @@ -269,7 +269,7 @@ public function testConfirmPayoutThirdPartySuccess() $service = new Service\Payout($client); $json = '{ - "merchantAccount": "' . $this->_merchantAccount .'", + "merchantAccount": "' . $this->merchantAccount .'", "originalReference": '.$submitted_payout['pspReference'].' }'; @@ -300,7 +300,7 @@ public function testConfirmPayoutThirdPartyInvalidReference() $service = new Service\Payout($client); $json = '{ - "merchantAccount": "' . $this->_merchantAccount .'", + "merchantAccount": "' . $this->merchantAccount .'", "originalReference": "" }'; @@ -328,7 +328,7 @@ public function testDeclinePayoutThirdPartySuccess() $service = new Service\Payout($client); $json = '{ - "merchantAccount": "' . $this->_merchantAccount .'", + "merchantAccount": "' . $this->merchantAccount .'", "originalReference": '.$submitted_payout['pspReference'].' }'; @@ -359,7 +359,7 @@ public function testDeclinePayoutThirdPartyInvalidReference() $service = new Service\Payout($client); $json = '{ - "merchantAccount": "' . $this->_merchantAccount .'", + "merchantAccount": "' . $this->merchantAccount .'", "originalReference": "" }'; diff --git a/tests/Resources/Account/create-account-success.json b/tests/Resources/Account/create-account-success.json new file mode 100755 index 000000000..411356e92 --- /dev/null +++ b/tests/Resources/Account/create-account-success.json @@ -0,0 +1,15 @@ +{ + "pspReference":"8815214563869136", + "submittedAsync":"false", + "accountCode":"138215709", + "accountHolderCode":"QklMTFlCT0IK", + "legalEntity":"Individual", + "accountHolderDetails":{ + "address":{ + "country":"US" + } + }, + "accountHolderStatus": { + "status": "Active" + } +} \ No newline at end of file diff --git a/tests/Resources/Fund/accountHolderBalance-success.json b/tests/Resources/Fund/accountHolderBalance-success.json new file mode 100755 index 000000000..c3daa6364 --- /dev/null +++ b/tests/Resources/Fund/accountHolderBalance-success.json @@ -0,0 +1,12 @@ +{ + "pspReference": "8815325108427618", + "resultCode": "Success", + "submittedAsync": "false", + "balancePerAccount": [ + { + "AccountDetailBalance": { + "accountCode": "128112447" + } + } + ] +} \ No newline at end of file diff --git a/tests/Resources/Fund/accountHolderTransactionList-success.json b/tests/Resources/Fund/accountHolderTransactionList-success.json new file mode 100755 index 000000000..7a0f1faac --- /dev/null +++ b/tests/Resources/Fund/accountHolderTransactionList-success.json @@ -0,0 +1,14 @@ +{ + "pspReference": "8515325109463086", + "resultCode": "Success", + "submittedAsync": "false", + "accountTransactionLists": [ + { + "AccountTransactionList": { + "accountCode": "128112447", + "hasNextPage": "false", + "transactions": [] + } + } + ] +} \ No newline at end of file diff --git a/tests/Resources/Fund/payoutAccountHolder-success.json b/tests/Resources/Fund/payoutAccountHolder-success.json new file mode 100755 index 000000000..a12481d0a --- /dev/null +++ b/tests/Resources/Fund/payoutAccountHolder-success.json @@ -0,0 +1,6 @@ +{ + "pspReference": "8515324244722662", + "submittedAsync": "false", + "merchantReference": "myreference", + "bankAccountUUID": "000b81aa-ae7e-4492-aa7e-72b2129dce0c" +} \ No newline at end of file diff --git a/tests/Resources/Fund/refundNotPaidOutTransfers-success.json b/tests/Resources/Fund/refundNotPaidOutTransfers-success.json new file mode 100755 index 000000000..cbcef409b --- /dev/null +++ b/tests/Resources/Fund/refundNotPaidOutTransfers-success.json @@ -0,0 +1,5 @@ +{ + "pspReference": "8515324244722662", + "submittedAsync": "false", + "resultCode": "Success" +} \ No newline at end of file diff --git a/tests/Resources/Fund/setupBeneficiary-success.json b/tests/Resources/Fund/setupBeneficiary-success.json new file mode 100755 index 000000000..cbcef409b --- /dev/null +++ b/tests/Resources/Fund/setupBeneficiary-success.json @@ -0,0 +1,5 @@ +{ + "pspReference": "8515324244722662", + "submittedAsync": "false", + "resultCode": "Success" +} \ No newline at end of file diff --git a/tests/Resources/Fund/transferFunds-success.json b/tests/Resources/Fund/transferFunds-success.json new file mode 100755 index 000000000..83edfa411 --- /dev/null +++ b/tests/Resources/Fund/transferFunds-success.json @@ -0,0 +1,6 @@ +{ + "pspReference": "8515324244722662", + "submittedAsync": "false", + "merchantReference": "myreference", + "resultCode": "Success" +} \ No newline at end of file diff --git a/tests/Resources/Notification/create-success.json b/tests/Resources/Notification/create-success.json new file mode 100755 index 000000000..f2f77ed4c --- /dev/null +++ b/tests/Resources/Notification/create-success.json @@ -0,0 +1,21 @@ +{ + "pspReference": "8515324239132844", + "submittedAsync": "false", + "configurationDetails": { + "active": "true", + "description": "Yolo notification 1", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_VERIFICATION", + "includeMode": "INCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notificationId": 15007, + "notifyURL": "https://www.merchant-domain.com/notification-handler", + "sendActionHeader": "true", + "sslProtocol": "SSLInsecureCiphers" + } +} \ No newline at end of file diff --git a/tests/Resources/Notification/delete-success.json b/tests/Resources/Notification/delete-success.json new file mode 100755 index 000000000..a980b045e --- /dev/null +++ b/tests/Resources/Notification/delete-success.json @@ -0,0 +1,4 @@ +{ + "pspReference": "8815324250627802", + "submittedAsync": "false" +} \ No newline at end of file diff --git a/tests/Resources/Notification/get-success.json b/tests/Resources/Notification/get-success.json new file mode 100755 index 000000000..7bb2a9225 --- /dev/null +++ b/tests/Resources/Notification/get-success.json @@ -0,0 +1,21 @@ +{ + "pspReference": "8515324244722662", + "submittedAsync": "false", + "configurationDetails": { + "active": "true", + "description": "Yolo notification 1", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_VERIFICATION", + "includeMode": "INCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notificationId": 15007, + "notifyURL": "https://www.merchant-domain.com/notification-handler", + "sendActionHeader": "true", + "sslProtocol": "SSLInsecureCiphers" + } +} \ No newline at end of file diff --git a/tests/Resources/Notification/getlist-success.json b/tests/Resources/Notification/getlist-success.json new file mode 100755 index 000000000..8a20de20a --- /dev/null +++ b/tests/Resources/Notification/getlist-success.json @@ -0,0 +1,25 @@ +{ + "pspReference": "8815324240916034", + "submittedAsync": "false", + "configurations": [ + { + "NotificationConfigurationDetails": { + "active": "true", + "description": "Yolo notification 1", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_VERIFICATION", + "includeMode": "INCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notificationId": 15007, + "notifyURL": "https://www.merchant-domain.com/notification-handler", + "sendActionHeader": "true", + "sslProtocol": "SSLInsecureCiphers" + } + } + ] +} \ No newline at end of file diff --git a/tests/Resources/Notification/test-success.json b/tests/Resources/Notification/test-success.json new file mode 100755 index 000000000..89284602d --- /dev/null +++ b/tests/Resources/Notification/test-success.json @@ -0,0 +1,26 @@ +{ + "pspReference": "8515324254564657", + "submittedAsync": "false", + "errorMessages": [ + "Failed to send message. Error description: Read timed out" + ], + "eventTypes": [ + "ACCOUNT_HOLDER_VERIFICATION" + ], + "exchangeMessages": [ + { + "ExchangeMessage": { + "messageCode": "Number", + "messageDescription": "1" + } + }, + { + "ExchangeMessage": { + "messageCode": "Title", + "messageDescription": "Test 1: Test_ACCOUNT_HOLDER_VERIFICATION" + } + } + ], + "notificationId": 15009, + "okMessages": [] +} \ No newline at end of file diff --git a/tests/Resources/Notification/update-success.json b/tests/Resources/Notification/update-success.json new file mode 100755 index 000000000..c092e9ad7 --- /dev/null +++ b/tests/Resources/Notification/update-success.json @@ -0,0 +1,27 @@ +{ + "pspReference": "8515324248243715", + "submittedAsync": "false", + "configurationDetails": { + "active": "false", + "description": "new yolo 1", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_CREATED", + "includeMode": "INCLUDE" + } + }, + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_CREATED", + "includeMode": "EXCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notificationId": 15007, + "notifyURL": "http://www.adyen.com", + "sendActionHeader": "false", + "sslProtocol": "TLSv10" + } +} \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php index 6d6764390..618cee1bb 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -5,9 +5,9 @@ class TestCase extends \PHPUnit_Framework_TestCase { - protected $_merchantAccount; - protected $_skinCode; - protected $_hmacSignature; + protected $merchantAccount; + protected $skinCode; + protected $hmacSignature; /** * Settings parsed from the config/test.ini file @@ -18,10 +18,10 @@ class TestCase extends \PHPUnit_Framework_TestCase public function __construct() { - $this->settings = $this->_loadConfigIni(); - $this->_merchantAccount = $this->getMerchantAccount(); - $this->_skinCode = $this->getSkinCode(); - $this->_hmacSignature = $this->getHmacSignature(); + $this->settings = $this->loadConfigIni(); + $this->merchantAccount = $this->getMerchantAccount(); + $this->skinCode = $this->getSkinCode(); + $this->hmacSignature = $this->getHmacSignature(); $this->setDefaultsDuringDevelopment(); } @@ -60,7 +60,7 @@ protected function createClient() $client = new \Adyen\Client(); $client->setApplicationName("My Test Application"); $client->setEnvironment(\Adyen\Environment::TEST); - $this->_skipTest("Skipped the test. Configure your WebService Username and Password in the config"); + $this->skipTest("Skipped the test. Configure your WebService Username and Password in the config"); return $client; } else { $client = new \Adyen\Client(); @@ -71,7 +71,7 @@ protected function createClient() return $client; } } else { - $this->_skipTest("Skipped the test. Configure your WebService Username and Password in the config"); + $this->skipTest("Skipped the test. Configure your WebService Username and Password in the config"); } } @@ -87,7 +87,7 @@ protected function createClientWithoutTestIni() $client->setApplicationName("My Test Application"); $client->setEnvironment(\Adyen\Environment::TEST); } catch (\Adyen\AdyenException $exception) { - $this->_skipTest($exception->getMessage()); + $this->skipTest($exception->getMessage()); } return $client; @@ -115,7 +115,7 @@ protected function createPayoutClient() $client = new \Adyen\Client(); $client->setApplicationName("My Test Application"); $client->setEnvironment(\Adyen\Environment::TEST); - $this->_skipTest("Skipped the test. Configure your WebService Payout Username and Password in the config"); + $this->skipTest("Skipped the test. Configure your WebService Payout Username and Password in the config"); return $client; } else { $client = new \Adyen\Client(); @@ -126,7 +126,7 @@ protected function createPayoutClient() return $client; } } else { - $this->_skipTest("Skipped the test. Configure your WebService Payout Username and Password in the config"); + $this->skipTest("Skipped the test. Configure your WebService Payout Username and Password in the config"); } } @@ -152,7 +152,7 @@ protected function createReviewPayoutClient() $client = new \Adyen\Client(); $client->setApplicationName("My Test Application"); $client->setEnvironment(\Adyen\Environment::TEST); - $this->_skipTest("Skipped the test. Configure your WebService ReviewPayout Username and Password in the config"); + $this->skipTest("Skipped the test. Configure your WebService ReviewPayout Username and Password in the config"); return $client; } else { $client = new \Adyen\Client(); @@ -163,7 +163,7 @@ protected function createReviewPayoutClient() return $client; } } else { - $this->_skipTest("Skipped the test. Configure your WebService ReviewPayout Username and Password in the config"); + $this->skipTest("Skipped the test. Configure your WebService ReviewPayout Username and Password in the config"); } } @@ -173,7 +173,7 @@ protected function createTerminalCloudAPIClient() $settings = $this->settings; if(!isset($settings['x-api-key']) || !isset($settings['POIID']) || $settings['x-api-key'] == 'YOUR X-API KEY' || $settings['POIID'] == 'UNIQUETERMINALID'){ - $this->_skipTest("Skipped the test. Configure your x-api-key and POIID in the config"); + $this->skipTest("Skipped the test. Configure your x-api-key and POIID in the config"); }else{ $client = new \Adyen\Client(); @@ -193,7 +193,7 @@ protected function createClientWithMerchantAccount() $settings = $this->settings; if(!isset($settings['merchantAccount']) || $settings['merchantAccount'] == 'YOUR MERCHANTACCOUNT') { - $this->_skipTest("Skipped the test. Configure your MerchantAccount in the config"); + $this->skipTest("Skipped the test. Configure your MerchantAccount in the config"); return null; } @@ -209,7 +209,7 @@ protected function createCheckoutAPIClient() $settings = $this->settings; if(!isset($settings['x-api-key']) || $settings['x-api-key'] == 'YOUR X-API KEY'){ - $this->_skipTest("Skipped the test. Configure your x-api-key"); + $this->skipTest("Skipped the test. Configure your x-api-key"); }else{ $client->setXApiKey($settings['x-api-key']); return $client; @@ -265,20 +265,20 @@ protected function getPOIID() * * @return array|bool */ - protected function _loadConfigIni() + protected function loadConfigIni() { return parse_ini_file(__DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'test.ini', true); } - protected function _skipTest($msg) + protected function skipTest($msg) { $this->markTestSkipped($msg); } - protected function _needSkinCode() { - if (!$this->_skinCode) { - $this->_skipTest("Skipped the test. Configure your SkinCode in the config"); + protected function needSkinCode() { + if (!$this->skinCode) { + $this->skipTest("Skipped the test. Configure your SkinCode in the config"); } } @@ -309,7 +309,7 @@ protected function getMethod($class, $name) { try { $class = new \ReflectionClass($class); } catch (\ReflectionException $exception) { - $this->_skipTest($exception->getMessage()); + $this->skipTest($exception->getMessage()); } $method = $class->getMethod($name);