61 lines
1.4 KiB
PHP
61 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Api;
|
|
|
|
class CardMemberService extends BaseApiService
|
|
{
|
|
public function getAllMembers(array $params = [])
|
|
{
|
|
return $this->get('/card-members', $params);
|
|
}
|
|
|
|
public function getMember($id)
|
|
{
|
|
return $this->get("/card-members/{$id}");
|
|
}
|
|
|
|
public function createMember(array $data)
|
|
{
|
|
return $this->post('/card-members', $data);
|
|
}
|
|
|
|
public function updateMember($id, array $data)
|
|
{
|
|
return $this->post("/card-members/{$id}", array_merge($data, ['_method' => 'PUT']));
|
|
}
|
|
|
|
public function deleteMember($id)
|
|
{
|
|
return $this->post("/card-members/{$id}", ['_method' => 'DELETE']);
|
|
}
|
|
|
|
public function getCardTypes()
|
|
{
|
|
return $this->get('/card-types');
|
|
}
|
|
|
|
public function createCardType(array $data)
|
|
{
|
|
return $this->post('/card-types', $data);
|
|
}
|
|
|
|
public function updateCardType($id, array $data)
|
|
{
|
|
return $this->post("/card-types/{$id}", array_merge($data, ['_method' => 'PUT']));
|
|
}
|
|
|
|
public function deleteCardType($id)
|
|
{
|
|
return $this->post("/card-types/{$id}", ['_method' => 'DELETE']);
|
|
}
|
|
|
|
public function topUp(array $data)
|
|
{
|
|
return $this->post('/card-members/top-up', $data);
|
|
}
|
|
|
|
public function getTopUpHistory($memberId, array $params = [])
|
|
{
|
|
return $this->get("/card-members/{$memberId}/top-up-history", $params);
|
|
}
|
|
}
|