Overriding Gateway Fields

The checkout_form tag has a variable called gateway_fields that makes it simple to output code required by the gateway. You can override this fairly simply

  1. Go to cartthrob settings > payments and view the settings for your gateway. Scroll down until you see a large list of HTML. That is the HTML output by the gateway in the gateway fields variable. Copy the displayed HTML. You will add this HTML to your checkout form. A list of required fields are listed in the gateway settings. You must, at a minimum, capture those fields. All other inputs are optional.

  2. Go to your checkout_form template. In place of {gateway_fields} add the following:

        paste in all of the HTML
  3. Once you have the HTML in there, you'll probably want to update these inputs. You can add CartThrob customer info variables to make your customer experience better. You'll have to change something like this:

    <input type="text" value="" name="first_name" />

    to this

    <input type="text" value="{customer_first_name}" name="first_name" />

    You will have to do this for each input field. See customer_info for more information