Notify controller eka me wage set wenna one, return url eka enawa kiyanne notify url eka aniwa ubata enawa but eka blind ena nisa ube errors pennane na, eka parin work kale nattam reload karaddi aye data ennet na
public function payhere_notify(Request $request){
$merchant_id = $request->input('merchant_id');
$order_id = $request->input('order_id');
$payhere_amount = $request->input('payhere_amount');
$payhere_currency = $request->input('payhere_currency');
$status_code = $request->input('status_code');
$method = $request->input('method');
$status_message = $request->input('status_message');
$card_holder_name = $request->input('card_holder_name');
$card_no = $request->input('card_no');
$card_expiry = $request->input('card_expiry');
$md5sig = $request->input('md5sig');
$merchant_secret = 'XXXXXXX';
$local_md5sig = strtoupper (md5 ( $merchant_id . $order_id . $payhere_amount . $payhere_currency . $status_code . strtoupper(md5($merchant_secret)) ) );
if (($local_md5sig === $md5sig) AND ($status_code == 2) ){
$statu = $status_code;
$payment_up = Payhere::payment_st_update($order_id, $statu, $method, $status_message, $card_holder_name, $card_no, $card_expiry);
$pay_st = Payhere::pay_st_update($order_id, $statu);
}
elseif (($local_md5sig === $md5sig) AND ($status_code == 0) ){
$statu = $status_code;
$payment_up = Payhere::payment_st_update($order_id, $statu, $method, $status_message, $card_holder_name, $card_no, $card_expiry);
$pay_st = Payhere::pay_st_update($order_id, $statu);
}
elseif (($local_md5sig === $md5sig) AND ($status_code == -1) ){
$statu = $status_code;
$payment_up = Payhere::payment_st_update($order_id, $statu, $method, $status_message, $card_holder_name, $card_no, $card_expiry);
$pay_st = Payhere::pay_st_update($order_id, $statu);
}
elseif (($local_md5sig === $md5sig) AND ($status_code == -2) ){
$statu = $status_code;
$payment_up = Payhere::payment_st_update($order_id, $statu, $method, $status_message, $card_holder_name, $card_no, $card_expiry);
$pay_st = Payhere::pay_st_update($order_id, $statu);
}
elseif (($local_md5sig === $md5sig) AND ($status_code == -3) ){
$statu = $status_code;
$payment_up = Payhere::payment_st_update($order_id, $statu, $method, $status_message, $card_holder_name, $card_no, $card_expiry);
$pay_st = Payhere::pay_st_update($order_id, $statu);
}
else {
$statu = $status_code;
$payment_up = Payhere::payment_st_update($order_id, $statu, $method, $status_message, $card_holder_name, $card_no, $card_expiry);
$pay_st = Payhere::pay_st_update($order_id, $statu);
}
}```