Skip to content

Commit

Permalink
Merge pull request #3 from khandurdyiev/fix-json-serialize-keys-in-st…
Browse files Browse the repository at this point in the history
…atement

fix json serialize keys in statement entity
  • Loading branch information
Islam authored Feb 28, 2021
2 parents 862abca + 20b66a8 commit a4ca1c6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
php: [ 7.4, 8.0 ]

name: P${{ matrix.php }}
name: PHP ${{ matrix.php }}

steps:
- name: Checkout
Expand Down
15 changes: 10 additions & 5 deletions src/Entities/ClientInfo/ClientInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public function getAccounts(): AccountCollection
return $this->accounts;
}

public function getPermissions(): string
{
return $this->permissions;
}

/**
* @param array<string, mixed> $clientInfo
*
Expand All @@ -72,11 +77,11 @@ public function getAccountCollection(array $clientInfo): AccountCollection
public function jsonSerialize()
{
return [
'id' => $this->id,
'name' => $this->name,
'webhook_url' => $this->webHookUrl,
'permissions' => $this->permissions,
'accounts' => $this->accounts
'id' => $this->getId(),
'name' => $this->getName(),
'webhook_url' => $this->getWebHookUrl(),
'permissions' => $this->getPermissions(),
'accounts' => $this->getAccounts()
];
}
}
18 changes: 9 additions & 9 deletions src/Entities/Statement/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ public function jsonSerialize()
'mcc' => $this->getMcc(),
'hold' => $this->isHold(),
'amount' => $this->getAmount(),
'operationAmount' => $this->getOperationAmount(),
'currencyCode' => $this->getCurrencyCode(),
'commissionRate' => $this->getCommissionRate(),
'cashbackAmount' => $this->getCashbackAmount(),
'balance' => $this->getDescription(),
'comment' => $this->getBalance(),
'receiptId' => $this->getReceiptId(),
'counterEdrpou' => $this->getCounterEdrpou(),
'counterIban' => $this->getCounterIban(),
'operation_amount' => $this->getOperationAmount(),
'currency_code' => $this->getCurrencyCode(),
'commission_rate' => $this->getCommissionRate(),
'cashback_amount' => $this->getCashbackAmount(),
'balance' => $this->getBalance(),
'comment' => $this->getComment(),
'receipt_id' => $this->getReceiptId(),
'counter_edrpou' => $this->getCounterEdrpou(),
'counter_iban' => $this->getCounterIban(),
];
}
}

0 comments on commit a4ca1c6

Please sign in to comment.