Skip to content

Commit

Permalink
Merge pull request #87 from Adyen/develop
Browse files Browse the repository at this point in the history
Release version 1.5.3
  • Loading branch information
Aleffio authored Nov 19, 2018
2 parents 9f35128 + 742885a commit 5d8cad3
Show file tree
Hide file tree
Showing 48 changed files with 1,462 additions and 1,080 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ $client = new \Adyen\Client();
$client->setApplicationName("Adyen PHP Api Library Example");
$client->setUsername("YOUR USERNAME");
$client->setPassword("YOUR PASSWORD");
$client->setXApiKey("YOUR API KEY");
$client->setEnvironment(\Adyen\Environment::TEST);

$service = new Service\Payment($client);
$service = new \Adyen\Service\Payment($client);

$json = '{
"card": {
"number": "4111111111111111",
"expiryMonth": "6",
"expiryYear": "2016",
"expiryMonth": "10",
"expiryYear": "2020",
"cvc": "737",
"holderName": "John Smith"
},
Expand Down Expand Up @@ -92,10 +93,11 @@ $client = new \Adyen\Client();
$client->setApplicationName("Adyen PHP Api Library Example");
$client->setUsername("YOUR USERNAME");
$client->setPassword("YOUR PASSWORD");
$client->setXApiKey("YOUR API KEY");
$client->setEnvironment(\Adyen\Environment::TEST);

// intialize modification service
$service = new Service\Modification($client);
$service = new \Adyen\Service\Modification($client);

// set the amount you want to refund
$modificationAmount = array('currency' => 'CURRENCY', 'value' => 'VALUE');
Expand Down
71 changes: 39 additions & 32 deletions src/Adyen/AdyenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,47 @@

class AdyenException extends Exception
{
/**
* @var null
*/
protected $_status;

protected $_status;
protected $_errorType;
/**
* @var null
*/
protected $_errorType;

/**
* AdyenException constructor.
* @param string $message
* @param int $code
* @param Exception|null $previous
* @param null $status
* @param null $errorType
*/
public function __construct($message = "", $code = 0, Exception $previous = null, $status = null, $errorType = null)
{
$this->_status = $status;
$this->_errorType = $errorType;
parent::__construct($message, (int) $code, $previous);
}
/**
* AdyenException constructor.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
* @param null $status
* @param null $errorType
*/
public function __construct($message = "", $code = 0, Exception $previous = null, $status = null, $errorType = null)
{
$this->_status = $status;
$this->_errorType = $errorType;
parent::__construct($message, (int)$code, $previous);
}

/**
* Get status
*
* @return null
*/
public function getStatus()
{
return $this->_status;
}
/**
* Get status
*
* @return null
*/
public function getStatus()
{
return $this->_status;
}

/**
* Get Adyen Error type
*/
public function getErrorType()
{
return $this->_errorType;
}
/**
* Get Adyen Error type
*/
public function getErrorType()
{
return $this->_errorType;
}
}
8 changes: 5 additions & 3 deletions src/Adyen/ApiKeyAuthenticatedService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

namespace Adyen;


class ApiKeyAuthenticatedService extends Service
{
protected $_requiresApiKey = true;
}
/**
* @var bool
*/
protected $_requiresApiKey = true;
}
Loading

0 comments on commit 5d8cad3

Please sign in to comment.