-
Notifications
You must be signed in to change notification settings - Fork 78
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 #91 from academe/pr39
Support SurchargeXML field
- Loading branch information
Showing
6 changed files
with
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.1 | ||
- hhvm | ||
|
||
before_script: | ||
|
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
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,46 @@ | ||
<?php | ||
|
||
namespace Omnipay\SagePay\Message; | ||
|
||
use Omnipay\Tests\TestCase; | ||
|
||
class ServerPurchaseRequestTest extends TestCase | ||
{ | ||
|
||
const SURCHARGE_XML = '<surcharges><surcharge><paymentType>VISA</paymentType><percentage>2.50</percentage></surcharge></surcharges>'; | ||
|
||
public function testInitialize() | ||
{ | ||
$request = new ServerPurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); | ||
$request->initialize( | ||
array( | ||
'returnUrl' => 'http://www.example.com/return', | ||
'amount' => '12.00', | ||
'transactionId' => '123', | ||
'surchargeXml' => self::SURCHARGE_XML, | ||
'card' => $this->getValidCard(), | ||
) | ||
); | ||
|
||
$data = $request->getData(); | ||
} | ||
|
||
public function testSetSurchargeXml() | ||
{ | ||
$request = new ServerPurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); | ||
$request->initialize( | ||
array( | ||
'returnUrl' => 'https://www.example.com/return', | ||
'amount' => '12.00', | ||
'transactionId' => '123', | ||
'card' => $this->getValidCard(), | ||
) | ||
); | ||
|
||
$request->setSurchargeXml(self::SURCHARGE_XML); | ||
|
||
$data = $request->getData(); | ||
$this->assertSame(self::SURCHARGE_XML, $data['surchargeXml']); | ||
} | ||
|
||
} |