database eke columns tika hariytama tiyenna one, notify url eka workd kiyala balannapuluwan db eka update unhm
Posts made by alwismt
-
RE: Laravel payhere integration
-
RE: Laravel payhere integration
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); } }```
-
RE: Laravel payhere integration
Ita passe notify url eke process tika ube controller eke hadanna one, ubata payhere eken direct ewanne na notify url eka, blind karala ewanne eka nisa errors pennane na, ube route ekata /payment/notif dala controller ehekata pass krhn controller eken, uba ```
$merchant_id = $_POST['merchant_id']; $order_id = $_POST['order_id']; $payhere_amount = $_POST['payhere_amount']; $payhere_currency = $_POST['payhere_currency']; $status_code = $_POST['status_code']; $md5sig = $_POST['md5sig']; $merchant_secret = 'XXXXXXXXXXXXX'; // Replace with your Merchant Secret (Can be found on your PayHere account's Settings page) $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) ){ //TODO: Update your database as payment success } ubata data base eka update karaganna witari puluwan notify eken, redirect ekata ita passe hadaganin data base status eka anuwa
-
RE: Laravel payhere integration
Pahadili, Localhost ekedi notify karaganna ba, return url eka ube browser eke load wenawa ube ube "host -dns" walat "localhost or test.lk" tiyena nisa but ubata data back wenne na me url walat data back wenna nam real ip ekak thought real domain ehekin ube lap ekata set karaganna one, ubata wifi router ekak tiyenawa nam ube network providerta call karala public ip ekak illaganin (free denawa) ita passe router ekata log wela port forwarding karapan ube lap eke local ipekata port 80 and 443 cloudflare use karala ube domain name eka ube gattu public ip ekata point karahan
-
RE: Laravel payhere integration
![alt text]( image url)
site eken payhere ekata hariyata redirect wenawada? Ita passe Payhere eke methanata details fill karala pay click karata ube site eke url ekata "payhere/redirect" back wenawada
-
RE: Laravel payhere integration
Pahadili na, Payhere eken payment process eka pass karanawada? "Siteurl/Payment/return" me url return wenawada payment process eken passe?
-
RE: Laravel payhere integration
@root na, mata mage srver ekata payhere ganna one na, payhere site ekata mage data post karanna one,
mage steps thiyenne mehemai,
1.Cart table eke products thiyenawa, Checkout view ekedi me data view karanawa
- mama payhere checkout eka click karanawa,
//Ehanadi mn karanne {!! Form::Open(array('url' => '/payher_pap','id' => 'pay')) !!} //data tika controller ekata aragena cart eke tiyena data payhere table ekata save karagannawa //Ita passe thamai mata payhere.com site ekata amount ekai value ekai yawanna one //mata danaganna one controller eken amount ekai details tikai post method eken payhere ekata yawanna puluwanda kiyla,
-
RE: Laravel payhere integration
@root echo kare ->send() dunnahama
Call to undefined method GuzzleHttp\Psr7\Response::send()
ehema nathuwa guzzel eken redirect krnn puluwanda
-
RE: Laravel payhere integration
@root machan, mama guzzle walin request karahm payhere view eka mage url eke load wenawa awulk nathuwa datath okkoma gannawa,
case eke tiyenne ita passe,
Payment method eka payhere ekedi (visa/master/amex/etc) me mokak click karath "Unexpected Error Occurred " ekak denawa
$client = new \GuzzleHttp\Client(); $url = "https://sandbox.payhere.lk/pay/checkout"; $myBody['name'] = "Demo"; $request = $client->post($url, array( 'form_params' => [ 'merchant_id' => '1213296', 'return_url' => 'http://kali/return', 'cancel_url' => 'http://kali/cancel', 'notify_url' => 'http://kali/lhorsamadi/notify', 'order_id' => 'ItemNo12345', 'items' => 'Door bell wireless', 'currency' => 'LKR', 'amount' => '1000', 'first_name' => 'Saman', 'last_name' => 'Perera', 'email' => '[email protected]', 'phone' => '0771234567', 'address' => 'No.1, Galle Road', 'city' => 'Colombo', 'country' => 'Sri Lanka' ] )); echo $request->getStatusCode(); echo $request->getHeaderLine('content-type'); echo $request->getBody();
a wagema echo nathuwa ->send() use karahama,
Call to undefined method GuzzleHttp\Psr7\Response::send()
meka fix krnne khmd bro
-
RE: Laravel payhere integration
@root bot kenek wage trick ekak pahadili, curl or Guzzle composer eken install karanna packages tiyenawane, a deken secure n lesima mkkd
-
RE: Laravel payhere integration
@root client side eken checkout ekak security nane bro, Donation system ehekata wage nam client side okay, curl nam mn use karala na curl walin post method ekata pass karhm browser data ganne nathuwa puluwanda security eka awulk nadda
-
RE: Laravel payhere integration
@root ow, man laravel walin nathuwa nikn html eheka post method ekath ekka sandbox url eka dunnahma eka payhere eken recognize karagannawa awulak nathuwa, mn sandbox eke mage url eka dila tiyenne, mata hithena widiyata laravel controller eken mn data eka pass karana widiye awulk tiyenne, payhere ekata data post method ekata controller eken pass karanna system ekak one
-
RE: Laravel payhere integration
@dev_lak ow, man laravel walin nathuwa nikn html eheka post method ekath ekka sandbox url eka dunnahma eka payhere eken recognize karagannawa awulak nathuwa, mn sandbox eke mage url eka dila tiyenne, mata hithena widiyata laravel controller eken mn data eka pass karana widiye awulk tiyenne, payhere ekata data post method ekata controller eken pass karanna system ekak one
-
Laravel payhere integration
Laravel walata payhere payment gateway checkout api eka integration karapu kenek innawada?
Mama mulinma checkout ekdi payhere checkout click karaham products data controller eken db eke payhere table ekata save karanawa, ita passe controller eken return redirect karanawa
//up more codes for db and etc $post = array( 'merchant_id' => '1213296', 'return_url' => 'http://kali/return', 'cancel_url' => 'http://kali/cancel', 'notify_url' => 'http://kali/notify', 'order_id' => 'ItemNo12345', 'items' => 'Door bell wireless', 'currency' => 'LKR', 'amount' => '1000', 'first_name' => 'Saman', 'last_name' => 'Perera', 'email' => '[email protected]', 'phone' => '0771234567', 'address' => 'No.1, Galle Road', 'city' => 'Colombo', 'country' => 'Sri Lanka' ); return redirect('https://sandbox.payhere.lk/pay/checkout')->with('post', $post);
data db ekata gihilla sandbox url ekata redirect wenawa but sandbox ekedi man pass karana data mukut gahanne na merchant error enawa