<?php  namespace App\Services\Payments;  class WsPayHandler { 	/** 	 * @var string 	 */ 	final public const HASH_ALGO = 'sha512';  	public static function generateFormSignature(string $orderId, float|int $amount): string 	{ 		$data = [ 			setting('wspay_shop_id'), 			$orderId, 			number_format($amount, 2, '', ''), 			'', 		];  		return static::generateSignature($data); 	}  	public static function generateWebhookSignature(string $orderId, bool $success, string $approvalCode): string 	{ 		$data = [ 			setting('wspay_shop_id'), 			$orderId, 			(int) $success, 			$approvalCode, 			'', 		];  		return static::generateSignature($data); 	}  	protected static function generateSignature(array $data): string 	{ 		return hash(static::HASH_ALGO, implode(setting('wspay_secret_key'), $data)); 	} }