My favorites | English | Sign in

Google Checkout

Using Sandbox for Testing

Note: This is the latest documentation. The previous version of this page is also available.

The Sandbox is a Google Checkout environment that is designed to help you test your implementation by signing in as a buyer and placing an order without incurring charges. This lets you experience and test the steps that follow a purchase, such as receiving notification and state changes from the Checkout server. The Sandbox is independent of the Google Checkout system, with its own buyer accounts, merchant accounts, merchant center and servers.

The Sandbox offers the same functionality as the production Google Checkout system with the following exceptions:

  • The Sandbox does not actually execute debits and credits.
  • The Sandbox requires you to use test credit card numbers.
  • The Sandbox web pages (the payment page and Merchant Center) display "Sandbox" as background text to indicate you are working in the Sandbox environment.

Contents

Setting Up Your Test Environment

Follow these three steps to set up a Google Checkout test environment:

  1. Create Sandbox Merchant and Buyer Accounts
  2. Locate the Merchant ID and Merchant Key for Your Merchant Sandbox Account
  3. Enable Your Merchant Sandbox Account to Submit Orders Unsigned

Detail for these steps follow.

  1. Create Sandbox Merchant and Buyer Accounts

    Create two Sandbox accounts with different email addresses: one for a buyer account and the other for a merchant account. You need the email addresses to be different so you can sign in differently as a buyer and seller. Google Checkout will not let you buy an item while signed into a buyer account that shares the same sign-in email address as the merchant account that is selling the item. One of these email addresses can be the same as you use for your production account.

    Note: Bank Account information - After you sign in, you'll be asked to provide bank account information &mdash in the Sandbox, you can skip this part. Since the Sandbox system does not process billing or payments, this information is not necessary when you are testing your implementation.

    Follow these guidelines when setting up your test accounts:

    • Name - Enter any text
    • Billing Address - Enter any text
    • City/Town - Enter any text
    • State - Choose any state or territory from the menu
    • Zip Code - Enter any valid five-digit or nine-digit zip code for the given state (the range of correct values is specified in the balloon help that appears)
    • Phone Number - Enter a 10-digit number. For U.S. accounts, the first three digits must be a valid area code.
    • Federal tax ID - Enter any 9 digits
    • Social Security number - Enter any 9 digits
    • Card Number - Use one of the credit card numbers in the following table:
      Card Type Card Number Expiration Date CVC
      American Express
      (see Note 1)
      3782 8224 6310 005 any future date any four digits
      Discover 6011 1111 1111 1117 any future date any three digits
      MasterCard 5555 5555 5555 4444 any future date any three digits
      VISA 4111 1111 1111 1111 any future date any three digits

      Note 1: Merchants in the United Kingdom should not use an American Express card.

  2. Locate the Merchant ID and Merchant Key for Your Sandbox Merchant Account

    Sign in to your Sandbox merchant account at https://sandbox.google.com/checkout/sell to locate your Merchant ID and your Merchant Key.

    After signing in to your account, click on the Settings tab. Then click on the Integration link on the left side of the page. Your 10- or 15-digit Merchant ID and your Merchant Key will both be listed under the Account information header.

    • Merchant ID is used in the POST action URL and the Checkout button URL
    • Merchant Key is used for authenticating server-to-server requests


    Warning: You should never share your Merchant Key with anyone, and no Google representative will ever ask you for your Merchant Key. Someone with a Merchant Key could tamper with orders, giving themselves steep discounts.

    Note: The Google Checkout production server and Sandbox server are completely different systems. You can have the same email address on both — it's the server you sign into that determines whether you're signed into the Sandbox, not the email address. (Don't get confused into thinking that an email address is necessarily associated with a particular sandbox.)

  3. Enable Your Merchant Sandbox Account to Submit Orders Unsigned

    This step is required if you wan to use HTML API. Under the Shopping cart post security header, uncheck the box to allow your account to use API requests with name-value pairs. After removing the check from the checkbox, click the Save button to save your settings.

    Note: You must use the XML API if you want to post digitally signed shopping carts.

  4. Submitting Requests to the Sandbox

    To submit a request to the Google Checkout Sandbox:

    1. Instead of submitting the request to checkout.google.com (the Google Checkout production server), you must submit the request to sandbox.google.com/checkout.

      <form method="POST"
        action="https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/MERCHANT_ID">
      
    2. In the URL, instead of using the merchant ID for your production account, you would replace the text MERCHANT_ID with the merchant ID for your Sandbox merchant account (from above).

    3. You must make the same changes to any Google Checkout Buttons that submit test orders to Google Checkout.

    The Sandbox and production merchant IDs are demonstrated in the interactive code demo.

    Launching to Production

    After you have finished testing your Google Checkout integration, you need to make the following changes to launch your changes to your production website:

    1. Update all URLs in HTML forms from sandbox.google.com/checkout to checkout.google.com.

    2. Update all URLs in HTML forms to use the merchant ID associated with your production merchant account instead of the merchant ID associated with your test merchant account.

    3. Update the URLs for all Google Checkout buttons from sandbox.google.com/checkout to checkout.google.com.

    4. Update all Google Checkout button URLs to use the merchant ID associated with your production merchant account instead of the merchant ID associated with your test merchant account.

    « Previous
    (Signing Up)
    Next »
    (How Checkout Works)