-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PW-562 Add applicationInformation into PHP API library #77
Conversation
is any parameter in the request which you don't want to send towards the specified API endpoint - PHP Doc blocks added - Unit tests added
If the applicationInfo should be in the request then fill the default data
Hi @cyattilakiss, I would do it the opposite way so if a new resources are added it is by default not used. So allowApplicationInfo = true on the resource where we allow it and on the AbstractResource put the default on false. Regards, |
public function __construct($service) | ||
{ | ||
$this->_endpoint = $this->getCheckoutEndpoint($service) .'/'. $service->getClient()->getApiCheckoutVersion() . '/payments/details'; | ||
parent::__construct($service, $this->_endpoint); | ||
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be false as this endpoint does not support it.
public function __construct($service) | ||
{ | ||
$this->_endpoint = $this->getCheckoutEndpoint($service) .'/'. $service->getClient()->getApiCheckoutVersion() . '/payments/result'; | ||
parent::__construct($service, $this->_endpoint); | ||
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be false as this endpoint does not support it.
src/Adyen/Client.php
Outdated
*/ | ||
public function setExternalPlatform($name, $version) | ||
{ | ||
$this->_config->set('externalPlatform', array('name' => $name, 'version' => $version)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externalPlatform has three fields. I am seeing integrator field is missing. Is this intentional ?
applicationInfo.externalPlatform Unit tests added
tests/Unit/AbstractResourceTest.php
Outdated
public function testHandleApplicationInfoInRequestShouldRemoveApplicationInfoFromParams() | ||
{ | ||
$params = array( | ||
"topLevelKey" => "test", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed, shall we better remove the "topLevelKey" since we don't use it?
Description
Adding filterParameters in the resources where you can define if there
is any parameter in the request which you don't want to send towards the
specified API endpoint
Tested scenarios
Unit tests added