Skip to content
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

Merged
merged 7 commits into from
Oct 19, 2018
Merged

Conversation

cyattilakiss
Copy link
Contributor

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

  • PHP Doc blocks added

Tested scenarios
Unit tests added

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
@rikterbeek
Copy link
Contributor

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,
Rik
Adyen

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);
Copy link
Contributor

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);
Copy link
Contributor

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 setExternalPlatform($name, $version)
{
$this->_config->set('externalPlatform', array('name' => $name, 'version' => $version));
Copy link
Contributor

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
public function testHandleApplicationInfoInRequestShouldRemoveApplicationInfoFromParams()
{
$params = array(
"topLevelKey" => "test",
Copy link
Contributor

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?

@rikterbeek rikterbeek merged commit fbae79c into develop Oct 19, 2018
@cyattilakiss cyattilakiss deleted the PW-562 branch January 9, 2019 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants