BarobillAccountAdapter.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\ThirdPartyApi\Barobill\Adapter;
  3. use App\ThirdPartyApi\Barobill\Services\BarobillAccountService;
  4. use App\ThirdPartyApi\Interfaces\AccountInterface;
  5. class BarobillAccountAdapter implements AccountInterface
  6. {
  7. private $barobillAccountService;
  8. public function __construct(BarobillAccountService $barobillAccountService)
  9. {
  10. $this->barobillAccountService = $barobillAccountService;
  11. }
  12. public function getDailyBankAccountLog
  13. (
  14. $bankAccountNum,
  15. $baseDate,
  16. $countPerPage = 10,
  17. $currentPage = 1,
  18. $orderDirection = 1
  19. )
  20. {
  21. $accountInfo = $this->barobillAccountService->getDailyBankAccountLog
  22. (
  23. $bankAccountNum,
  24. $baseDate,
  25. $countPerPage,
  26. $currentPage,
  27. $orderDirection
  28. );
  29. $bankAccountLog = $accountInfo['BankAccountLogList']['BankAccountLog'];
  30. return collect($bankAccountLog)->map(function ($log) {
  31. return [
  32. 'BankAccountNum' => $log['BankAccountNum'],
  33. 'Withdraw' => $log['Withdraw'],
  34. 'Deposit' => $log['Deposit'],
  35. 'Balance' => $log['Balance'],
  36. 'TransDT' => $log['TransDT'],
  37. 'TransType' => $log['TransType'],
  38. 'TransOffice' => $log['TransOffice'],
  39. 'TransRemark' => $log['TransRemark'],
  40. ];
  41. })->toArray();
  42. }
  43. }