Skip to content

Commit

Permalink
Fix bug with not-set key
Browse files Browse the repository at this point in the history
  • Loading branch information
vldmr-k committed Oct 16, 2022
1 parent cef6f8c commit ca555b7
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 ca555b7

Please sign in to comment.