spectrocoin / drupal-merchant
SpectroCoin cryptocurrency payment gateway for Drupal
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 5
Forks: 5
Open Issues: 0
Type:drupal-module
Requires
- composer/installers: ^1.10 || ^2.0 || ^3.0
- guzzlehttp/guzzle: ^7.8
This package is not auto-updated.
Last update: 2025-04-11 07:39:35 UTC
README
Integrate cryptocurrency payments seamlessly into your Drupal Commerce store with the SpectroCoin Crypto Payment Module. This module facilitates the acceptance of a variety of cryptocurrencies, enhancing payment options for your customers. Easily configure and implement secure transactions for a streamlined payment process on your Drupal website. Visit SpectroCoin Crypto Payment Module for Drupal to get started.
Installation
Drupal Commerce module has to be installed and enabled. If not yet installed follow this guide.
Via composer (recommended)
- Access your server or local terminal and navigate to Drupal project root directory (where composer.json is located).
- Run command:
composer require spectrocoin/drupal-merchant
By uploading module files via FTP
- Download latest release from github.
- Using FTP or file editor from Drupal root directory navigate to_/modules/contrib_ and extract modules files. Ensure that the module directory name is "commerce_spectrocoin".
- Unzip and place SpectroCoin module files.
Via drupal dashboard (Applicable only for Drupal versions 10 and lower)
- Download latest release from github.
- From Drupal admin dashboard navigate to Extend->Add new module -> upload module zip file.
Enabling module
- After the installation, from Drupal admin dashboard navigate to Commerce -> Configuration -> Payment gateways -> Add payment gateway.
- In Plugin section select SpectroCoin(Redirect to SpectroCoin).
Setting up
- Sign up for a SpectroCoin Account.
- Log in to your SpectroCoin account.
- On the dashboard, locate the Business tab and click on it.
- Click on New project.
- Fill in the project details and select desired settings (settings can be changed).
- Click "Submit".
- Copy and paste the "Project id".
- Click on the user icon in the top right and navigate to Settings. Then click on API and choose Create New API.
- Add "API name", in scope groups select "View merchant preorders", "Create merchant preorders", "View merchant orders", "Create merchant orders", "Cancel merchant orders" and click "Create API".
- Copy and store "Client id" and "Client secret". Save the settings.
Test order creation on localhost
We gently suggest trying out the plugin in a server environment, as it will not be capable of receiving callbacks from SpectroCoin if it will be hosted on localhost. To successfully create an order on localhost for testing purposes, change these 3 lines in CreateOrderRequest.php:
$this->callbackUrl = isset($data['callbackUrl']) ? Utils::sanitizeUrl($data['callbackUrl']) : null;,
$this->successUrl = isset($data['successUrl']) ? Utils::sanitizeUrl($data['successUrl']) : null;,
$this->failureUrl = isset($data['failureUrl']) ? Utils::sanitizeUrl($data['failureUrl']) : null;
To
$this->callbackUrl = "https://localhost.com/";,
$this->successUrl = "https://localhost.com/";,
$this->failureUrl = "https://localhost.com/";
Don't forget to change it back when migrating website to public.
Testing Callbacks
Order callbacks in the SpectroCoin plugin allow your WordPress site to automatically process order status changes sent from SpectroCoin. These callbacks notify your server when an order’s status transitions to PAID, EXPIRED, or FAILED. Understanding and testing this functionality ensures your store handles payments accurately and updates order statuses accordingly.
- Go to your SpectroCoin project settings and enable Test Mode.
- Simulate a payment status:
- PAID: Sends a callback to mark the order as Completed in WordPress.
- EXPIRED: Sends a callback to mark the order as Failed in WordPress.
- Ensure your
callbackUrl
is publicly accessible (local servers likelocalhost
will not work). - Check the Order History in SpectroCoin for callback details. If a callback fails, use the Retry button to resend it.
- Verify that:
- The order status in WordPress has been updated accordingly.
- The callback status in the SpectroCoin dashboard is
200 OK
.
Changelog
1.0.0 MAJOR (27/02/2025):
This major update introduces several improvements, including enhanced security, updated coding standards, and a streamlined integration process. Important: Users must generate new API credentials (Client ID and Client Secret) in their SpectroCoin account settings to continue using the plugin. The previous private key and merchant ID functionality have been deprecated.
Updated Order callback and payment setting logic. Fixed routing to success page.
Updated Order creation API endpoint has been updated for enhanced performance and security.
Removed Private key functionality and merchant ID requirement have been removed to streamline integration.
Added OAuth functionality introduced for authentication, requiring Client ID and Client Secret for secure API access.
Added API error logging and message displaying in order creation process.
Migrated Since HTTPful is no longer maintained, we migrated to GuzzleHttp. In this case /vendor directory was added which contains GuzzleHttp dependencies.
Reworked SpectroCoin callback handling was reworked. Added appropriate callback routing for success, fail and callback.
Updated Class and some method names have been updated based on PSR-12 standards.
Updated Composer class autoloading has been implemented.
Added Config.php file has been added to store plugin configuration.
Added Utils.php file has been added to store utility functions.
Added GenericError.php file has been added to handle generic errors.
Added Strict types have been added to all classes.
Information
This client has been developed by SpectroCoin.com If you need any further support regarding our services you can contact us via:
E-mail: merchant@spectrocoin.com
Skype: spectrocoin_merchant
Web
X (formerly Twitter)
Facebook