My favorites | English | Sign in

Google Checkout

Google Checkout HTML API - Credit Card Test Cases

Note: This is the latest documentation. The previous version of this page is identical — only the left nav differs.

Credit Card Test Cases Overview

Google Checkout provides a testing feature for the sandbox environment that enables you to submit an order that will return a specific type of Address Verification System (AVS) response or credit verification value. The feature also lets you specify that Google Checkout should send an order state change notification indicating that the credit card for a sandbox order was either authorized or rejected.

To use this feature, you will need to create a different test instrument for each test case that you want to verify. The sandbox server will use the billing information associated with an order to determine the correct AVS value, credit verification value or credit card authorization status for the order.

Entering Billing Information for Each Test Case

To create these different test billing instruments, log in to your sandbox customer account and click the Edit payment methods link on the left side of the page. The Payment Methods screen displays a form to add a new credit card to your account. This form is shown in the image below.

Using this form, add a credit card for each test that you would like to complete. The table below identifies the different tests that are available and specifies the appropriate values to use in the form. Each test instructs you to enter particular values for the billing credit card number, the billing contact name and the billing address. In addition, several tests require a specific CVC code for the credit card. Unless otherwise noted in the Additional Instructions field, enter any four-digit CVC code for American Express, and enter any three-digit CVC code for Discover, MasterCard or Visa. After you click the Save button to store a card, the page will refresh and you can use the form to add an additional card.

Please note the following points regarding the billing information for these test cases:

  • All of the credit card numbers below are randomly generated numbers. In addition, none of the credit card numbers has the same last four digits as any other credit card number. This ensures that when you select a credit card to complete an order, you can easily associate a test credit card with a particular test.

  • Each test instructs you to enter a value for the billing contact's name and address. However, the name and address values for any given test are the same. The test case is actually triggered only by the address field. However, we advise you to also enter the same value so that if we display the billing contact name in the UI, you can easily associate that name with a particular test case. So, for each test case, the Address field value is required, and the Name field value is recommended for your convenience.

Test Number Test Name Credit Card Numbers Additional Instructions
1 AVS Full Match AMEX: 342955624318368
Discover: 6011624665174125
MasterCard: 5120939736834980
Visa: 4116509050569147

Enter AVS+FULL as the value of the Name field and the first line of the Address field.

2 AVS Partial Match - Postal Code only AMEX: 344058488426266
Discover: 6011976857117225
MasterCard: 5123695007103193
Visa: 4116480559370132

Enter AVS+POSTAL as the value of the Name field and the first line of the Address field.

3 AVS Partial Match - Address only AMEX: 345672983453416
Discover: 6011750048255222
MasterCard: 5122415444933925
Visa: 4119692004990226

Enter AVS+ADDR as the value of the Name field and the first line of the Address field.

4 AVS No Match AMEX: 342135898797783
Discover: 6011587918359498
MasterCard: 5106447623213738
Visa: 4112296825756779

Enter AVS+NOMATCH as the value of the Name field and the first line of the Address field.

5 AVS Unsupported by Issuer AMEX: 347279493269015
Discover: 6011604410824034
MasterCard: 5152370491539153
Visa: 4112836497303994

Enter AVS+UNSUPPORTED as the value of the Name field and the first line of the Address field.

6 Credit Card Verification Number Match AMEX: 345796298727014
Discover: 6011648040903965
MasterCard: 5155659853141666
Visa: 4110716719147654

Enter CVV+MATCH as the value of the Name field and the first line of the Address field.

Enter any four-digit CVC code other than 0000, 5555 and 9999 for American Express. Enter any three-digit CVC code other than 000, 555 and 999 for Discover, MasterCard or Visa.

7 Credit Card Verification Number Unavailable AMEX: 342650299263839
Discover: 6011118186183608
MasterCard: 5199339067794810
Visa: 4112530021797363

Enter CVV+UNAVAILABLE as the value of the Name field and the first line of the Address field.

Enter 0000 as the four-digit CVC code for American Express. Enter 000 as the three-digit CVC code for Discover, MasterCard or Visa.

8 Credit Card Verification Number Error AMEX: 342781835011463
Discover: 6011789277338945
MasterCard: 5102881917494147
Visa: 4112653620165475

Enter CVV+ERROR as the value of the Name field and the first line of the Address field.

Enter 9999 as the four-digit CVC code for American Express. Enter 999 as the three-digit CVC code for Discover, MasterCard or Visa.

9 Credit Card Verification No Match AMEX: 342337649030528
Discover: 6011769851691760
MasterCard: 5155239927190195
Visa: 4113864427850982

Enter CVV+NOMATCH as the value of the Name field and the first line of the Address field.

Enter 5555 as the four-digit CVC code for American Express. Enter 555 as the three-digit CVC code for Discover, MasterCard or Visa.

10 Credit Card Authorization Successful AMEX: 348771682068975
Discover: 6011739196887563
MasterCard: 5184778657904478
Visa: 4119862760338320

Enter AUTH+OK as the value of the Name field and the first line of the Address field.

11 Credit Card Authorization Declined See special instructions below.

Note: Please see the special instructions below for testing a failed credit card authorization.

After creating your billing instruments, follow the steps below to verify these test cases:

  1. Post a shopping cart to the Google Checkout sandbox server.

  2. Select the credit card you would like to use to complete the purchase. Note that the order confirmation screen will only display the last four numbers of each credit card number. Please see the Credit Card List for Test Cases for a printer-friendly list of credit card numbers organized by card type (AMEX, Discover, etc.) and by test case.

  3. Click the Place your order now button.

  4. Click the Sign out link in the upper-right corner of the page.

  5. Log in to your sandbox seller account. (This should be the test merchant to which you submitted the order.)

  6. In the order inbox, click on the order that you just placed. Confirm that the Buyer credit verification window shows the appropriate AVS or CVV response for your test case. If you are testing to see whether a credit card is authorized or declined, the Order history window should reflect the correct information.

  7. If you have implemented the Notification API, verify that you receive the appropriate notification for the test:

Test Case for Failed Credit Card Authorization

The test case for receiving a failed credit card authorization uses a slightly different process. The process is different because if Google receives a failed authorization, Google will not let a customer use the same credit card until the card information is updated. As such, for this test case, you need to add the credit card while completing the purchase and then delete the card after it has received a failed authorization. The following steps explain how to test failed credit card authorizations:

  1. Post a shopping cart to the Google Checkout sandbox server.

  2. Enter a new credit card to complete the purchase. Please use one of the following credit card numbers:

    • American Express: 340682458348749
    • Discover: 6011191466819647
    • MasterCard: 5116381817387388
    • Visa: 4116196783374209

    Enter AUTH+DECLINE as the value of the Name field and the first line of the Address field.

  3. After adding the new credit card, click the Place your order now button.

  4. Click the Sign out link in the upper-right corner of the page.

  5. Log in to your sandbox seller account. (This should be the test merchant to which you submitted the order.)

  6. In the order inbox, click on the order that you just placed. Confirm that the Order history indicates that the authorization was declined.

  7. If you have implemented the Notification API, verify that you receive an order state change notification indicating that the order's financial status has updated to PAYMENT_DECLINED.

  8. After reviewing the test case, log in to the customer account that you used for the test. Delete the credit card that received the failed credit card authorization.