Stripe Checkout

Stripe Checkout is an embeddable payment form for desktop, tablet, and mobile devices.

It works within your site -customers can pay instantly, without being redirected away to complete the transaction.

With Stripe Checkout it is possible for returning customers to save credit cards and use them later without re-entering their card number.

This guide will show you the basic setup of Stripe in the Dynamicweb administration.

For more in-depth information about Stripe Checkout, please see https://stripe.com​ or https://support.stripe.com.

The Stripe checkout handler requires a SSL certificate to protect your customer payment information.

Additionally, please check the list of supported countries at the Stripe website.

The first thing you need to do is register an account with stripe – after testing, you will need to activate it, but for now test mode is all you need – all Stripe’s features are available in test mode, except the ability to actually charge money.

After creating your account, login to your stripe dashboard to find your API keys: Test Secret key, Test Publishable key, Live Secret key and Live Publishable key. You will use these with Dynamicweb to test and go live with your stripe payments.

Once logged in, you can configure your stripe account to suit your needs.

To learn more about what you can do, please see the stripe documentation – for basic integration with Dynamicweb you already have what you need in your API keys.

Once you have registered an account with Stripe, you must create and configure a payment method in Dynamicweb.

To do so:

  • Create or edit a payment method in the Management Center > Ecommerce > Orders > Payment following the regular procedure
  • Select the Stripe Checkout checkout handler from the dropdown
  • Fill in the associated parameters (Figure 3.1)
Figure 3.1 The Stripe checkout handler settings

You must:

  • Fill in the Test Secret key, Test Publishable key, Live Secret key and Live Publishable key provided by Stripe with your account
  • Select a language to use in the Stripe checkout form – auto selects a language based in the user’s browser configuration. English will be used by default. Stripe also uses the setting to format numbers and currencies; browser language English (en), for instance, results in displaying prices one way (“€25.00”), whereas browser language Hungarian (hu) renders prices following the Hungarian conventions (“25,00 €”).
  • Provide a Merchant Name – i.e. your company name – and a Merchant logo to be displayed in the checkout form
  • Select or create a post template to post transaction information to Stripe. Dynamicweb comes with two example templates:
    • Simple, which renders a blue “Pay with card”-button and submits your payment form with a Stripe token in a hidden input field.
    • Custom which provides an example with a custom button and passes a Stripe token to a JavaScript callback-
  • Select or create an error template in case of errors
  • Check the Capture now checkbox if you want to authorize and capture payment at the same time. This is the most common type of credit card transaction, but in some countries it is illegal to capture payment before you ship the order. You may also want to review your orders or check stock levels before finalizing an order.
  • Check the Test mode checkbox to simulate Stripe transactions without involving real money.

The HTML template files are located in your File Manager in the folder /Templates/eCom7/CheckoutHandler/Stripe

You should test your setup thoroughly before going live.

For testing purposes, make sure that the Test mode checkbox in the checkout handler has been checked.

You can use some of the following card numbers for testing purposes:

Number

Card type

4242424242424242         

Visa

4012888888881881

Visa

4000056655665556

Visa (debit)

5555555555554444

MasterCard

5400828282828210

MasterCard (debit)

5105105105105100

MasterCard (prepaid)

378282246310005

American Express

371449635398431

American Express

6011111111111117

Discover

6011000990139424

Discover

40569409025904

Diners Club

38540000023237

Diners Club

3540111333400000

JCB

3566004040360505

JCB

 Expiration Date must be a valid date in the future (use the mmyy format).

 

In addition, these cards will produce specific responses that are useful for testing different scenarios:

Number

Description

4000000000000077

Charge will succeed and funds will be added directly to your available balance (bypassing your pending balance).

4000000000000093

Charge will succeed and domestic pricing will be used (other test cards use international pricing). This card is only significant in countries with split pricing.

4000000000000010

With default account settings, charge will succeed but address_line1_check and address_zip_check will both fail.

4000000000000028

With default account settings, charge will succeed but address_line1_check will fail.

4000000000000036

With default account settings, charge will succeed but address_zip_check will fail.

4000000000000044

With default account settings, charge will succeed but address_zip_check and address_line1_check will both be unavailable.

4000000000000101

With default account settings, charge will succeed unless a CVC is entered, in which case cvc_check will fail and the charge will be declined.

4000000000000341

Attaching this card to a Customer object will succeed, but attempts to charge the customer will fail.

4000000000000002

Charge will be declined with a card_declined code.

4100000000000019

Charge will be declined with a card_declined code and a fraudulent reason.

4000000000000127

Charge will be declined with an incorrect_cvc code.

4000000000000069

Charge will be declined with an expired_card code.

4000000000000119

Charge will be declined with a processing_error code.

Find more information about testing at the Stripe website. 

Once your setup has been tested to your satisfaction, you can go live by simply:

  • Activating your Stripe account
  • Uncheck the Test mode checkbox on your checkout handler parameter settings