localgovdrupal / govuk_pay
Provides integration with GOV.UK Pay for Drupal.
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 8
Forks: 0
Open Issues: 5
Type:drupal-module
Requires
- tanc/govuk-pay-client-php: ^1.0.3
- 1.x-dev
- dev-1.x-webhooks
- dev-1.x-entity-view
- dev-1.x-submission-ref
- dev-1.x-unresolved-tokens
- dev-1.x-tests
- dev-1.x-session
- dev-1.x-test-kernel
- dev-1.x-test-github-workflow
- dev-1.x-tokens
- dev-1.x-update-status
- dev-1.x-metadata
- dev-revert-4-1.x-cookie
- dev-1.x-merge-reference-cookie
- dev-1.x-reference
- dev-1.x-cookie
This package is auto-updated.
Last update: 2025-04-18 07:58:11 UTC
README
Overview
This module provides integration with the GOV.UK Pay service for Drupal websites. GOV.UK Pay is the UK government's online payment service that allows users to make payments for government services.
Features
- Secure API integration with GOV.UK Pay service
- Bearer token authentication with the GOV.UK Pay API
- Base configuration and service methods for other modules to utilize
- Extensible architecture allowing for additional payment functionality
Requirements
- Drupal 9.x or 10.x
- Access to a GOV.UK Pay account and API key
Installation
- Install the module using Composer:
composer require drupal/govuk_pay
- Enable the module through the Drupal admin interface or using Drush:
drush en govuk_pay
Configuration
- Navigate to the configuration page at Administration → Configuration → Web services → GOV.UK Pay
- Enter your GOV.UK Pay API key
- Configure the payment reference format that will appear on all completed payments
- Save the configuration
API Authentication
The module handles authentication with the GOV.UK Pay API using the HTTP Bearer token format in the Authorization header. The API key is stored in Drupal's configuration system. You may want to override this key in your environment's settings.local.php
file. To do so you would add the following lines:
// Override the GOV.UK Pay API key $config['govuk_pay.settings']['gov_pay__apikey'] = 'your_api_key_here'; // Override the payment reference if needed $config['govuk_pay.settings']['gov_pay__reference'] = 'Your Payment Reference';
Extension
This module provides the base integration with GOV.UK Pay. Additional functionality is available through submodules:
- GOV.UK Pay Webform: Adds GOV.UK Pay integration to Drupal Webforms
Troubleshooting
- Ensure your API key is valid and has the correct permissions
- Check the Drupal logs for any API communication errors
- Verify your server can make outbound HTTPS requests to the GOV.UK Pay API endpoints
Credits
Originally developed by Webcurl. Refactored and updated by Royal Borough of Greenwich.
License
This project is licensed under the GNU General Public License v2.0 or later.