<?php
// app/Services/PayWayService.php

namespace App\Services;


class PayWayService
{
    /**
     * Get the API URL from the configuration.
     *
     * @return string
     */
    public function getApiUrl()
    {
        return config('payway.api_url');
    }

    /**
     * Generate the hash for PayWay security.
     *
     * @param string $str
     * @return string
     */
    public function getHash($dataString)
    {
        // $publicKey = '481d5528-9c70-420e-a055-fe838d5ffddb'; // Sandbox Key
        $publicKey = 'fd8b53ed-7142-4070-9bfd-b11206d1db37'; // Sandbox Key
        return base64_encode(hash_hmac('sha512', $dataString, $publicKey, true));
    }
}
