title: Braintree Webhooks : transaction details via PHP
body: <p>Braintree Payments supports Webhooks which return a subscription_id.  I have been looking for a PHP code sample that will return the transaction details for a given subscription_id.  The Braintree documentation provides no examples.</p>
  
  <p>I know this code is wrong but I wanted to show some effort at a solution. :)</p>
  
  <pre><code>&lt;?php
   $id = $_SERVER['QUERY_STRING'];
   require_once '_environment.php';
   $collection = Braintree_Transaction::search(array(
    Braintree_TransactionSearch::subscriptionId()-&gt;is($id)
   ));
   foreach ($collection AS $item) {
    echo "&lt;li&gt;" . $item-&gt;id;
   }
  ?&gt;
  </code></pre>