-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from Adyen/develop
Release 1.5.4
- Loading branch information
Showing
6 changed files
with
130 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Adyen\Service\ResourceModel\Payment; | ||
|
||
class Authorise3DS2 extends \Adyen\Service\AbstractResource | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $_endpoint; | ||
|
||
/** | ||
* Include applicationInfo key in the request parameters | ||
* | ||
* @var bool | ||
*/ | ||
protected $allowApplicationInfo = true; | ||
|
||
/** | ||
* Authorise3DS2 constructor. | ||
* | ||
* @param \Adyen\Service $service | ||
*/ | ||
public function __construct($service) | ||
{ | ||
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payment/' . $service->getClient()->getApiPaymentVersion() . '/authorise3ds2'; | ||
parent::__construct($service, $this->_endpoint, $this->allowApplicationInfo); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
namespace Adyen; | ||
|
||
use Adyen\Util\Util; | ||
|
||
class CheckoutTest extends TestCase | ||
{ | ||
public function testPaymentMethods() | ||
{ | ||
$client = $this->createCheckoutAPIClient(); | ||
|
||
$service = new Service\Checkout($client); | ||
|
||
$params = array( | ||
'amount' => 1000, | ||
'countryCode' => 'NL', | ||
'shopperLocale' => 'nl_NL', | ||
'merchantAccount' => $this->_merchantAccount, | ||
); | ||
|
||
$result = $service->paymentMethods($params); | ||
|
||
$this->assertInternalType('array',$result); | ||
|
||
// needs to have Ideal in result because country is netherlands | ||
$hasIdeal = false; | ||
foreach($result['paymentMethods'] as $paymentMethod) { | ||
if($paymentMethod['type'] == 'ideal') { | ||
$hasIdeal = true; | ||
} | ||
} | ||
|
||
$this->assertEquals(true, $hasIdeal); | ||
} | ||
|
||
public function testBlockedPaymentMethods() | ||
{ | ||
$client = $this->createCheckoutAPIClient(); | ||
|
||
$service = new Service\Checkout($client); | ||
|
||
$params = array( | ||
'amount' => 1000, | ||
'countryCode' => 'NL', | ||
'shopperLocale' => 'nl_NL', | ||
'merchantAccount' => $this->_merchantAccount, | ||
'blockedPaymentMethods' => array('ideal'), | ||
); | ||
|
||
$result = $service->paymentMethods($params); | ||
|
||
$this->assertInternalType('array',$result); | ||
|
||
$hasIdeal = false; | ||
foreach($result['paymentMethods'] as $paymentMethod) { | ||
if($paymentMethod['type'] == 'ideal') { | ||
$hasIdeal = true; | ||
} | ||
} | ||
|
||
$this->assertFalse($hasIdeal); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters