diff --git a/.travis.yml b/.travis.yml index 651e42b..aafa6e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ php: # This triggers builds to run on the new TravisCI infrastructure. # See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/ sudo: false + ## Cache composer cache: directories: diff --git a/src/Traits/HasGatewayParams.php b/src/Traits/HasGatewayParams.php index 8b32b5e..c06753a 100644 --- a/src/Traits/HasGatewayParams.php +++ b/src/Traits/HasGatewayParams.php @@ -8,6 +8,7 @@ */ use Omnipay\Payone\AbstractShopGateway; +use Omnipay\Common\Exception\InvalidRequestException; trait HasGatewayParams { diff --git a/tests/ShopServerGatewayTest.php b/tests/ShopServerGatewayTest.php index d9cb978..3be7181 100644 --- a/tests/ShopServerGatewayTest.php +++ b/tests/ShopServerGatewayTest.php @@ -3,6 +3,7 @@ namespace Omnipay\Payone; use Omnipay\Tests\GatewayTestCase; +//use Omnipay\Common\Exception\InvalidRequestException; class ShopServerGatewayTest extends GatewayTestCase { @@ -220,4 +221,15 @@ public function testPurchaseFailure() $this->assertSame('Invalid card expiry date. Please verify your card data.', $response->getCustomerMessage()); $this->assertNull($response->getTransactionReference()); } + + /** + * See https://github.com/academe/OmniPay-Payone/issues/31 + * @expectedException Omnipay\Common\Exception\InvalidRequestException + */ + public function testInvalidMerchantId() + { + $this->gateway->initialize([ + 'merchantId' => 'abcdef', + ]); + } }