title: Retrieving $_POST Variables in wordpress page
body: <p>I am trying to create a wordpress plugin for a payment gateway. The gateway sends a data back on given URL (in my case : mysite.com/payment-success). On this URL I have a set wordpress to email as soon as it detects posted variables as well as update database result of that particular payment.</p>
  
  <p>Can someone please tell me how I can retrieve all POST variables sent from external URL in wordpress.</p>
  
  <p>This is what I am doing at the moment.</p>
  
  <pre><code>    add_shortcode('payment_success_wp', array($this, 'payment_success')); //second argument is array because function is in a class file.
  </code></pre>
  
  <p>I have added above shortcode on new page with the URL mysite.com/payment-success. The function (shortcode) implementation is as below. .</p>
  
  <pre><code>function payment_success() {
      global $wpdb;
      $this-&gt;table_name = $wpdb-&gt;prefix . "my_payments";
  
      mail('myemailaddress@gmail.com', "about payments", "just chasing up" . print_r($_POST));
  
      if (isset($_POST['transactionstatus']) &amp;&amp; isset($_POST['total'])) {
  
          $data = array(
              'payment_status' =&gt; $_POST['transactionstatus'],
          );
  
          $wpdb-&gt;update($this-&gt;table_name, $data, array('payment_id' =&gt; $_POST['oid']));
      }
  }
  </code></pre>
  
  <p>When I call above page manually then the email does get trigger. Which I think is really strange but when the gateway sends parameters then nothing happens.</p>
  
  <p>Any help will be appreciated.</p>