1 / 65

Google Checkout API

Google Checkout API. Jingsong Wang Arpril 2, 2007. Agenda. Why How to use How to integrate. Agenda. Why How to use How to integrate. Why Google Checkout. Sell more. Spend less. Grow your business. Why Google Checkout (cont..). Customers, You

sandra_john
Télécharger la présentation

Google Checkout API

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Google Checkout API Jingsong Wang Arpril 2, 2007

  2. Agenda • Why • How to use • How to integrate

  3. Agenda • Why • How to use • How to integrate

  4. Why Google Checkout • Sell more. • Spend less. • Grow your business.

  5. Why Google Checkout (cont..) • Customers, You • Google Checkout is a fast, convenient checkout process that complements your existing process • until 2008, FREE..

  6. Benefits • Attract more leads. • Convert more leads into sales. • Process sales for free. • Protect yourself from fraud.

  7. Example <form method="POST" action="https://sandbox.google.com/checkout/cws/v2/Merchant/1234567890/checkoutForm" accept-charset="utf-8"> <input type="hidden" name="item_name_1" value="Peanut Butter"/> <input type="hidden" name="item_description_1" value="Chunky peanut butter."/> <input type="hidden" name="item_quantity_1" value="1"/> <input type="hidden" name="item_price_1" value="3.99"/> <input type="hidden" name="ship_method_name_1" value="UPS Ground"/> <input type="hidden" name="ship_method_price_1" value="10.99"/> <input type="hidden" name="tax_rate" value="0.0875"/> <input type="hidden" name="tax_us_state" value="NY"/> <input type="hidden" name="_charset_"/> <input type="image" name="Google Checkout" alt="Fast checkout through Google" src="http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=1234567890&w=180&h=46&style=white&variant=text&loc=en_US" height="46" width="180"/> </form>

  8. Agenda • Why • How to use • How to integrate

  9. Sign In/Sign Up page

  10. Place Order

  11. Order Confirmation

  12. Agenda • Why • How to use • How to integrate

  13. How to integrate • HTML APIs • XML APIs

  14. How to integrate 1. Go to http://sandbox.google.com/checkout/sell/ to set up test accounts in the Google Checkout Sandbox service. • Create your buyer account at http://sandbox.google.com/checkout. • Create your merchant account at http://sandbox.google.com/checkout/sell/.

  15. How to integrate (cont) 2. Go to http://checkout.google.com/sell/signup to sign up for a Google Checkout merchant account

  16. How to integrate (cont) 3. Sign in to your test merchant account at https://sandbox.google.com/checkout/sell to locate your Merchant ID and your Merchant Key.

  17. How to integrate (cont) 4. Add a Google Checkout button to the checkout pages on your online store.

  18. How to integrate (cont) 5. Modify the code for your online store so that the form containing the Google Checkout button also submits information about your customer's order.

  19. HTML

  20. Sending Checkout API Requests to Google • In your development environment: https://sandbox.google.com/checkout/cws/v2/Merchant/[[Merchant ID]]/checkoutForm • In your production system: • https://checkout.google.com/cws/v2/Merchant/[[Merchant ID]]/checkoutForm

  21. Checkout API • Query key strings • Item Parameters • item_name_# * - The parameter value identifies the name of the item. • item_description_# * - The parameter value provides a description of the item. • item_quantity_# - The parameter value identifies how many units of a particular item are included in the customer's shopping cart. • item_price_#* - The parameter value identifies the price of the item. • item_currency_# - The parameter value identifies the currency for the item price. The default value is USD (U.S. dollars). • Shipping Parameters… • Tax Parameters…

  22. <form method="POST" action="https://sandbox.google.com/checkout/cws/v2/Merchant/1234567890/checkoutForm" accept-charset="utf-8"> <input type="hidden" name="item_name_1" value="Peanut Butter"/> <input type="hidden" name="item_description_1" value="Chunky peanut butter."/> <input type="hidden" name="item_quantity_1" value="1"/> <input type="hidden" name="item_price_1" value="3.99"/> <input type="hidden" name="item_name_2" value="Grape Jelly"/> <input type="hidden" name="item_description_2" value="16 oz. bottle of Concord grape jelly."/> <input type="hidden" name="item_quantity_2" value="1"/> <input type="hidden" name="item_price_2" value="4.49"/> <input type="hidden" name="ship_method_name_1" value="UPS Air"/> <input type="hidden" name="ship_method_price_1" value="19.99"/> <input type="hidden" name="ship_method_us_area_1" value="CONTINENTAL_48"/> <input type="hidden" name="ship_method_name_2" value="UPS Ground"/> <input type="hidden" name="ship_method_price_2" value="10.99"/> <input type="hidden" name="ship_method_us_area_2" value="FULL_50_STATES"/> <input type="hidden" name="tax_rate" value="0.0875"/> <input type="hidden" name="tax_us_state" value="NY"/> <input type="hidden" name="_charset_"/> <input type="image" name="Google Checkout" alt="Fast checkout through Google" src="http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=1234567890 &w=180&h=46&style=white&variant=text&loc=en_US" height="46" width="180"/> </form>

  23. Viewing Order Statuses in the Merchant Center • financial-order-state • fulfillment-order-state

  24. XML

  25. Integration • Modify the code for your online store: • Your code needs to create an XML document containing information about the items in your customer's shopping cart • The XML will also contain information about the shipping options that the customer can select and the taxes that should be added to the order • Your code will need to encrypt the XML document and embed the encrypted value in the form that contains the Google Checkout button

  26. Integration (cont) • In your development environment: • <form method="POST"    action="https://sandbox.google.com/checkout/cws/v2/Merchant/[[Merchant-ID]]/checkout"> • In your production system: • <form method="POST"    action="https://checkout.google.com/cws/v2/Merchant/[[Merchant-ID]]/checkout">

  27. Google Checkout Buttons

  28. When the customer clicks the Google Checkout button • Two methods to send information about the customer's order to Google so that the customer can complete the purchase. • You can configure your form to submit directly to Google Checkout. If you choose this option, you must add code to your site that constructs an XML document containing information about the customer's order as well as information about your shipping options and tax policies. You will then encode the XML document and embed it in the form that displays the Google Checkout button. • You can configure your form to submit to a page on your site that will then create an XML document containing information about the order. Your application will then post the XML to Google using an HTTP POST request. Google will then respond to your request with a Google Checkout URL where your customer can complete the order, and you will redirect the customer to that URL.

  29. Integration Options • Level 1 Integration - Shopping Cart Integration • Level 2 Integration - Order Processing Integration

  30. Level 1 Integration –Shopping Cart Integration • By implementing the Checkout API, you will have completed a Level 1 Checkout integration. • At this integration level, you will receive new order notifications via email. You can then manage orders using the Merchant Center, a Google application that lets you track orders from your web browser.

  31. Level 2 Integration – Order Processing Integration • The Notification API enables Google to inform merchants of new orders submitted through Google Checkout or to send updates for existing orders. As such, the Notification API allows merchants to modify their systems to automatically receive order information from Google Checkout. • The Order Processing API provides functions that let merchants change an order's status or add information to an order. Thus, the Order Processing API lets merchants modify their systems to automatically update Google Checkout orders. • To implement these APIs, you must create a web service that sends and receives XML messages about new orders and order status updates

  32. Processing an Order • (This process flow describes the first method, in which the order information is embedded in the form that displays the Google Checkout button. When the customer clicks the Google Checkout button, the customer's browser will submit the order directly to Google. )

  33. Processing an Order (cont..) • The first stage in the process explains how to send shopping cart information to Google Checkout. These steps are the same for Level 1 and Level 2 integrations. • The second stage of the process describes the order fulfillment process. • If you have completed a Level 1 integration, you will complete the second set of steps through the Merchant Center. If you have completed a Level 2 integration, you can modify your internal order processing systems to handle these steps. You can also opt to use the Merchant Center for these steps.

  34. Processing an Order (cont..) 1. Your customer selects items on your website. • Create a checkout shopping cart for the buyer's items as an XML structure. • Create a signature for the shopping cart using the HMAC_SHA1 function. • Base64-encode the cart. • Base64-encode the signature. • Put the cart and signature into a Google Checkout button form. Note: If you choose the second method of implementing the Checkout API, these steps will be replaced by the steps in the Submitting Server-to-Server Checkout API Requests 2. After your customer completes the order through Google Checkout, you process the order and ship items to the customer. • Receive the new order notification. • Charge the order. • Add tracking information to the order. • Mark the order shipped . • Archive the order.

  35. Create a checkout shopping cart

  36. Checkout API • Checkout API requests send order information from a merchant's website to Google, enabling a customer to complete an order using Google Checkout. The <checkout-shopping-cart> element is the root tag for Checkout API requests. This tag contains three subtags. • <shopping-cart> • <checkout-flow-support> • optional <order-processing-support> element contains information about how Google should process an order or how Google should convey data about the order to the merchant. Currently, you would only use this element if you wanted to instruct Google Checkout to send an <authorization-amount-notification> after a customer submits a new order and Google authorizes the customer's credit card. • The Processing an Order and Submitting Server-to-Server Checkout API Requests sections of this document explain two different processes for creating and submitting Checkout API requests.

  37. Create an HMAC-SHA-1 signature • You must create an HMAC-SHA-1 signature, a cryptographically secure value that enables Google to verify that the XML in the <checkout-shopping-cart> structure was not altered before Google received it. • Most development environments provide a function for creating HMAC-SHA-1 signatures. To create the signature, call the appropriate function, passing the <checkout-shopping-cart> XML structure and your Merchant Key as parameters to the function.

  38. Base64-encode the cart • After you create the signature, base64-encode the <checkout-shopping-cart> XML structure

  39. Base64-encode the HMAC-SHA-1 signature • Using the same function that you called to encode the shopping cart, base64-encode the HMAC-SHA-1 signature that you created in step ii.

  40. Add the order information and signature to a Google Checkout button form • Add those values to the form on your page that displays a Google Checkout button.

  41. Receive the new order notification • When a customer submits an order, Google can notify you that the new order has been submitted. There are two ways to receive new order notifications: • Google can send email notifications for new orders. If you have not implemented the Notification API, Google will automatically email you to notify you have new orders. • Level 2 only: If you have implemented the Notification API, Google will send a new-order-notification to inform you of the new order. The notification will include the order shopping cart as well as other transaction details such as the shipping method, shipping address and taxes for the order.

  42. Add tracking information to the order • After shipping the order, you can add shipment tracking information that will appear on the buyer's account page. There are two ways: • Log in to your Merchant Center account. • Level 2 only: If you have implemented the Order Processing API, you can add tracking information by sending an add-tracking-data command to Google.

  43. Mark the order shipped • Once the order has been shipped, you can also mark it Shipped in the Merchant Center and on the buyer's account page. There are two ways: • Log in to your Merchant Center account. • Level 2 only: If you have implemented the Order Processing API, you can send a deliver-order command to Google.

More Related