Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Creating Test Payment Methods for Customers

Creating Test Payment Methods for Customers

The Cortex API contains resources that allow REGISTERED and PUBLIC customers to use test credit cards and test token payment methods. This section describes how to enable these resources and how to add these paymentmethods to REGISTERED customers through Cortex Studio.

Warning: Test Feature Only

These resources are only for testing purchase workflows in a developer environment. Do not use these resources in production.

Creating a Test Credit Card Payment Method

To Enable Cortex API Test Credit Card Resource:

Log into the Felix Web Console:
  1. Start your Cortex API server.
  2. Navigate to http://<Your cortex server>/system/console/configMgr. If Cortex API is running on a local server at port 8080, the URL is http://localhost:8080/cortex/system/console/configMgr
  3. Enter the User Name and Password in the Authentication dialog box: Felix Login The default credentials are:
    User Name Password
    admin admin
Enable the Test Credit Card Payment Method:
  1. Select Configuration from the OSGi drop-down list. Felix Configuration
  2. Click the TestCreditCardResource, select the Create Cards checkbox, and then click save. Felix Configuration Test Card

To create a test credit card for a PUBLIC or REGISTERED customer:

  1. In Cortex Studio, generate a PUBLIC or REGISTERED customer access token (see Cortex Studio: Getting Started)
  2. GET the following URI: /paymentmethods/mobee/creditcards/tests/form
  3. Fill out the credit card details and then click the createpaymentmethodaction button to create the credit card.
  4. If the post is successful, status 201 returns and Cortex Studio forwards you to the new paymentmethod. Unsuccessful creation returns a status 400. As this feature is for test purposes only, credit-card validation is not performed.

Creating a Test Token Payment Method

To Enable the Test Token Payment Method in Cortex API:

Log into the Felix Web Console:
  1. Start your Cortex API server.
  2. Navigate to http://<Your cortex server>/system/console/configMgr. If Cortex API is running on a local server at port 8080, the URL is http://localhost:8080/cortex/system/console/configMgr
  3. Enter the User Name and Password in the Authentication dialog box: Felix Login The default credentials are:
    User Name Password
    admin admin
Enable the Test Token Payment Method:
  1. Select Configuration from the OSGi drop-down list. Felix Configuration
  2. Click the TestPaymentTokenResource, select the Create Tokens checkbox, and then click save. Felix Configuration Test Card

To create a test Token for a PUBLIC or REGISTERED customer:

  1. In Cortex Studio, generate a PUBLIC or REGISTERED customer access token (see Cortex Studio: Getting Started)
  2. POST the following form to /cortex/testdefaultpaymenttoken
    {
      value:"test token guid",
      display:"test token display value", 
      username:"oliver.harris@elasticpath.com", 
      scope:"mobee"
    }
    

    The sample form creates a token for oliver.harris@elasticpath.com called test token display value.

  3. If the post is successful, a status 200 returns and the database tpaymenttoken table updates with the customer's token.