fix: [card] CSV(CVC) 복호화 값을 API 응답에 포함
- $appends에 csv 추가, getCsvAttribute accessor 생성 - cvc_encrypted는 $hidden 유지 (암호문 노출 방지)
This commit is contained in:
@@ -73,6 +73,10 @@ class Card extends Model
|
||||
'cvc_encrypted',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'csv',
|
||||
];
|
||||
|
||||
protected $attributes = [
|
||||
'status' => 'active',
|
||||
'is_manual' => false,
|
||||
@@ -178,6 +182,18 @@ public function getDecryptedCvc(): ?string
|
||||
: null;
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Accessor (JSON 직렬화용)
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* CSV(CVC) 복호화 값 — $appends로 JSON 응답에 포함
|
||||
*/
|
||||
public function getCsvAttribute(): ?string
|
||||
{
|
||||
return $this->getDecryptedCvc();
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 헬퍼 메서드
|
||||
// =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user