Skip to main content
knowledgecenter.2checkout.com

Set test orders in InLine Cart

Overview

Set the test mode in order to use card-based payment methods and eCheck/ACH using test cards and test cardholder names.

Use case

  1. Add an HTML link or button in your page like the one below.
  2. Create a JavaScript click handler to execute the Inline Client desired methods.
  3. Use theTwoCoInlineCart.products.add({code, quantity, options})method to prepare your catalog product.
  4. In order to test mode useTwoCoInlineCart.cart.setTest(true).
  5. Use theTwoCoInlineCart.cart.checkout()method to show the cart on your page.

Sample request

HTML

<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>

Javascript

window.document.getElementById('buy-button').addEventListener('click', function() {
  TwoCoInlineCart.products.add({
    code: "74B8E17CC0"
  });
  TwoCoInlineCart.cart.setTest(true);
  TwoCoInlineCart.cart.checkout();
});

Demo

After adding the products to the InLine cart using the above method for testing purposes, your cart should look like this:

Test cards

Card type Card number
VISA 4111111111111111
MasterCard 5555555555554444
AMEX 378282246310005
Discover 6011111111111117
JCB 3566111111111113

 

Use case. To achieve the desired result use the corresponding cardholder names. Cardholder name
Successful authorization for the initial transaction and all recurring charges. John Doe
Successful authorization for the initial transaction and manual renewal transactions but recurring charges fail to authorize with the Insufficient Funds error message. Mike Doe
Successful authorization for the initial transaction and manual renewal transactions but recurring charges fail to authorize with the Stolen Card error message. Jenny Doe
Insufficient funds Mona Doe
Try again later Mark Doe
Stolen card Red Doe
Authentication failed Joy Doe
Expired card Angela Doe
Invalid card number Adrian Doe
Invalid CVV Jack Doe
  • Was this article helpful?