Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If this is for Google Checkout, you should consider using the existing <a href="https://developers.google.com/checkout/samplecode" rel="nofollow noreferrer">.Net library for Google Checkout</a>.</p> <p>While the above suggestion will work, the correct (secure) way of doing so is <a href="https://developers.google.com/checkout/developer/Google_Checkout_HTML_API#create_checkout_cart" rel="nofollow noreferrer">documented here</a>. The XML alternative (signing) is <a href="https://developers.google.com/checkout/developer/Google_Checkout_XML_API#create_checkout_cart" rel="nofollow noreferrer">here</a>, one of which allows you to do a direct FORM POST to Google in a secure manner.</p> <p>Submission via client methods will always make you susceptible to tampering - it would make little difference (security-wise) than just doing a basic HTML form post to Google.</p> <hr> <p><strong>Updated</strong>:</p> <blockquote> <p>...<em>doesn't support buy now</em>...</p> </blockquote> <p>At the end of the day, there are 2 things that make "BUY NOW" different from any other "cart" submission:</p> <ol> <li>the image</li> <li>single item purchase for Buy Now (vs. one or more for other implementations).</li> </ol> <p>See this <a href="http://code.google.com/p/google-checkout-dotnet-sample-code/source/browse/examples/post_cart/simple.aspx" rel="nofollow noreferrer">sample code from the .Net Library</a>. It should give you all you need.... </p> <hr> <p><strong>Update 2</strong>:</p> <p>There isn't anything "rigid" about the library. You don't have to use everything in it - you can even just take advantage of all the plumbing already created for you.</p> <h2>Simple Example, implementing BUY NOW, using Google Checkout .Net Library</h2> <p>Web Forms Code (aspx):</p> <pre><code>&lt;p&gt;Some ASP.net button:&lt;br /&gt; &lt;asp:Button ID="Button1" runat="server" Text="BUY ME NOW" onclick="Button1_Click" /&gt;&lt;br /&gt; An ASP.NET Image Button using BUY NOW Image:&lt;br /&gt; &lt;asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="https://checkout.google.com/buttons/buy.gif?merchant_id=[USE YOUR OWN MERCHANT ID]&amp;amp;w=117&amp;amp;h=48&amp;amp;style=white&amp;amp;variant=text&amp;amp;loc=en_US" onclick="ImageButton1_Click" /&gt; </code></pre> <p>At this point this is what you see in your browser:</p> <p><img src="https://i.stack.imgur.com/BngC8.jpg" alt="screen shot Google Checkout Buy Now"></p> <p>Code (inline or code-behind):</p> <pre><code>using GCheckout.Checkout; using GCheckout.Util; .... protected void Button1_Click(object sender, EventArgs e) { doSomething(); } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { doSomething(); } private void doSomething() { /** * Use the correct Merchant ID and Key based on GCheckout.EnvironmentType * You cannot mix/match sandbox and production id or key */ CheckoutShoppingCartRequest Req = new CheckoutShoppingCartRequest("your_production_MID", "your_production_KEY", GCheckout.EnvironmentType.Production, "USD", 20); /** * Everything from this point is a copy and paste * from .net libary sample code * http://code.google.com/p/google-checkout-dotnet-sample-code/source/browse/examples/post_cart/simple.aspx */ Req.AddItem("Mars bar", "Packed with peanuts", 0.75m, 2); //lets make sure we can add 2 different flat rate shipping amounts Req.AddFlatRateShippingMethod("UPS Ground", 5); //Add a rule to tax all items at 7.5% for Ohio Req.AddStateTaxRule("OH", 7.5, true); GCheckoutResponse Resp = Req.Send(); if (Resp.IsGood) { Response.Redirect(Resp.RedirectUrl, true); } else { Response.Write("Resp.ResponseXml = " + Resp.ResponseXml + "&lt;br&gt;"); Response.Write("Resp.RedirectUrl = " + Resp.RedirectUrl + "&lt;br&gt;"); Response.Write("Resp.IsGood = " + Resp.IsGood + "&lt;br&gt;"); Response.Write("Resp.ErrorMessage = " + Resp.ErrorMessage + "&lt;br&gt;"); } } </code></pre> <h2>Important</h2> <p>The above is just <strong>sample code</strong> to illustrate what you can do with the .Net Library. <strong>To comply with Google Checkout implementation policy, use the ImageButton implementation</strong> - it ensures that you are using Google's BUY NOW button (unaltered, etc.).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload