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

Adding Get3dsAvailability into BinLookup directory #103

Merged
merged 14 commits into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Adyen/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Client
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_PAYMENT_VERSION = "v40";
const API_BIN_LOOKUP_VERSION = "v40";
const API_PAYOUT_VERSION = "v30";
const API_RECURRING_VERSION = "v25";
const API_CHECKOUT_VERSION = "v41";
Expand Down Expand Up @@ -269,6 +270,16 @@ public function getApiPaymentVersion()
return self::API_PAYMENT_VERSION;
}

/**
* Get the version of the API BinLookUp endpoint
*
* @return string
*/
public function getApiBinLookupVersion()
{
return self::API_BIN_LOOKUP_VERSION;
}

/**
* Get the version of the API Payout endpoint
*
Expand Down
35 changes: 35 additions & 0 deletions src/Adyen/Service/BinLookup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Adyen\Service;

class BinLookup extends \Adyen\Service
{
/**
* @var ResourceModel\BinLookup\Get3dsAvailability
*/
protected $get3dsAvailability;

/**
* Payment constructor.
*
* @param \Adyen\Client $client
* @throws \Adyen\AdyenException
*/
public function __construct(\Adyen\Client $client)
{
parent::__construct($client);
$this->get3dsAvailability = new \Adyen\Service\ResourceModel\BinLookup\Get3dsAvailability($this);
}


/**
* @param $params
* @return mixed
* @throws \Adyen\AdyenException
*/
public function get3dsAvailability($params)
{
$result = $this->get3dsAvailability->request($params);
return $result;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Adyen\Service\ResourceModel\BinLookup;

class Get3dsAvailability extends \Adyen\Service\AbstractResource
{
/**
* @var string
*/
protected $endpoint;

/**
* Include applicationInfo key in the request parameters
*
* @var bool
*/
protected $allowApplicationInfo = true;
fabricioblz marked this conversation as resolved.
Show resolved Hide resolved

/**
* Authorise constructor.
*
* @param \Adyen\Service $service
*/
public function __construct($service)
{
$this->endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/BinLookup/' . $service->getClient()->getApiBinLookupVersion() . 'get3dsAvailability';
fabricioblz marked this conversation as resolved.
Show resolved Hide resolved
parent::__construct($service, $this->endpoint, $this->allowApplicationInfo);
}
}