Commit 009b031b by Muhammad Usman

using own notify url

parent 6163958e
Pipeline #307 passed with stage
in 0 seconds
...@@ -75,12 +75,11 @@ function vq_render_lms_order_metabox() { ...@@ -75,12 +75,11 @@ function vq_render_lms_order_metabox() {
$payment_status = get_post_meta(get_the_ID(), 'payment_status', true); $payment_status = get_post_meta(get_the_ID(), 'payment_status', true);
$test = get_post_meta(get_the_ID(), 'order_redirection_data_post', true); $test = get_post_meta(get_the_ID(), 'order_redirection_data_post', true);
// print_r(get_post_meta(get_the_ID(), 'order_redirection_data', true)); // print_r(get_post_meta(get_the_ID(), 'order_redirection_data', true));
$test = str_replace(' ', '+', $test);
$xml = base64_decode($test, false) ; $xml = base64_decode($test, false) ;
echo "<pre>";
echo $xml;
exit;
$data = simplexml_load_string($xml) or die("Error: Cannot create object"); $data = simplexml_load_string($xml) or die("Error: Cannot create object");
var_dump($data);exit; echo "<pre>";
print_r($data);exit;
if($price == null) $price = ""; if($price == null) $price = "";
if($payment_status == null) $payment_status = "IN QUEUE"; if($payment_status == null) $payment_status = "IN QUEUE";
......
...@@ -117,7 +117,7 @@ function vq_lms_process_order() ...@@ -117,7 +117,7 @@ function vq_lms_process_order()
$_mid = get_option("vq_lms_payment_merchant_id"); $_mid = get_option("vq_lms_payment_merchant_id");
$_requestid = substr(uniqid(), 0, 13); $_requestid = substr(uniqid(), 0, 13);
$_noturl = "https://requestb.in/1cz13lh1";//"http://39.60.246.56:10035/lms-notify?order_id={$oid}"; //site_url("lms-notify?order_id={$oid}");//site_url("https://requestb.in/1cz13lh1"); // url where response is posted $_noturl = "http://39.60.246.56:10035/lms-notify?order_id={$oid}"; //site_url("lms-notify?order_id={$oid}");//site_url("https://requestb.in/1cz13lh1"); // url where response is posted
$_resurl = site_url("lms-payment-confirm"); //url of merchant landing page $_resurl = site_url("lms-payment-confirm"); //url of merchant landing page
$_cancelurl = site_url("lms-cancel"); //url of merchant landing page $_cancelurl = site_url("lms-cancel"); //url of merchant landing page
$_fname = $name[0]; // kindly set this to first name of the cutomer $_fname = $name[0]; // kindly set this to first name of the cutomer
......
...@@ -5,5 +5,30 @@ $order_id = 6254;//$_GET['order_id']; ...@@ -5,5 +5,30 @@ $order_id = 6254;//$_GET['order_id'];
update_post_meta($order_id, 'order_redirection_data_get', json_encode($_GET)); update_post_meta($order_id, 'order_redirection_data_get', json_encode($_GET));
update_post_meta($order_id, 'order_redirection_data_post', $_POST['paymentresponse']); update_post_meta($order_id, 'order_redirection_data_post', $_POST['paymentresponse']);
file_put_contents( plugin_dir_path(__FILE__) . '/file.txt', $order_id . " : " . $_POST['paymentresponse']);
$response = $_POST['paymentresponse'];
$response = str_replace(' ', '+', $response);
$data = simplexml_load_string($response) or die("Error: Cannot create object");
if($data) {
if($data->responseStatus->response_code == 'GR001') {
update_post_meta($order_id, 'payment_status', 'APPROVED');
}
update_post_meta($order_id, 'payment_message', $data->responseStatus->response_message);
update_post_meta($order_id, 'payment_code', $data->responseStatus->response_code);
update_post_meta($order_id, 'payment_advise', $data->responseStatus->response_advise);
update_post_meta($order_id, 'payment_type', $data->application->ptype);
update_post_meta($order_id, 'signature', $data->application->signature);
update_post_meta($order_id, 'request_id', $data->application->request_id);
update_post_meta($order_id, 'response_id', $data->application->response_id);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment