Advertising sustains the DA. Ads are hidden for members. Join today

Testing

Last updated on
31 May 2022
  • Review sandbox and test credit card info in the Testing using the API sandbox document.
  • To test your implementation, add a product to your cart, proceed to checkout and enter a credit card. We recommend using a sandbox account for this before attempting to go live.

If you have issues with your implementation, view the Drupal.org issue queue for this module https://www.drupal.org/project/issues/commerce_square?categories=All. If you cannot find another issue that matches yours, feel free to open a support request, bug, or another issue type.

Test card numbers

Brand Number
Visa 4111 1111 1111 1111
MasterCard 5105 1051 0510 5100
Discover 6011 0000 0000 0004
Diners Club 3000 000000 0004
JCB 3569 9900 1009 5841
American Express 3400 000000 00009
China UnionPay 6222 9888 1234 0000

Generate other errors

Error state To reproduce
Card CVV incorrect Specify 911 as the CVV in the payment form.
Card postal code incorrect Specify 99999 as the postal code in the payment form.
Card expiration date incorrect Specify 01 as the expiration month and 40 as the expiration year in the payment form.
Card declined Specify 403 in the amount_money field of your request to the Charge endpoint.

Help improve this page

Page status: No known problems

You can: