Skip to content

gocardless/woocommerce-gateway-gocardless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GoCardless for WooCommerce

Extends WooCommerce with a GoCardless gateway. A GoCardless merchant account is required.

WordPress tested up to version GPLv3+ License E2E test QIT Tests PHP Unit PHP Compatibility PHP Coding Standards

Overview

This is a feature plugin for accepting payments via GoCardless. It requires WooCommerce to be installed before GoCardless for WooCommerce can be activated.

Compatibility

This extension is compatible with:

Setup

Install the following plugins on your dev site:

  • WooCommerce

Test account setup

You can create a user on gocardless.com for live transactions and on the sandbox for test transactions. When you first set up a site, you’ll be prompted to create a user for the correct GoCardless environment when setting up the webhooks.

Screenshots

Where to enable GoCardless payment gateway: Payment Methods screen showing where to enable the GoCardless payment gateway.

Default GoCardless configuration: GoCardless settings screen showing the initial state.

Properly connected GoCardless configuration: GoCardless settings screen showing a store connected to ad configured with GoCardless to use the ACH direct debit scheme.

Development

Requirements

  • PHP: 7.4+
  • WordPress: 6.5+
  • WooCommerce: 9.4+
  • Node: v20
  • NPM: v10

Install dependencies & build

  • nvm install - Ensures the required Node version is installed.
  • npm install - Installs the necessary dependencies.
  • npm run build - Creates a .zip archive containing the extension files for release or testing on other sites.
  • npm run lint:js - Runs ESLint on JavaScript files.
  • npm run test:unit - Executes PHPUnit tests.

Run E2E Tests

Prerequisites

Dependencies for Local Testing

  • Add sandbox GoCardless credentials to the .env file, which can be found in the ./tests/e2e/config directory.
GOCARDLESS_EMAIL=********
GOCARDLESS_PASSWORD=********

Run E2E Tests Locally

  1. Run npm install.
  2. Run npx playwright install.
  3. Run npm run env:install-plugins
  4. Run npm run env:start (Note: Please start Docker before executing this command).
  5. Add environment variables to the /tests/e2e/config/.env file (as mentioned above).
  6. Run npm run test:e2e-local.

Run E2E Tests in the Pull Request

  • Add the needs: e2e testing label to the pull request; it will initiate the E2E test GitHub action to run tests against the PR.