Skip to content

Commit

Permalink
Merge pull request #82 from Adyen/PW-694
Browse files Browse the repository at this point in the history
PW-694 Update API_VERSION in the library and separate the payments and payouts versions
  • Loading branch information
cyattilakiss authored Oct 31, 2018
2 parents c4e32b0 + 81c6155 commit 6e369a6
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 20 deletions.
19 changes: 15 additions & 4 deletions src/Adyen/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Client
const ENDPOINT_LIVE_SUFFIX = "-pal-live.adyenpayments.com";
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_VERSION = "v30";
const API_PAYMENT_VERSION = "v40";
const API_PAYOUT_VERSION = "v30";
const API_RECURRING_VERSION = "v25";
const API_CHECKOUT_VERSION = "v32";
const API_CHECKOUT_UTILITY_VERSION = "v1";
Expand Down Expand Up @@ -224,15 +225,25 @@ public function getLibraryVersion()
}

/**
* Get the version of the API endpoint
* Get the version of the API Payment endpoint
*
* @return string
*/
public function getApiVersion()
public function getApiPaymentVersion()
{
return self::API_VERSION;
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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion().'/adjustAuthorisation';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint').'/pal/servlet/Payment/'.$service->getClient()->getApiPaymentVersion().'/adjustAuthorisation';
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo);
}
}
2 changes: 1 addition & 1 deletion src/Adyen/Service/ResourceModel/Modification/Cancel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/cancel';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/cancel';
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/cancelOrRefund';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/'. $service->getClient()->getApiPaymentVersion() . '/cancelOrRefund';
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo);
}
}
2 changes: 1 addition & 1 deletion src/Adyen/Service/ResourceModel/Modification/Capture.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/capture';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/capture';
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo);
}
}
2 changes: 1 addition & 1 deletion src/Adyen/Service/ResourceModel/Modification/Refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/refund';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/refund';
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo);
}
}
2 changes: 1 addition & 1 deletion src/Adyen/Service/ResourceModel/Payment/Authorise.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/authorise';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/authorise';
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo);
}
}
2 changes: 1 addition & 1 deletion src/Adyen/Service/ResourceModel/Payment/Authorise3D.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/authorise3d';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/authorise3d';
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo);
}
}
2 changes: 1 addition & 1 deletion src/Adyen/Service/ResourceModel/Payout/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/confirm';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/confirm';
parent::__construct($service, $this->_endpoint);
}
}
2 changes: 1 addition & 1 deletion src/Adyen/Service/ResourceModel/Payout/Decline.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/decline';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/decline';
parent::__construct($service, $this->_endpoint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/storeDetailAndSubmit';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/storeDetailAndSubmit';
parent::__construct($service, $this->_endpoint);
}
}
2 changes: 1 addition & 1 deletion src/Adyen/Service/ResourceModel/Payout/Submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/submit';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/submit';
parent::__construct($service, $this->_endpoint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/confirmThirdParty';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/confirmThirdParty';
parent::__construct($service, $this->_endpoint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/declineThirdParty';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/declineThirdParty';
parent::__construct($service, $this->_endpoint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/storeDetail';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/storeDetail';
parent::__construct($service, $this->_endpoint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/storeDetailAndSubmitThirdParty';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/storeDetailAndSubmitThirdParty';
parent::__construct($service, $this->_endpoint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()->getApiVersion() . '/submitThirdParty';
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiPayoutVersion() . '/submitThirdParty';
parent::__construct($service, $this->_endpoint);
}
}

0 comments on commit 6e369a6

Please sign in to comment.