Open prilka opened 6 years ago
I encountered this too, with my own default parameters that used a getter that manipulates what it returns. The currency happens to be a built-in example, but it's not the only one. The short-term solution will be to remove the currency from the list of default values, which I realise is not ideal.
Ah, here we go, mentioned along with a related issue with default parameters (they bypass the validate()
checks:
https://github.com/thephpleague/omnipay-common/issues/192#issuecomment-407334382
I implemented a similar solution only in my tests. But it's a pain to override all the buggy core-tests. In my opinion, the tests make no sense inside the base class.
This assertion in GatewayTestCase::testDefaultParametersHaveMatchingMethods() will fail for the parameter
currency
https://github.com/thephpleague/omnipay-tests/blob/599d41855be3c284e37417215add14426363491e/src/GatewayTestCase.php#L51The reason is the
strtoupper()
in AbstractGateway::getCurrency()The message will look like this
To reproduce this, simply create a gateway with the key
currency
in hisgetDefaultParameters()
-Result.