Commit b997e8d4 by Muhammad Usman

experiment

parent 69bbbc29
Pipeline #304 passed with stage
in 0 seconds
......@@ -73,7 +73,8 @@ function vq_render_lms_order_metabox() {
$price = get_post_meta(get_the_ID(), 'total_amount', true);
$payment_status = get_post_meta(get_the_ID(), 'payment_status', true);
print_r(get_post_meta(get_the_ID(), 'order_redirection_data', 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));
if($price == null) $price = "";
......@@ -85,6 +86,7 @@ function vq_render_lms_order_metabox() {
$file = str_replace('[[PRICE]]', $price, $file);
$file = str_replace('[[PAY_STAT]]', $payment_status, $file);
$file = str_replace('[[RESPONSE]]', $test, $file);
echo $file;
......
......@@ -9,6 +9,12 @@
<label for="">Payment Status: </label>
<input type="text" name="payment_status" class="form-control" value="[[PAY_STAT]]"/>
</div>
<div class="field">
<label for="">Response: </label>
<input type="text" class="form-control" value="[[RESPONSE]]"/>
</div>
</div>
......
......@@ -42,50 +42,10 @@ function use_lms_template($data)
return __DIR__ . '/template/pricing-request.php';
}
else if(is_page('lms-notify')) {
$id = $_GET['order_id'];
$content = get_the_content($id);
$d = $content . json_encode($_GET);
$d .= json_encode($_POST['paymentresponse']);
$file = 'file.txt';
file_put_contents($file, $d);
array(
'ID' => $id,
'post_content' => $d,
);
wp_update_post($post);
include(__DIR__ . '/template/order-redirection.php');
exit;
} else if(is_page('learning-management')) {
return __DIR__ . '/template/management.php';
} else if(is_page('lms-notify')) {
$id = $_GET['order_id'];
$content = get_the_content($id);
$d = $content . json_encode($_GET);
$d .= json_encode($_POST['paymentresponse']);
$file = 'file.txt';
file_put_contents($file, $d);
array(
'ID' => $id,
'post_content' => $d,
);
wp_update_post($post);
}
return $data;
......
......@@ -3,5 +3,5 @@
$order_id = $_GET['order_id'];
update_post_meta($order_id, 'order_redirection_data_get', json_encode($_GET));
update_post_meta($order_id, 'order_redirection_data_post', json_encode($_POST));
update_post_meta($order_id, 'order_redirection_data_post', $_POST['paymentresponse']);
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