title: WePay embedCheckout with c#
body: <p>Hello i try to create an embed payment in my web site with Wepay.</p>
  
  <p>In PHP the code example is </p>
  
  <pre><code>&lt;?php
      // WePay PHP SDK - http://git.io/mY7iQQ
      require 'wepay.php';
  
      // application settings
      $account_id = 123456789; // your app's account_id
      $client_id = 123456789;
      $client_secret = "1a3b5c7d9";
      $access_token = "STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20"; // your app's access_token
  
      // change to useProduction for live environments
      Wepay::useStaging($client_id, $client_secret);
  
      $wepay = new WePay($access_token);
  
      // create the checkout
      $response = $wepay-&gt;request('checkout/create', array(
          'account_id'        =&gt; $account_id,
          'amount'            =&gt; '24.95',
          'short_description' =&gt; 'Services rendered by freelancer',
          'type'              =&gt; 'service',
          'currency'          =&gt; 'USD'
      ));
  
      // display the response
      print_r($response);
  ?&gt;
  </code></pre>
  
  <p>So i try to create my "own" handler to initiate the paiement. I create my ashx that will call the "/checkout/create" page but no success.</p>
  
  <p>There is a sample of my code.</p>
  
  <pre><code>HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
              objRequest.Timeout = Timeout;
              objRequest.Method = "POST";
              objRequest.ContentType = "text/json";
              objRequest.ContentLength = strPost.Length;
  string strPost = "{\"accountID\":\"528754\",\"client_id\":\"2544544\",\"client_secret\":\"0454a547\",\"access_token\":\"xxxxxx\",\"amount\":\"5\",\"short_description\":\"messages\",\"type\":\"service\",\"currency\":\"CAD\",\"redirect_uri\":\"https://www.mywebsite.com/sucess.aspx\"}"
              try
              {
                  using (StreamWriter myWriter = new StreamWriter(objRequest.GetRequestStream()))
                  {
                      myWriter.Write(strPost);
                      myWriter.Flush();
                      myWriter.Close();
                  }
              }
              catch (Exception e)
              {
              }
  
  
              HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
              string result;
              using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
              {
                  result = sr.ReadToEnd();
              }
  
  
              return result;
  </code></pre>
  
  <p>I always received a bad request .... any idea ?</p>