Commit 46da17ce authored by Daniel Kazior's avatar Daniel Kazior
Browse files

Merge branch 'version-1.1.2' into 'develop'

Version 1.1.2 merged into devel

See merge request crefopay/jtl-4!6
parents 0830daf6 b5849a0e
No preview for this file type
......@@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [1.1.2] - 2020-06-08
- Automatischer Cancel von Zahlungsreservierungen ohne zugehrige Bestellung
(Abfangen von Fehlern bei der Rckleitung und gezielten Bestellabbrchen)
- JTL-Shop 4.0.5 untersttzt keine Bestellattribute
## [1.1.1] - 2020-04-23
- Bercksichtigung von Mindermengenzuschlgen im Bestellvorgang
- Transaktionen wurden nicht immer korrekt zu einer Bestellung zugeordnet
## [1.1.0] - 2020-02-17
- Untersttzung von SmartSignup
- Optimierung des Checkouts mit CrefoPay
......
......@@ -5,7 +5,7 @@
<Author>lilfoot.software </Author>
<URL>https://lilfoot.software</URL>
<XMLVersion>100</XMLVersion>
<Shop4Version>405</Shop4Version>
<Shop4Version>406</Shop4Version>
<PluginID>lfs_crefopayment</PluginID>
<Install>
<Version nr="100">
......@@ -21,6 +21,13 @@
<Version nr="110">
<CreateDate>2020-02-17</CreateDate>
</Version>
<Version nr="111">
<CreateDate>2020-04-22</CreateDate>
</Version>
<Version nr="112">
<CreateDate>2020-06-08</CreateDate>
<SQL>update-112.sql</SQL>
</Version>
<Hooks>
<Hook id="7">lfs_crefopayment_hooks.php</Hook>
<Hook id="8">lfs_crefopayment_hooks.php</Hook>
......
......@@ -351,6 +351,7 @@ class cfpHelper
$_SESSION['payment_reserved'] = $aPost_arr['orderId'];
$_SESSION['cfp_reservecall'] = true;
$_SESSION['cfp_paymentreserved'] = true;
$_SESSION['cfp_orderId'] = $aPost_arr['orderId'];
$oReserveInsert = new stdClass();
$oReserveInsert->cfp_orderid = $aPost_arr['orderId'];
......
......@@ -15,7 +15,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_SESSION['cfp_paymentreserved'] = true;
$oReturn['success'] = true;
$oInsert = new stdClass();
$oInsert->cfp_orderid = $aPost_arr['orderId'];
$oInsert->cfp_orderid = $_SESSION['cfp_orderId'];
$oInsert->kBestellung = 0;
$oInsert->transaction_state = "NEW";
$oInsert->order_state = "PAYPENDING";
......@@ -36,7 +36,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
else {
$oReturn['success'] = false;
$oInsert = new stdClass();
$oInsert->cfp_orderid = $aPost_arr['orderId'];
$oInsert->cfp_orderid = $_SESSION['cfp_orderId'];
$oInsert->kBestellung = 0;
$oInsert->transaction_state = "NEW";
$oInsert->order_state = "PAYMENTFAILED";
......
<?php
global $cHinweis, $cFehler;
$bestellungen_arr = Shop::DB()->executeQuery("SELECT * FROM xplugin_lfs_crefopayment_orders
JOIN tbestellung ON tbestellung.kBestellung = xplugin_lfs_crefopayment_orders.kBestellung
ORDER BY xplugin_lfs_crefopayment_orders.kBestellung DESC", 2);
Shop::Smarty()->assign('bestellungen_arr', $bestellungen_arr);
Shop::Smarty()->assign('cHinweis', $cHinweis);
Shop::Smarty()->assign('cFehler', $cFehler);
Shop::Smarty()->assign('adminURL', "plugin.php?kPlugin=".$oPlugin->kPlugin);
Shop::Smarty()->display($oPlugin->cAdminmenuPfad . "template/orders.tpl");
\ No newline at end of file
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Bestell-Nr.</th>
<th>Bestell-Datum</th>
<th>Gesamtsumme</th>
<th>Zahlungsart</th>
<th>Versandart</th>
</tr>
</thead>
<tbody>
{if isset($bestellungen_arr) && count($bestellungen_arr)>0}
{foreach from=$bestellungen_arr item=bestellung}
<tr>
<td>{$bestellung->cBestellNr}</td>
<td>{$bestellung->dErstellt|date_format:"d.m.Y H:i"}</td>
<td>{$bestellung->fGesamtsumme} &euro;</td>
<td>{$bestellung->cZahlungsartName}</td>
<td>{$bestellung->cVersandartName}</td>
</tr>
{/foreach}
{else}
<tr>
<td colspan="5" align="center">- Keinen Bestellungen vorhanden -</td>
</tr>
{/if}
</tbody>
</table>
\ No newline at end of file
<div class="panel panel-default first">
<div class="panel-heading"><h3 class="panel-title">WaWi-Einstellungen</h3></div>
<div class="panel-body">
<div class="input-group">
<span class="input-group-addon">
<label for="crefopayment_merchant_id">Workflow-URL</label>
</span>
<span class="input-group-wrap">
<input class="form-control" readonly value="{$cfp_update_url}">
</span>
</div>
</div>
</div>
<div class="panel panel-default first">
<div class="panel-heading"><h3 class="panel-title">Workflow-Parameter "Capture"</h3></div>
<div class="panel-body">
<div class="input-group">
<span class="input-group-addon">
<label for="crefopayment_merchant_id">Parameter</label>
</span>
<span class="input-group-wrap">
<textarea class="form-control" readonly style="height: 85px;">{$capture_workflow_params}</textarea>
</span>
</div>
</div>
</div>
<div class="panel panel-default first">
<div class="panel-heading"><h3 class="panel-title">Workflow-Parameter "Cancel"</h3></div>
<div class="panel-body">
<div class="input-group">
<span class="input-group-addon">
<label for="crefopayment_merchant_id">Parameter</label>
</span>
<span class="input-group-wrap">
<textarea class="form-control" readonly style="height: 85px;">{$cancel_workflow_params}</textarea>
</span>
</div>
</div>
</div>
\ No newline at end of file
<?php
global $cHinweis, $cFehler;
Shop::Smarty()->assign('cfp_update_url', Shop::getURL()."/cfp_update");
$capture_workflow_params = "{% capture query -%}
SELECT cValue FROM tBestellungAttribute
JOIN tBestellung ON tBestellung.kBestellung = tBestellungAttribute.kBestellung
WHERE tBestellung.cBestellNr = '{{ Vorgang.Auftrag.Auftragsnummer }}'
AND tBestellungAttribute.cName = 'crefopay_orderid'
{% endcapture -%}
{% assign crefopay_orderid = query | DirectQueryScalar %}{% if crefopay_orderid != null %}Action=capture&merchantid=".$oPlugin->oPluginEinstellungAssoc_arr["crefopayment_merchant_id"]."&storeid=".$oPlugin->oPluginEinstellungAssoc_arr["crefopayment_store_id"]."&Rechnungsnummer={{ Vorgang.Auftrag.Rechnung.Rechnungsnummer }}&orderid={{ crefopay_orderid }}&amount={{ Vorgang.Auftrag.Gesamtbruttopreis }}{% endif %}";
Shop::Smarty()->assign('capture_workflow_params', $capture_workflow_params);
$cancel_workflow_params = "{% capture query -%}
SELECT cValue FROM tBestellungAttribute
JOIN tBestellung ON tBestellung.kBestellung = tBestellungAttribute.kBestellung
WHERE tBestellung.cBestellNr = '{{ Vorgang.Stammdaten.Auftragsnummer }}'
AND tBestellungAttribute.cName = 'crefopay_orderid'
{% endcapture -%}
{% assign crefopay_orderid = query | DirectQueryScalar %}{% if crefopay_orderid != null %}Action=cancel&merchantid=" . $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_merchant_id"] . "&storeid=".$oPlugin->oPluginEinstellungAssoc_arr["crefopayment_store_id"]."&bestellnr={{crefopay_orderid}}{% endif %}";
Shop::Smarty()->assign('cancel_workflow_params', $cancel_workflow_params);
Shop::Smarty()->assign('cHinweis', $cHinweis);
Shop::Smarty()->assign('cFehler', $cFehler);
Shop::Smarty()->assign('adminURL', "plugin.php?kPlugin=".$oPlugin->kPlugin);
Shop::Smarty()->display($oPlugin->cAdminmenuPfad . "template/wawi.tpl");
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?php
require_once $oPlugin->cFrontendPfad."/classes/cfpHelper.php";
$cfpHelper = new cfpHelper($oPlugin);
if (strpos($_SESSION['Zahlungsart']->cModulId, "crefopay") !== false) {
if (!isset($_SESSION['cfp_paymentinfo_set'])) {
header("Location: " . Shop::getURL()."/bestellvorgang.php?editZahlungsart=1");
}
}
\ No newline at end of file
<?php
require_once $oPlugin->cFrontendPfad."/classes/cfpHelper.php";
$cfpHelper = new cfpHelper($oPlugin);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['action']) && $_POST['action'] == "cfp_reserve" && isset($_SESSION['reserveData'])) {
$_SESSION['cfp_reservecall'] = time();
$oReturn = [];
$aPost_arr = (array)json_decode($_SESSION['reserveData']);
$result = $cfpHelper->reservePayment($aPost_arr);
if ($result !== null) {
$_SESSION['cfp_paymentreserved'] = true;
$oReturn['success'] = true;
$oInsert = new stdClass();
$oInsert->cfp_orderid = $_SESSION['cfp_orderId'];
$oInsert->kBestellung = 0;
$oInsert->transaction_state = "NEW";
$oInsert->order_state = "PAYPENDING";
$oInsert->created_at = date('Y-m-d H:i:s', time());
$oInsert->updated_at = date('Y-m-d H:i:s', time());
Shop::DB()->insertRow("xplugin_lfs_crefopayment_orders", $oInsert);
if ($result->resultCode == 0) {
// Keine Weiterleitung zur Besttigung erforderlich
$oReturn['cfp_redirectUrl'] = "";
}
else {
// Weiterleitung zur Besttigung erforderlich
$oReturn['cfp_redirectUrl'] = $result->redirectUrl;
}
}
else {
$oReturn['success'] = false;
$oInsert = new stdClass();
$oInsert->cfp_orderid = $_SESSION['cfp_orderId'];
$oInsert->kBestellung = 0;
$oInsert->transaction_state = "NEW";
$oInsert->order_state = "PAYMENTFAILED";
$oInsert->created_at = date('Y-m-d H:i:s', time());
$oInsert->updated_at = date('Y-m-d H:i:s', time());
Shop::DB()->insert('xplugin_lfs_crefopayment_orders', $oInsert);
}
header('Content-type: application/json');
print json_encode($oReturn);
die();
}
// Handle notifications by Crefopay-MNS
if (isset($_POST['merchantID']) && $_POST['merchantID'] === $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_merchant_id"]
&& isset($_POST['storeID']) && $_POST['storeID'] === $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_store_id"])
{
Jtllog::writeLog("Crefopay: Notification-Call " . print_r($_POST,1), JTLLOG_LEVEL_DEBUG);
$tmpCfpOrderData = Shop::DB()->selectSingleRow("xplugin_lfs_crefopayment_orders", "cfp_orderid", $_POST['orderID']);
if (is_object($tmpCfpOrderData)) {
Jtllog::writeLog("Crefopay: Notification-Call - Order found", JTLLOG_LEVEL_DEBUG);
if ($_POST['orderStatus'] != "")
$tmpCfpOrderData->order_state = $_POST['orderStatus'];
if ($_POST['transactionStatus'] != "")
$tmpCfpOrderData->transaction_state = $_POST['transactionStatus'];
if ($_POST['orderStatus'] != "" || $_POST['transactionStatus'] != "")
Shop::DB()->updateRow("xplugin_lfs_crefopayment_orders", "cfp_orderid", $_POST['orderID'], $tmpCfpOrderData);
$oInsert = new stdClass();
$oInsert->cfp_orderid = (isset($_POST['orderID']))?$_POST['orderID']:"-none-";
$oInsert->request_type = "Notification-Call";
$oInsert->request_data = verschluesselXTEA(print_r($_POST,1));
$oInsert->request_answer = "";
$oInsert->created_at = date('Y-m-d H:i:s', time());
$oInsert->updated_at = date('Y-m-d H:i:s', time());
Shop::DB()->insertRow("xplugin_lfs_crefopayment_log", $oInsert);
Jtllog::writeLog("Crefopay: Notification-Call - Bestellung " . print_r($tmpCfpOrderData, 1), JTLLOG_LEVEL_DEBUG);
if ($tmpCfpOrderData->kBestellung > 0) {
Jtllog::writeLog("Crefopay: Notification-Call - Bestellung found", JTLLOG_LEVEL_DEBUG);
$tmpOrder = new Bestellung($tmpCfpOrderData->kBestellung);
if (strstr($tmpOrder->cZahlungsartName, "PayPal") || strstr($tmpOrder->cZahlungsartName, "Kreditkarte") || strstr($tmpOrder->cZahlungsartName, "Sofort")) {
Jtllog::writeLog("Crefopay: Notification-Call - Set payment", JTLLOG_LEVEL_DEBUG);
if ($tmpOrder->cStatus != 3 && $tmpOrder->dBezahltDatum == '0000-00-00') {
if ($tmpCfpOrderData->transaction_state == "MERCHANTPENDING") {
$tmpKunde = new Kunde($tmpOrder->kKunde);
$tmpOrder->dBezahltDatum = date('Y-m-d', time());
if ($tmpOrder->cStatus < 3)
$tmpOrder->cStatus = 3;
$tmpOrder->updateInDB();
$cfpHelper->savePayment($tmpCfpOrderData, $tmpOrder, $tmpKunde);
}
}
}
}
http_response_code(200);
}
http_response_code(200);
die();
}
// END --- Handle notifications by Crefopay-MNS
// Handle calls from JTL-WaWi
$tmpRequestUri = str_replace("/", "", $_SERVER['REQUEST_URI']);
if ($tmpRequestUri == 'cfp_update') {
if ($_POST['Action'] == "capture" && $cfpHelper->checkMerchantAndStoreId($_POST['merchantid'], $_POST['storeid'])) {
$tmpCfpOrderData = Shop::DB()->selectSingleRow("xplugin_lfs_crefopayment_orders", "cfp_orderid", $_POST['orderid']);
if (!is_null($tmpCfpOrderData)) {
$tmpOrder = new Bestellung($tmpCfpOrderData->kBestellung);
$param = array(
'merchantID' => $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_merchant_id"],
'storeID' => $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_store_id"],
'orderID' => $tmpCfpOrderData->cfp_orderid,
'captureID' => $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_store_id"]."-".$_POST['Rechnungsnummer'],
'amount' => (str_replace(",",".",$_POST['amount'])*100)
);
$result = $cfpHelper->callCfpApi("capture", $param);
if ($result->resultCode > 0 && $result !== false) {
Jtllog::writeLog($oPlugin->cPluginID . ": " . $cfpHelper->mapErrorCode($result->resultCode) . " - " . print_r($param,1) . " - " . print_r($_POST,1), JTLLOG_LEVEL_ERROR);
}
else {
Jtllog::writeLog($oPlugin->cPluginID . ": " . $cfpHelper->mapErrorCode($result->resultCode) . " - Capture fr " . $tmpCfpOrderData->cfp_orderid . " ausgefhrt - " . print_r($_POST,1), JTLLOG_LEVEL_ERROR);
}
}
http_response_code(200);
die();
}
if ($_POST['Action'] == "cancel" && $cfpHelper->checkMerchantAndStoreId($_POST['merchantid'], $_POST['storeid'])) {
$tmpCfpOrderData = Shop::DB()->selectSingleRow("xplugin_lfs_crefopayment_orders", "cfp_orderid", $_POST['bestellnr']);
if (!is_null($tmpCfpOrderData)) {
$cfpHelper->cancelOrder($tmpCfpOrderData->cfp_orderid);
}
http_response_code(200);
die();
}
if ($_POST['Action'] == "transactionstatus" && $cfpHelper->checkMerchantAndStoreId($_POST['merchantid'], $_POST['storeid'])) {
$param = array(
'merchantID' => $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_merchant_id"],
'storeID' => $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_store_id"],
'orderID' => $_POST['orderID']
);
$cfpStatus = $cfpHelper->callCfpApi('getTransactionStatus', $param);
http_response_code(200);
die();
}
if ($_POST['Action'] == "getlogitem" && $cfpHelper->checkMerchantAndStoreId($_POST['merchantid'], $_POST['storeid'])) {
$logitem = Shop::DB()->selectSingleRow("xplugin_lfs_crefopayment_log", "id", $_POST['logid']);
if (is_object($logitem)) {
print entschluesselXTEA($logitem->request_data);
print entschluesselXTEA($logitem->request_answer);
}
else {
print "No item selected!";
}
http_response_code(200);
die();
}
}
}
<?php
if (Shop::getPageType() == PAGE_BESTELLVORGANG) {
require_once $oPlugin->cFrontendPfad."/classes/cfpHelper.php";
$cfpHelper = new cfpHelper($oPlugin);
Shop::Smarty()->assign('cfp_oPlugin', $oPlugin);
if (file_exists($oPlugin->cFrontendPfad."/template/crefopay_overlay_custom.tpl")) {
$overlayTpl = Shop::Smarty()->fetch($oPlugin->cFrontendPfad."/template/crefopay_overlay_custom.tpl");
}
else {
$overlayTpl = Shop::Smarty()->fetch($oPlugin->cFrontendPfad."/template/crefopay_overlay.tpl");
}
pq("body")->append($overlayTpl);
if (isset($_SESSION['cfp_reservecall']) && isset($_SESSION['cfp_paymentreserved'])) {
if (file_exists($oPlugin->cFrontendPfad."/template/crefopay_checkout_js_custom.tpl")) {
$adviceTpl = Shop::Smarty()->fetch($oPlugin->cFrontendPfad."/template/crefopay_checkout_js_custom.tpl");
}
else {
$adviceTpl = Shop::Smarty()->fetch($oPlugin->cFrontendPfad."/template/crefopay_checkout_js.tpl");
}
pq("#checkout > div")->prepend($adviceTpl);
}
if (isset($_SESSION['Zahlungsart']) && is_object($_SESSION['Zahlungsart'])) {
$cfp_marker = '<input type="hidden" id="is_cfp_payment" value="';
if (strpos($_SESSION['Zahlungsart']->cModulId, "crefopay") !== false) {
$cfp_marker .= '1">';
}
else {
$cfp_marker .= '0">';
}
pq("body")->append($cfp_marker);
}
}
// SmartSignup-Integration
if (version_compare(JTL_VERSION, "406", ">=")) {
$registerForm = pq("#form-register")->get();
$customerForm = pq("#neukunde")->get();
}
else {
$registerForm = pq("#new_customer")->get();
$customerForm = pq("#new_customer")->get();
}
if (Shop::getPageType() == PAGE_REGISTRIERUNG || (Shop::getPageType() === PAGE_BESTELLVORGANG && !empty($registerForm)) || (Shop::getPageType() === PAGE_BESTELLVORGANG && !empty($customerForm))) {
pq($oPlugin->oPluginEinstellungAssoc_arr['crefopayment_smartsignup_company'])->attr("data-crefopay-placeholder", "address.name")->attr("autocomplete", 'false');
pq($oPlugin->oPluginEinstellungAssoc_arr['crefopayment_smartsignup_street'])->attr("data-crefopay-placeholder", "address.street");
pq($oPlugin->oPluginEinstellungAssoc_arr['crefopayment_smartsignup_houseno'])->attr("data-crefopay-placeholder", "address.streetNo");
pq($oPlugin->oPluginEinstellungAssoc_arr['crefopayment_smartsignup_zip'])->attr("data-crefopay-placeholder", "address.zip");
pq($oPlugin->oPluginEinstellungAssoc_arr['crefopayment_smartsignup_city'])->attr("data-crefopay-placeholder", "address.city");
//pq($oPlugin->oPluginEinstellungAssoc_arr['crefopayment_smartsignup_country'])->attr("data-crefopay-placeholder", "address.country");
pq('body')->append('<input type="text" id="cfp_country_tmp" val="" data-crefopay-placeholder="address.country"');
Shop::Smarty()->assign('publicKey', $oPlugin->oPluginEinstellungAssoc_arr['crefopayment_public_key']);
Shop::Smarty()->assign('countryfieldselector', $oPlugin->oPluginEinstellungAssoc_arr['crefopayment_smartsignup_country']);
if ($oPlugin->oPluginEinstellungAssoc_arr['crefopayment_live_sandbox'] === 'live') {
Shop::Smarty()->assign('apiUrl', "https://api.crefopay.de/autocomplete/");
}
else {
Shop::Smarty()->assign('apiUrl', "https://sandbox.crefopay.de/autocomplete/");
}
pq('body')->append('<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>');
pq('body')->append('<script src="https://libs.crefopay.de/3.0/smart-sign-up.js"></script>');
pq("body")->append(Shop::Smarty()->fetch($oPlugin->cFrontendPfad."/template/crefopay_smartsignup.tpl"));
$tmpSmartSignupPath = $oPlugin->cFrontendPfadURLSSL. "/js/lfs_crefopay_smartsignup.js";
pq('body')->append('<script src="' . $tmpSmartSignupPath . '"></script>');
}
\ No newline at end of file
<?php
require_once $oPlugin->cFrontendPfad."/classes/cfpHelper.php";
$cfpHelper = new cfpHelper($oPlugin);
$tmpOrder = new Bestellung(Session::get("kBestellung"));
$tmpZahlungsart = new Zahlungsart($tmpOrder->kZahlungsart);
if ( strstr(strtolower($tmpZahlungsart->cModulId), "crefopay") !== false && (isset($_SESSION['cfp_orderId']) && $_SESSION['cfp_orderId'] !== "" ))
{
$tmpCfpOrderData = Shop::DB()->selectSingleRow("xplugin_lfs_crefopayment_orders", "cfp_orderid", $_SESSION['cfp_orderId']);
if (is_object($tmpCfpOrderData)) {
$oUpdate = new stdClass();
$oUpdate->kBestellung = Session::get("kBestellung");
Shop::DB()->updateRow("xplugin_lfs_crefopayment_orders", "cfp_orderid", $_SESSION['cfp_orderId'], $oUpdate);
$bestellAttribut = new stdClass();
$bestellAttribut->kBestellung = $tmpOrder->kBestellung;
$bestellAttribut->cName = 'crefopay_orderid';
$bestellAttribut->cValue = $_SESSION['cfp_orderId'];
Shop::DB()->insert('tbestellattribut', $bestellAttribut);
// unset payment reserve marker and delete db entry
Shop::DB()->delete("xplugin_lfs_crefopayment_paymentreservelog", "cfp_orderid", $_SESSION['payment_reserved']);
unset($_SESSION['payment_reserved']);
$param = array(
'merchantID' => $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_merchant_id"],
'storeID' => $oPlugin->oPluginEinstellungAssoc_arr["crefopayment_store_id"],
'orderID' => $_SESSION['cfp_orderId']
);
$cfpStatus = $cfpHelper->callCfpApi('getTransactionStatus', $param);
if ($cfpStatus !== false) {
Jtllog::writeLog("Crefopay: Status erhalten - " . print_r($cfpStatus,1), JTLLOG_LEVEL_DEBUG);
if ($cfpStatus->transactionStatus == "MERCHANTPENDING") {
// Wenn der Status passt --> Bestellung als bezahlt markieren
if ($cfpStatus->transactionStatus != "")
$tmpCfpOrderData->transaction_state = $cfpStatus->transactionStatus;
if ($cfpStatus->transactionStatus != "")
Shop::DB()->updateRow("xplugin_lfs_crefopayment_orders", "cfp_orderid", $tmpCfpOrderData->orderId, $tmpCfpOrderData);
if (strstr($tmpOrder->cZahlungsartName, "PayPal") || strstr($tmpOrder->cZahlungsartName, "Kreditkarte") || strstr($tmpOrder->cZahlungsartName, "Sofort")) {
Jtllog::writeLog("Crefopay: Zahlungsart ist PayPal, Kreditkarte oder Sofort", JTLLOG_LEVEL_DEBUG);
if ($tmpOrder->cStatus != 3 && $tmpOrder->dBezahltDatum == '0000-00-00') {
if ($tmpCfpOrderData->transaction_state == "MERCHANTPENDING") {
$tmpKunde = new Kunde($tmpOrder->kKunde);
$tmpOrder->dBezahltDatum = date('Y-m-d', time());
if ($tmpOrder->cStatus < 3)
$tmpOrder->cStatus = 3;
$tmpOrder->updateInDB();
$cfpHelper->savePayment($tmpCfpOrderData, $tmpOrder, $tmpKunde);
}
}
}
}
}
unset($_SESSION['cfp_orderId']);
unset($_SESSION['cfp_result']);
unset($_SESSION['cfp_kBestellung']);
unset($_SESSION['cfp_reservecall']);
unset($_SESSION['cfp_paymentreserved']);
}
}
\ No newline at end of file
<?php
require_once $oPlugin->cFrontendPfad."/classes/cfpHelper.php";
$cfpHelper = new cfpHelper($oPlugin);
unset($_SESSION['cfp_paymentinfo_set']);
unset($_SESSION['cfp_reservecall']);
unset($_SESSION['cfp_paymentreserved']);
$_SESSION['cfp_userIdUnreg'] = rand(50,500) . '_' . $_SESSION['Kunde']->cMail;
if ($cfpHelper->createTransaction()) {
Shop::Smarty()->assign('orderId', $_SESSION['cfp_orderId']);
Shop::Smarty()->assign('allowedCfpPaymentMethods', $_SESSION['cfp_paymentmethods']);
}
else {
$_SESSION['cfpUnavailable'] = true;
}
\ No newline at end of file
<?php
if (version_compare(Shop::getShopVersion(), 405, "<=")) {
unset($_SESSION['cfp_paymentinfo_set']);
unset($_SESSION['cfp_reservecall']);
unset($_SESSION['cfp_paymentreserved']);
require_once $oPlugin->cFrontendPfad . "/classes/cfpHelper.php";
$cfpHelper = new cfpHelper($oPlugin);
$_SESSION['cfp_userIdUnreg'] = rand(50, 500) . '_' . $_SESSION['Kunde']->cMail;
if ($cfpHelper->createTransaction()) {
Shop::Smarty()->assign('orderId', $_SESSION['cfp_orderId']);
Shop::Smarty()->assign('allowedCfpPaymentMethods', $_SESSION['cfp_paymentmethods']);
} else {
$_SESSION['cfpUnavailable'] = true;
}
}
// Check paymentmethods
// Paymentmethod mapping to plugin modulid
$paymentMethodMapping = [
"PAYPAL" => "kPlugin_" . $oPlugin->kPlugin . "_crefopaypaypal",