ecommerce_format_price($expectedAmount), 'actual' => ecommerce_format_price($actualAmount), ]) ); } /** * 프론트엔드 결제예정금액 반환 * * @return float */ public function getExpectedAmount(): float { return $this->expectedAmount; } /** * 서버 재계산 금액 반환 * * @return float */ public function getActualAmount(): float { return $this->actualAmount; } /** * 금액 차이 반환 * * @return float */ public function getDifference(): float { return abs($this->expectedAmount - $this->actualAmount); } /** * 컨텍스트 정보 반환 * * @return array */ public function getContext(): array { return $this->context; } /** * 로깅용 전체 데이터 반환 * * @return array */ public function toArray(): array { return [ 'expected_amount' => $this->expectedAmount, 'actual_amount' => $this->actualAmount, 'difference' => $this->getDifference(), 'context' => $this->context, ]; } }