PHPackages                             jmauzyk/commerce-cardconnect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. jmauzyk/commerce-cardconnect

AbandonedArchivedCraft-plugin[Payment Processing](/categories/payments)

jmauzyk/commerce-cardconnect
============================

CardConnect integration for Craft Commerce

1.5.1.1(5y ago)0201MITPHP

Since Sep 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jmauzyk/commerce-cardconnect)[ Packagist](https://packagist.org/packages/jmauzyk/commerce-cardconnect)[ RSS](/packages/jmauzyk-commerce-cardconnect/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (0)

CardConnect for Craft Commerce
==============================

[](#cardconnect-for-craft-commerce)

This plugin provides a [CardConnect](https://cardconnect.com/) integration for [Craft Commerce](https://craftcms.com/commerce).

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.1.0 and Commerce 2.0.0 or later.

Installation
------------

[](#installation)

You can install this plugin from the Plugin Store or with Composer.

### From the Plugin Store

[](#from-the-plugin-store)

Go to the Plugin Store in your project's Control Panel and search for *CardConnect for Craft Commerce*. Then click on the *Install* button in its modal window.

### With Composer

[](#with-composer)

1. Open your terminal and go to your Craft project:

    ```
    cd /path/to/project
    ```
2. Tell Composer to load the plugin:

    ```
    composer require jmauzyk/commerce-cardconnect
    ```
3. In the Control Panel, go to Settings → Plugins and click the *Install* button for CardConnect for Craft Commerce; or tell Craft to install the plugin:

    ```
    ./craft install/plugin commerce-cardconnect
    ```

Setup
-----

[](#setup)

### CardConnect API Credentials

[](#cardconnect-api-credentials)

You will receive production API credentials including a username, password, merchant ID, and endpoint from CardConnect when you create an account. For test credentials and test card numbers, see the [CardConnect Support Center](https://support.cardconnect.com/securenet-migration#accessing-cardConnects-uat-environment).

### Adding a CardConnect Gateway

[](#adding-a-cardconnect-gateway)

Go to Commerce → System Settings → Gateways and click the *New Gateway* button. Set the gateway type to *CardConnect*, fill in your test or production API credentials, and save.

Payment Forms
-------------

[](#payment-forms)

After installing and configuring the gateway, form fields will submit a transaction to CardConnect.

### Default Payment Form

[](#default-payment-form)

The basic Commerce payment form can be output using the following line of code.

```
{{ cart.gateway.getPaymentFormHtml({})|raw }}
```

As of v1.3.0, payment forms generated using `getPaymentFormHtml()` will use tokenized card numbers by default via CardConnect's [Hosted iFrame Tokenizer](https://developer.cardconnect.com/hosted-iframe-tokenizer). To change the tokenization method or revert to using clear text card numbers, select the appropriate *Tokenization* configuration under the gateway's settings. Per CardConnect's documentation it is **strongly recommended** that you tokenize the clear text card data before passing it into a request.

### Custom Payment Form

[](#custom-payment-form)

If additional customization is needed, custom payment forms can be used so long as they include inputs for the following attributes:

- `firstName`
- `lastName`
- An account `number` in the form of:
    - Clear text card number
    - CardSecure token
- An expiration date in the form of:
    - Individual `month` and `year`
    - Combined `expiry` (MM/YYYY)
- `cvv`

To use iframe tokenization with custom payment forms, use the following line of code to output the hosted iframe tokenizer with an accompanying hidden `number` input. Be sure to include your own JS event handler like the *Primary Payment Page Event Listener* shown in the [Hosted iFrame Tokenizer documentation](https://developer.cardconnect.com/hosted-iframe-tokenizer#implementing-the-hosted-iFrame).

```
{{ cart.gateway.getIframeNumberInput()|raw }}
```

To use CardSecure API tokenization with custom payment forms, use the code below as a basis. Element `id` and `name` attributes must be as shown in order to work with the tokenizer javascript.

```

    {% do view.registerAssetBundle("jmauzyk\\commerce\\cardconnect\\web\\assets\\cardsecurepaymentform\\CardSecurePaymentFormAsset") %}
    {% js %}initTokenizer('{{ gateway.getApiSubdomain() }}');{% endjs %}
```

To speed up tokenization performance, it's recommended to use code similar to below to preconnect or dns-prefetch before the tokenization is called.

```
{% set subdomain = gateway.getApiSubdomain() %}
{% set apiUrl = 'https://' ~ subdomain ~ '.cardconnect.com' %}
{% do view.registerLinkTag({rel: 'preconnect', href: apiUrl}) %}
{% do view.registerLinkTag({rel: 'dns-prefetch', href: apiUrl}) %}
```

### Hosted iFrame Tokenizer Customization

[](#hosted-iframe-tokenizer-customization)

The hosted iframe's appearance and functionality can modified using:

- `srcParams` — An array containing optional parameters passed with the iframe `src` URL
- `options` — An array containing attributes for constructing the `iframe` tag

Below is an example of how you can customize the default payment form and tokenized number input. All CSS will have unnecessary whitespace removed and be correctly encoded for the iframe tag. See the Hosted iFrame Tokenizer documentation for a full reference of [optional parameters](https://developer.cardconnect.com/hosted-iframe-tokenizer#optional-parameters) and [whitelisted CSS properties](https://developer.cardconnect.com/hosted-iframe-tokenizer#whitelisted-css-properties).

```
{% set css %}
    body {
        margin: 0;
    }

    input {
        border: 1px solid #ccc;
        border-radius: 0;
        color: #333;
    }

    input:focus {
        border-color: #09c;
    }

    .error, .error:focus {
        border-color: #c00;
        color: #c00;
    }
{% endset %}
{% set srcParams = {
    tokenizewheninactive: craft.app.request.isMobileBrowser(true),
    formatinput: 'true',
    invalidinputevent: 'true',
    css: css
} %}
{% set options = {
    height: '42'
} %}

{# To output default payment form with customization... #}
{{ cart.gateway.getPaymentFormHtml({srcParams: srcParams, options: options})|raw }}

{# To output tokenized number input with customization... #}
{{ gateway.getIframeNumberInput(srcParams, options)|raw }}
```

Custom User Fields
------------------

[](#custom-user-fields)

The CardPointe Gateway API supports custom [user fields](https://developer.cardpointe.com/cardconnect-api#additional-optional-fields) in authorization requests that can be recalled later. These custom values can be populated using the `UserFieldsEvent`:

```
use jmauzyk\commerce\cardconnect\events\UserFieldsEvent;
use jmauzyk\commerce\cardconnect\gateways\Gateway;
use yii\base\Event;

Event::on(
    Gateway::class,
    Gateway::USER_FIELDS_EVENT,
    function (UserFieldsEvent $e) {
        $order = $e->order;

        $e->userFields = [
            'note' => $order->note ?? '',
            // ...
        ];
    }
);
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity66

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Recently: every ~37 days

Total

14

Last Release

1887d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae3d26f41421f480c7341d69ca8fe6f2b193360f72d6407b7330484c5a923828?d=identicon)[jmauzyk](/maintainers/jmauzyk)

---

Tags

cmsgatewayCraftcraftcmscraft-plugincommercecardconnect

### Embed Badge

![Health badge](/badges/jmauzyk-commerce-cardconnect/health.svg)

```
[![Health](https://phpackages.com/badges/jmauzyk-commerce-cardconnect/health.svg)](https://phpackages.com/packages/jmauzyk-commerce-cardconnect)
```

###  Alternatives

[verbb/events

A full-featured plugin for event management and ticketing.

2311.8k](/packages/verbb-events)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
