Skip to content

Commit a4ca1c6

Browse files
author
Islam
authored
Merge pull request #3 from khandurdyiev/fix-json-serialize-keys-in-statement
fix json serialize keys in statement entity
2 parents 862abca + 20b66a8 commit a4ca1c6

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
php: [ 7.4, 8.0 ]
1616

17-
name: P${{ matrix.php }}
17+
name: PHP ${{ matrix.php }}
1818

1919
steps:
2020
- name: Checkout

src/Entities/ClientInfo/ClientInfo.php

+10-5
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ public function getAccounts(): AccountCollection
5656
return $this->accounts;
5757
}
5858

59+
public function getPermissions(): string
60+
{
61+
return $this->permissions;
62+
}
63+
5964
/**
6065
* @param array<string, mixed> $clientInfo
6166
*
@@ -72,11 +77,11 @@ public function getAccountCollection(array $clientInfo): AccountCollection
7277
public function jsonSerialize()
7378
{
7479
return [
75-
'id' => $this->id,
76-
'name' => $this->name,
77-
'webhook_url' => $this->webHookUrl,
78-
'permissions' => $this->permissions,
79-
'accounts' => $this->accounts
80+
'id' => $this->getId(),
81+
'name' => $this->getName(),
82+
'webhook_url' => $this->getWebHookUrl(),
83+
'permissions' => $this->getPermissions(),
84+
'accounts' => $this->getAccounts()
8085
];
8186
}
8287
}

src/Entities/Statement/Statement.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ public function jsonSerialize()
149149
'mcc' => $this->getMcc(),
150150
'hold' => $this->isHold(),
151151
'amount' => $this->getAmount(),
152-
'operationAmount' => $this->getOperationAmount(),
153-
'currencyCode' => $this->getCurrencyCode(),
154-
'commissionRate' => $this->getCommissionRate(),
155-
'cashbackAmount' => $this->getCashbackAmount(),
156-
'balance' => $this->getDescription(),
157-
'comment' => $this->getBalance(),
158-
'receiptId' => $this->getReceiptId(),
159-
'counterEdrpou' => $this->getCounterEdrpou(),
160-
'counterIban' => $this->getCounterIban(),
152+
'operation_amount' => $this->getOperationAmount(),
153+
'currency_code' => $this->getCurrencyCode(),
154+
'commission_rate' => $this->getCommissionRate(),
155+
'cashback_amount' => $this->getCashbackAmount(),
156+
'balance' => $this->getBalance(),
157+
'comment' => $this->getComment(),
158+
'receipt_id' => $this->getReceiptId(),
159+
'counter_edrpou' => $this->getCounterEdrpou(),
160+
'counter_iban' => $this->getCounterIban(),
161161
];
162162
}
163163
}

0 commit comments

Comments
 (0)