MemberToDormantAccountMigrator.php 756 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Services\DormantAction;
  3. use App\Services\CallApiService;
  4. class MemberToDormantAccountMigrator
  5. {
  6. private $callApiService;
  7. public function __construct(CallApiService $callApiService)
  8. {
  9. $this->callApiService = $callApiService;
  10. }
  11. public function migrateMemberToDormantAccount($gateToken): bool
  12. {
  13. $dormantMemberMove = $this->callApiService->callApi([
  14. 'url' => 'dormant-member-move',
  15. 'data' => [
  16. 'req' => ''
  17. ],
  18. 'headers' => [
  19. 'GateToken' => $gateToken
  20. ]
  21. ]);
  22. if ($this->callApiService->verifyApiError($dormantMemberMove)) {
  23. return false;
  24. }
  25. return true;
  26. }
  27. }