and here the redirect method if it help you to understand it better:
public function redirect()
{
$cart = Cart::getCart();
$billingAddress = $cart->billing_address;
$MERCHANT_KEY = core()->getConfigData('sales.payment_methods.payu.payu_merchant_key');
$SALT = core()->getConfigData('sales.payment_methods.payu.salt_key');
if (core()->getConfigData('sales.payment_methods.payu.payu-website') == "Sandbox") :
$PAYU_BASE_URL = "https://test.payu.in"; // For Sandbox Mode
else :
$PAYU_BASE_URL = "https://secure.payu.in"; // For Live Mode
endif;
$shipping_rate = $cart->selected_shipping_rate ? $cart->selected_shipping_rate->price : 0; // shipping rate
$discount_amount = $cart->discount_amount; // discount amount
$total_amount = ($cart->sub_total + $cart->tax_total + $shipping_rate) - $discount_amount; // total amount
$posted = array(
"key" => $MERCHANT_KEY,
"txnid" => $cart->id . '_' . now()->format('YmdHis'),
"amount" => $total_amount,
"firstname" => $billingAddress->name,
"email" => $billingAddress->email,
"phone" => $billingAddress->phone,
"surl" => route('payu.success'),
"furl" => route('payu.failure'),
"curl" => "cancel",
"hash" => '',
"productinfo" => 'Bagisto Order no ' . $cart->id,
'udf1' => '',
'udf2' => '',
'udf3' => '',
'udf4' => '',
'udf5' => '',
'salt' => $SALT
);
/*** hash key generate */
$hash = $this->getHashKey($posted);
$action = $PAYU_BASE_URL . '/_payment';
return view('payu::payu-redirect')->with(compact('MERCHANT_KEY', 'SALT', 'action', 'posted', 'hash'));
}