Skip to content

Commit

Permalink
Merge pull request #4 from vldmr-k/fix/cancel-list-is-not-set
Browse files Browse the repository at this point in the history
Fix bug with not-set key
  • Loading branch information
vldmr-k authored Oct 16, 2022
2 parents b27895a + ca555b7 commit 195b979
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions src/Mapper/Invoice/StatusMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ public function jsonToObject(string $jsonString): InvoiceStatus
$item['status'],
$item['createdDate'],
$item['modifiedDate'],
$item['amount'],
$item['ccy'],
$item['approvalCode'],
$item['rrn'],
$item['extRef']
$item['amount'] ?? 0,
$item['ccy'] ?? 0,
$item['approvalCode'] ?? null,
$item['rrn'] ?? null,
$item['extRef'] ?? null
);
}, $data['cancelList'] ?? []);

$output = new InvoiceStatus(
$data['invoiceId'],
$data['status'],
$data['amount'],
$data['ccy'],
$data['finalAmount'],
$data['reference'],
$data['createdDate'],
$data['modifiedDate'],
$data['failureReason'],
$data['amount'] ?? 0,
$data['ccy'] ?? 0,
$data['finalAmount'] ?? 0,
$data['reference'] ?? null,
$data['createdDate'] ?? null,
$data['modifiedDate'] ?? null,
$data['failureReason'] ?? null,
$cancelList
);

Expand Down
12 changes: 6 additions & 6 deletions src/Mapper/StatementMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public function jsonToObject(string $jsonString): Statement
$item['maskedPan'],
$item['date'],
$item['paymentScheme'],
$item['amount'],
$item['profitAmount'],
$item['ccy'],
$item['approvalCode'],
$item['rrn'],
$item['reference'],
$item['amount'] ?? 0,
$item['profitAmount'] ?? 0,
$item['ccy'] ?? 0,
$item['approvalCode'] ?? null,
$item['rrn'] ?? null,
$item['reference'] ?? null,
$cancelList
);

Expand Down

0 comments on commit 195b979

Please sign in to comment.