-
Notifications
You must be signed in to change notification settings - Fork 30
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 #17 from DennisHendrickx/master
Added support for iDeal issuer
- Loading branch information
Showing
7 changed files
with
144 additions
and
2 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,22 @@ | ||
<?php | ||
|
||
namespace Omnipay\Buckaroo\Message; | ||
|
||
/** | ||
* Buckaroo Purchase Request. | ||
* | ||
* With this purchase request Buckaroo will show all payment options configured for the website (websiteKey). | ||
* The user must choose the payment method on the Buckaroo page. | ||
*/ | ||
class PurchaseRequest extends AbstractRequest | ||
{ | ||
public function getData() | ||
{ | ||
$data = parent::getData(); | ||
unset($data['Brq_payment_method']); | ||
unset($data['Brq_service_ideal_issuer']); | ||
unset($data['Brq_requestedservices']); | ||
|
||
return $data; | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace Omnipay\Buckaroo; | ||
|
||
use Omnipay\Tests\GatewayTestCase; | ||
|
||
class BuckarooGatewayTest extends GatewayTestCase | ||
{ | ||
/** | ||
* @var BuckarooGateway | ||
*/ | ||
protected $gateway; | ||
|
||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
$this->gateway = new BuckarooGateway($this->getHttpClient(), $this->getHttpRequest()); | ||
} | ||
|
||
public function testPurchase() | ||
{ | ||
$request = $this->gateway->purchase(array('amount' => '10.00')); | ||
|
||
$this->assertInstanceOf('Omnipay\Buckaroo\Message\PurchaseRequest', $request); | ||
$this->assertSame('10.00', $request->getAmount()); | ||
} | ||
} |
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,57 @@ | ||
<?php | ||
|
||
namespace Omnipay\Buckaroo\Message; | ||
|
||
use Omnipay\Tests\TestCase; | ||
|
||
class PurchaseRequestTest extends TestCase | ||
{ | ||
/** | ||
* @var PurchaseRequest | ||
*/ | ||
protected $request; | ||
|
||
public function setUp() | ||
{ | ||
$this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); | ||
$this->request->initialize( | ||
array( | ||
'websiteKey' => 'web', | ||
'secretKey' => 'secret', | ||
'amount' => '12.00', | ||
'returnUrl' => 'https://www.example.com/return', | ||
) | ||
); | ||
} | ||
|
||
public function testGetData() | ||
{ | ||
$this->request->initialize(array( | ||
'websiteKey' => 'web', | ||
'secretKey' => 'secret', | ||
'amount' => '12.00', | ||
'currency' => 'EUR', | ||
'testMode' => true, | ||
'transactionId' => 13, | ||
'returnUrl' => 'https://www.example.com/return', | ||
'cancelUrl' => 'https://www.example.com/cancel', | ||
'culture' => 'nl-NL', | ||
'paymentMethod' => 'mastercard', | ||
'issuer' => 'RABONL2U', | ||
)); | ||
|
||
$data = $this->request->getData(); | ||
|
||
$this->assertSame('web', $data['Brq_websitekey']); | ||
$this->assertSame('12.00', $data['Brq_amount']); | ||
$this->assertSame('EUR', $data['Brq_currency']); | ||
$this->assertSame(13, $data['Brq_invoicenumber']); | ||
$this->assertSame('https://www.example.com/return', $data['Brq_return']); | ||
$this->assertSame('https://www.example.com/cancel', $data['Brq_returncancel']); | ||
$this->assertSame('nl-NL', $data['Brq_culture']); | ||
|
||
$this->assertNotContains('Brq_payment_method', $data); | ||
$this->assertNotContains('Brq_service_ideal_issuer', $data); | ||
$this->assertNotContains('Brq_requestedservices', $data); | ||
} | ||
} |