Skip to content

Commit

Permalink
Update API version to v18, Update lib version to upcoming 1.1.0 versi…
Browse files Browse the repository at this point in the history
…on and add ConfigInterface if you want to use a custom config object
  • Loading branch information
rikterbeek committed Oct 26, 2016
1 parent d3831a0 commit 2e283af
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
16 changes: 9 additions & 7 deletions src/Adyen/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

class Client
{
const LIB_VERSION = "0.1.0";
const LIB_VERSION = "1.1.0";
const USER_AGENT_SUFFIX = "adyen-php-api-library/";
const ENDPOINT_TEST = "https://pal-test.adyen.com";
const ENDPOINT_LIVE = "https://pal-live.adyen.com";
const ENPOINT_TEST_DIRECTORY_LOOKUP = "https://test.adyen.com/hpp/directory.shtml";
const ENPOINT_LIVE_DIRECTORY_LOOKUP = "https://live.adyen.com/hpp/directory.shtml";
const API_VERSION = "v12";
const API_VERSION = "v18";

/**
* @var Adyen_Config $config
Expand All @@ -27,17 +27,20 @@ class Client
*/
private $logger;


/**
* @param $config
* Client constructor.
* @param null $config
* @throws AdyenException
*/
public function __construct($config = null)
{
if(!$config) {
if (!$config) {
// create config
$this->_config = new \Adyen\Config();
}else {
}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");
}
}

Expand All @@ -46,7 +49,6 @@ public function getConfig()
return $this->_config;
}


/**
* Set Username of Web Service User
*
Expand Down
2 changes: 1 addition & 1 deletion src/Adyen/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Adyen;

class Config
class Config implements ConfigInterface
{

/** @var array */
Expand Down
14 changes: 14 additions & 0 deletions src/Adyen/ConfigInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Adyen;

Interface ConfigInterface {

public function getUsername();
public function getPassword();
public function get($param);
public function getInputType();
public function getOutputType();
public function getMerchantAccount();

}

0 comments on commit 2e283af

Please sign in to comment.