File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/Omnipay/Common/Message
tests/Omnipay/Common/Message Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,10 @@ public function getCurrency()
383
383
*/
384
384
public function setCurrency ($ value )
385
385
{
386
- return $ this ->setParameter ('currency ' , strtoupper ($ value ));
386
+ if ($ value !== null ) {
387
+ $ value = strtoupper ($ value );
388
+ }
389
+ return $ this ->setParameter ('currency ' , $ value );
387
390
}
388
391
389
392
/**
Original file line number Diff line number Diff line change @@ -270,6 +270,12 @@ public function testCurrencyLowercase()
270
270
$ this ->assertSame ('USD ' , $ this ->request ->getCurrency ());
271
271
}
272
272
273
+ public function testCurrencyNull ()
274
+ {
275
+ $ this ->assertSame ($ this ->request , $ this ->request ->setCurrency (null ));
276
+ $ this ->assertNull ($ this ->request ->getCurrency ());
277
+ }
278
+
273
279
public function testCurrencyNumeric ()
274
280
{
275
281
$ this ->assertSame ($ this ->request , $ this ->request ->setCurrency ('USD ' ));
You can’t perform that action at this time.
0 commit comments