Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Novalnet-Technic authored Jun 13, 2024
1 parent 94731ce commit ac46493
Show file tree
Hide file tree
Showing 27 changed files with 4,630 additions and 0 deletions.
78 changes: 78 additions & 0 deletions Bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php
/**
* This file refers to the initialization of a plugin for the subsequent use
*
* @author Novalnet
* @copyright Copyright (c) Novalnet
* @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
*
* Script: Bootstrap.php
*
*/

namespace Plugin\jtl_novalnet;

use JTL\Events\Dispatcher;
use JTL\Plugin\Bootstrapper;
use JTL\Shop;
use JTL\Smarty\JTLSmarty;
use Plugin\jtl_novalnet\frontend\NovalnetHookHandler;
use Plugin\jtl_novalnet\src\NovalnetWebhookHandler;
use Plugin\jtl_novalnet\adminmenu\NovalnetBackendTabRenderer;

/**
* Class Bootstrap
* @package Plugin\jtl_novalnet
*/
class Bootstrap extends Bootstrapper
{
/**
* Boot additional services for the payment method
*/
public function boot(Dispatcher $dispatcher): void
{
parent::boot($dispatcher);
// Custom frontend operations for the Novalnet Plugin
if (Shop::isFrontend()) {
$novalnetHookHandler = new NovalnetHookHandler($this->getPlugin());
// Display the Novalnet transaction comments on order status page when payment before order completion option is set to 'Ja'
$dispatcher->listen('shop.hook.' . \HOOK_BESTELLABSCHLUSS_INC_BESTELLUNGINDB, [$novalnetHookHandler, 'orderStatusPage']);
// Loads the Novalnet Payment form on the checkout page
$dispatcher->listen('shop.hook.' . \HOOK_BESTELLVORGANG_PAGE_STEPZAHLUNG, [$novalnetHookHandler, 'displayNnPaymentForm']);
// Used for the frontend template customization
$dispatcher->listen('shop.hook.' . \HOOK_SMARTY_OUTPUTFILTER, [$novalnetHookHandler, 'contentUpdate']);
// Display the Novalnet transaction comments aligned in My Account page of the user
$dispatcher->listen('shop.hook.' . \HOOK_JTL_PAGE, [$novalnetHookHandler, 'accountPage']);
// Change the WAWI pickup status as 'JA' before payment completion
$dispatcher->listen('shop.hook.' . \HOOK_BESTELLABSCHLUSS_INC_BESTELLUNGINDB_ENDE, [$novalnetHookHandler, 'changeWawiPickupStatus']);
// Change the payment name based on the customer chosen payment in the payment form
$dispatcher->listen('shop.hook.' . \HOOK_BESTELLVORGANG_PAGE_STEPBESTAETIGUNG, [$novalnetHookHandler, 'updatePaymentName']);
// Handle the webhook process
if (isset($_REQUEST['novalnet_webhook'])) {
// When the Novalnet webhook is triggered and known through URL, we call the appropriate Novalnet webhook handler
$novalnetWebhookHandler = new NovalnetWebhookHandler($this->getPlugin());
$dispatcher->listen('shop.hook.' . \HOOK_INDEX_NAVI_HEAD_POSTGET, [$novalnetWebhookHandler, 'handleNovalnetWebhook']);
}
if (isset($_REQUEST['novalnet_refund'])) {
// When the Novalnet webhook is triggered and known through URL, we call the appropriate Novalnet webhook handler
$novalnetWebhookHandler = new NovalnetWebhookHandler($this->getPlugin());
$dispatcher->listen('shop.hook.' . \HOOK_INDEX_NAVI_HEAD_POSTGET, [$novalnetWebhookHandler, 'handleNovalnetRefund']);
}
}
}

/**
* Render the Novalnet admin tabs in the shop backend
*
* @param string $tabName
* @param int $menuID
* @param JTLSmarty $smarty
* @return string
*/
public function renderAdminMenuTab(string $tabName, int $menuID, JTLSmarty $smarty): string
{
// Render Novalnet Plugin's backend tabs and it's related functions
$backendRenderer = new NovalnetBackendTabRenderer($this->getPlugin(), $this->getDB());
return $backendRenderer->renderNovalnetTabs($tabName, $menuID, $smarty);
}
}
69 changes: 69 additions & 0 deletions Migrations/Migration20210608221920.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php
/**
* This file create the custom table
*
* @author Novalnet
* @copyright Copyright (c) Novalnet
* @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
*
* Script: Migration20210608221920.php
*/

