Skip to content

Commit 65d39f3

Browse files
committed
Check for null, not falsy
1 parent c37be45 commit 65d39f3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Message/AuthorizeRequest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public function getData()
4343
];
4444

4545
// Remove null values
46-
$data = array_filter($data);
46+
$data = array_filter($data, function($value){
47+
return ! is_null($value);
48+
});
4749

4850
$data += $this->getCardData();
4951

tests/Message/AuthorizeRequestTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public function setUp()
2222
'token' => 'abc123',
2323
'transactionId' => '684',
2424
'testMode' => false,
25+
'taxExempt' => false,
2526
'card' => [
2627
'firstName' => 'Kayla',
2728
'shippingCompany' => 'League',
@@ -40,6 +41,7 @@ public function testGetData()
4041
$this->assertSame('Kayla', $data['billing']['firstName']);
4142
$this->assertSame('League', $data['shipping']['company']);
4243
$this->assertFalse($data['options']['submitForSettlement']);
44+
$this->assertFalse($data['taxExempt']);
4345

4446
// Check empty values are not sent
4547
$this->assertFalse(isset($data['billingAddressId']));

0 commit comments

Comments
 (0)