<?php

namespace App\Helpers;

class MidtransHelper
{
    public static function init()
    {
        \Midtrans\Config::$serverKey = env('MIDTRANS_SERVER_KEY');
        \Midtrans\Config::$isProduction = env('MIDTRANS_IS_PRODUCTION', false);
        \Midtrans\Config::$isSanitized = true;
        \Midtrans\Config::$is3ds = true;
    }

    public static function createTransaction($params)
    {
        self::init();
        return \Midtrans\Snap::getSnapToken($params);
    }
}
