You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
payment/app/Helper/OmiPay/Signer.php

21 lines
469 B
PHTML

2 years ago
<?php
declare(strict_types=1);
namespace App\Helper\OmiPay;
class Signer
{
public static function sign($params) {
$signString = $params['m_number'] . '&'
. $params['timestamp'] . '&'
. $params['nonce_str'] . '&'
. Config::get('secret_key');
return strtoupper(md5($signString));
}
public static function verify($params) {
$sign = $params['sign'] ?? '';
return $sign == self::sign($params);
}
}