-
Notifications
You must be signed in to change notification settings - Fork 106
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 #30 from Adyen/develop
Merge from 'Develop'
- Loading branch information
Showing
10 changed files
with
124 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,8 @@ php: | |
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- hhvm | ||
- 7.0 | ||
- 7.1 | ||
- nightly | ||
before_script: | ||
- composer install |
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
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,10 @@ | ||
<?php | ||
|
||
namespace Adyen; | ||
|
||
use Exception; | ||
|
||
class ConnectionException extends Exception | ||
{ | ||
|
||
} |
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
22 changes: 22 additions & 0 deletions
22
src/Adyen/Service/ResourceModel/Payout/ThirdParty/StoreDetail.php
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,22 @@ | ||
<?php | ||
|
||
namespace Adyen\Service\ResourceModel\Payout\ThirdParty; | ||
|
||
class StoreDetail extends \Adyen\Service\AbstractResource | ||
{ | ||
protected $_requiredFields = array( | ||
'merchantAccount', | ||
'recurring.contract', | ||
'shopperEmail', | ||
'shopperReference' | ||
); | ||
|
||
protected $_endpoint; | ||
|
||
public function __construct($service) | ||
{ | ||
$this->_endpoint = $service->getClient()->getConfig()->get('endpoint') . '/pal/servlet/Payout/' . $service->getClient()->getApiVersion() . '/storeDetail'; | ||
parent::__construct($service, $this->_endpoint, $this->_requiredFields); | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -134,6 +134,47 @@ public function testStoreDetailAndSubmitPayoutThirdPartyInvalidIban() | |
$this->assertEquals('Adyen\AdyenException', get_class($e)); | ||
$this->assertEquals('Invalid iban', $e->getMessage()); | ||
} | ||
|
||
public function testStoreDetailsBankSuccess() | ||
{ | ||
// initialize client | ||
$client = $this->createPayoutClient(); | ||
|
||
// initialize service | ||
$service = new Service\Payout($client); | ||
|
||
$json = '{ | ||
"bank": { | ||
"iban": "FR14 2004 1010 0505 0001 3M02 606", | ||
"ownerName": "John Smith", | ||
"countryCode": "FR" | ||
}, | ||
"recurring": { | ||
"contract": "PAYOUT" | ||
}, | ||
"shopperEmail": "[email protected]", | ||
"shopperReference": "johnsmithuniqueid", | ||
"merchantAccount": "' . $this->_merchantAccount .'" | ||
}'; | ||
|
||
$params = json_decode($json, true); | ||
|
||
try { | ||
$result = $service->storeDetail($params); | ||
} catch (\Exception $e) { | ||
$this->validateApiPermission($e); | ||
} | ||
|
||
// must exists | ||
$this->assertTrue(isset($result['resultCode'])); | ||
|
||
// Assert | ||
$this->assertEquals('Success', $result['resultCode']); | ||
|
||
// return the result so this can be used in other test cases | ||
return $result; | ||
|
||
} | ||
|
||
public function testStoreDetailAndSubmitPayoutThirdPartySuccess() | ||
{ | ||
|