namespace Plugin\jtl_novalnet\Migrations;

use JTL\Plugin\Migration;
use JTL\Update\IMigration;

/**
* Class Migration20210608221920
* @package Plugin\jtl_novalnet\Migrations
*/
class Migration20210608221920 extends Migration implements IMigration
{
/**
* Create Novalnet transaction details table during the novalnet plugin installation
*
*/
public function up()
{
$this->execute('CREATE TABLE IF NOT EXISTS `xplugin_novalnet_transaction_details` (
`kId` int(10) NOT NULL AUTO_INCREMENT,
`cNnorderid` VARCHAR(64) NOT NULL,
`nNntid` BIGINT(20) NOT NULL,
`cZahlungsmethode` VARCHAR(64) NOT NULL,
`cMail` VARCHAR(255) NOT NULL,
`cStatuswert` VARCHAR(64),
`nBetrag` INT(11) NOT NULL,
`cSaveOnetimeToken` TINYINT(1) DEFAULT 0,
`cTokenInfo` LONGTEXT DEFAULT NULL,
`cAdditionalInfo` LONGTEXT DEFAULT NULL,
INDEX (cNnorderid, nNntid, cZahlungsmethode),
PRIMARY KEY (`kId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'
);

$this->execute('CREATE TABLE IF NOT EXISTS `xplugin_novalnet_callback` (
`kId` INT(10) NOT NULL AUTO_INCREMENT,
`cNnorderid` VARCHAR(64) NOT NULL,
`nCallbackTid` BIGINT(20) NOT NULL,
`nReferenzTid` BIGINT(20) NOT NULL,
`cZahlungsmethode` VARCHAR(64) NOT NULL,
`dDatum` datetime NOT NULL,
`nCallbackAmount` INT(11) DEFAULT NULL,
`cWaehrung` VARCHAR(64) DEFAULT NULL,
INDEX (cNnorderid),
PRIMARY KEY (`kId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'
);
}

/**
* Delete Novalnet transaction details table during the novalnet plugin uninstallation
*
*/
public function down()
{
$this->execute('DROP TABLE IF EXISTS `xplugin_novalnet_transaction_details`');
$this->execute('DROP TABLE IF EXISTS `xplugin_novalnet_callback`');
}
}
52 changes: 52 additions & 0 deletions Migrations/Migration20230303113003.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
* This file update the previous Novalnet custom the table
*
* @author Novalnet
* @copyright Copyright (c) Novalnet
* @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
*
* Script: Migration20210608221920.php
*/

namespace Plugin\jtl_novalnet\Migrations;

use JTL\Plugin\Migration;
use JTL\Update\IMigration;
use JTL\Shop;
/**
* Class Migration20230303113003
* @package Plugin\jtl_novalnet\Migrations
*/
class Migration20230303113003 extends Migration implements IMigration
{
/**
* Remove the column from the Novalnet transaction details table during the novalnet plugin installation
*
*/
public function up()
{
$this->execute('ALTER TABLE xplugin_novalnet_transaction_details
ADD COLUMN `nCallbackAmount` INT(11) DEFAULT NULL,
DROP COLUMN cSaveOnetimeToken,
DROP COLUMN cTokenInfo'
);
// Check if the callback history table already exist or not
$isCallbackTableExists = Shop::Container()->getDB()->queryPrepared("SHOW TABLES LIKE :callback", [":callback" => "%xplugin_novalnet_callback%"]);
if ($isCallbackTableExists) {
$previousCallBackDetails = Shop::Container()->getDB()->queryPrepared("SELECT nc.nCallbackTid callbackTid, sum(nc.nCallbackAmount) callbackAmount FROM xplugin_novalnet_callback nc, xplugin_novalnet_transaction_details nt WHERE nc.nCallbackTid = :nCallbackTid group by :nCallbackTid", [":nCallbackTid" => "nt.nNntid", ":nCallbackTid" => "nc.nCallbackTid"]);
if (is_array($previousCallBackDetails) || is_object($previousCallBackDetails)) {
foreach ($previousCallBackDetails as $previousCallBackDetail) {
$previousCallBackDetails = Shop::Container()->getDB()->queryPrepared("UPDATE xplugin_novalnet_transaction_details SET nCallbackAmount = :callbackamount WHERE nNntid = :nCallbackTid and nCallbackAmount IS NULL LIMIT 1", [":callbackamount" => "$previousCallBackDetail->callbackAmount", ":nCallbackTid" => "$previousCallBackDetail->callbackTid"]);
}
}
// After updating the values to xplugin_novalnet_transaction_details from callback history table and the delete the below table
$this->execute('DROP TABLE `xplugin_novalnet_callback`');
}
}

public function down()
{

}
}
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# JTL5 SHOP PAYMENT PLUGIN BY NOVALNET

The JTL shop payment plugin by Novalnet enables secure integration of payments and payment services for all JTL shops. Novalnet payment plugin for JTL shop helps merchants to automate payment processing from checkout till collection.

## Integration Requirements for JTL5 Shop Payment Plugin

The module is available for the 5.0.0 - 5.3.2 versions in the following languages: EN & DE and requires PHP versions 5.6 and higher.
Novalnet merchant account is required for processing all international and local payments in JTL shop. You can get yours here: <a href= "https://www.novalnet.de/kontakt"> https://www.novalnet.de/kontakt/sales </a>

## Key Features of JTL5 Shop Payment Plugin

* Easy configuration of all payment methods (local & international)
* Up-to-date payment portfolio & automated processing
* Plug & Play platform eliminating the need of extra plugins/scripts/contracts
* PCI-certified payment integration
* Credit Card with 3D Secure
* Seamless checkout Iframe integration
* Comprehensive fraud prevention solution with more than 60 modules
* Secure SSL encoded gateways
* On-hold transaction configuration in the shop admin panel
* One click shopping supported Credit/Debit Cards & Direct Debit SEPA
* Zero amount authorization supported for Credit/Debit Cards, Direct Debit SEPA, Apple Pay & Google Pay
* Real-time synchronization of data between JTL-Shop and JTL-Wawi
* Responsive templates

For detailed documentation and other technical inquiries, please send us an email at <a href="mailto:[email protected]"> [email protected] </a>

## Integrated Payment Methods

- Direct Debit SEPA
- Direct Debit ACH
- Credit/Debit Cards
- Apple Pay
- Google Pay
- Invoice
- Prepayment
- Invoice with payment guarantee
- Direct Debit SEPA with payment guarantee
- Instalment by Invoice
- Instalment by Direct Debit SEPA
- iDEAL
- Sofort
- giropay
- Barzahlen/viacash
- Przelewy24
- eps
- PayPal
- MB Way
- PostFinance Card
- PostFinance E-Finance
- Bancontact
- Multibanco
- Online bank transfer
- Alipay
- WeChat Pay
- Trustly
- Blik
- Payconiq

## Installation of JTL5 Shop Payment Plugin

Follow these steps for JTL shop Payment Integration by Novalnet:
1. Get the payment plugin for JTL shop & detailed documentation by <a href="https://www.novalnet.de/kontakt"> contacting us </a>
2. Upload the payment plugin to your JTL shop
3. Activate the plugin
4. Configure Product Activation Key & Payment access key in the shop admin panel
5. Activate & configure the preferred payment types in your shop admin panel

## License

See our License Agreement at: https://www.novalnet.com/payment-plugins-free-license/

## Documentation & Support

If you have any inquiries, please contact one of the following departments:

### Technical support
[email protected] <br>
+49 89 9230683-19

### Sales team
[email protected] <br>
+49 89 9230683-20

## Who is Novalnet?

<a href="www.novalnet.de/">Novalnet AG</a> is a German payment provider offering payment gateways for online merchants and marketplaces worldwide. Our PCI DSS certified SaaS engine is designed to automate the entire payment process from checkout to debt collection – with a single integration. We cover real-time risk management; secure payments (local + international) through escrow accounts, integrate receivables management, dynamic member and subscription management as well as other customized payment solutions to your JTL shop. For a complete and seamless shop system we do support JTL-Wawi integration for JTL shop.
Loading

0 comments on commit ac46493

Please sign in to comment.