Scanpay module for Magento 2
You need PHP version >= 5.6 with php-curl enabled. The module is available at Packagist. You can install the module with Composer or by manually uploading the files. Magento recommends that you use Composer. You can find a guide on how to install Composer here.
Navigate to your Magento folder and download the module with Composer:\
composer require scanpay/magento2
Enable the module and clear the static view files:\
php bin/magento module:enable Scanpay_PaymentModule --clear-static-content
Register the extension:\
php bin/magento setup:upgrade
Recompile your Magento store with the new module:\
php bin/magento setup:di:compile
Verify that the extension is enabled:\
php bin/magento module:status
Before you begin, you need to generate an API key in our dashboard (here). Always keep your API key private and secure.
Stores > Configuration > Sales > Payment Methods.
The actual HTML form presented for the customer can be found at
/Controller/Payment/GetPaymentURL.php containing the order id.
/Controller folder defines the publically served PHP pages.
It's served at an URL defined by
/Controller/Payment/GetPaymentURL.php gathers order parameters from Magento and uses
/Model/ScanpayClient.php to send an request to the Scanpay API.
Upon success it will return a payment url which the webshop customer should be redirected to.
/Model folder defines utility classes used by other PHP files.
For instance it containts
ScanpayClient.php which does the actual http request to the Scanpay API using PHP-curl.
/etc folder defines module dependencies, module configuration, module naming and the layout of the admin panel module configuration.