Commit fb04d5d9 authored by Andy J's avatar Andy J

Merge branch 'master' of gitlab.jtl-software.de:jtlshop/paypal into HEAD

parents e2ea0640 604ec8d7
......@@ -587,7 +587,7 @@ Best Regards
<ValueName>jtl_paypal_wk_headline</ValueName>
</Setting>
<Setting type="selectbox" initialValue="N" sort="2" conf="Y">
<Name>PayPal-Express-Button auf Warenkorbseite aktivieren?</Name>
<Name>Im Warenkorbseite aktivieren?</Name>
<Description>Kunde gelangt von Warenkorb-Seite direkt zu PayPal.</Description>
<ValueName>jtl_paypal_express_cart_button</ValueName>
<SelectboxOptions>
......@@ -636,7 +636,7 @@ Best Regards
<ValueName>jtl_paypal_article_headline</ValueName>
</Setting>
<Setting type="selectbox" initialValue="N" sort="11" conf="Y">
<Name>PayPal Express Button auf Artikeldetailseite aktivieren?</Name>
<Name>Button auf Artikeldetailseite aktivieren?</Name>
<Description>Kunde gelangt von Artikeldetailseite direkt zu PayPal.</Description>
<ValueName>jtl_paypal_express_article</ValueName>
<SelectboxOptions>
......@@ -653,6 +653,16 @@ Best Regards
<Option value="gold" sort="2">gold</Option>
</SelectboxOptions>
</Setting>
<Setting type="selectbox" initialValue="medium" sort="13" conf="Y">
<Name>Gre des Buttons</Name>
<Description />
<ValueName>jtl_paypal_express_article_button_size</ValueName>
<SelectboxOptions>
<Option value="small" sort="1">klein</Option>
<Option value="medium" sort="2">mittel</Option>
<Option value="large" sort="3">gro</Option>
</SelectboxOptions>
</Setting>
<Setting type="text" initialValue="#add-to-cart .form-inline, #article_buyfield" sort="13" conf="Y">
<Name>PHPQuery Selector</Name>
<Description />
......@@ -670,20 +680,103 @@ Best Regards
</SelectboxOptions>
</Setting>
<Setting type="text" initialValue="Y" sort="20" conf="N">
<Name>Sonstige Einstellungen</Name>
<Name>Einstellungen fr PayPal Button im Mini-Warenkorb</Name>
<Description />
<ValueName>jtl_paypal_sonstige_headline</ValueName>
<ValueName>jtl_paypal_cart_popup_headline</ValueName>
</Setting>
<Setting type="selectbox" initialValue="Y" sort="24" conf="Y">
<Name>Checkboxen aus Registrierungsseite auf Bestellbersichtsseite anzeigen</Name>
<Description>Sollen die Checkboxen aus der Registrierungsseite auf der Bestellbersichtsseite
angezeigt werden?</Description>
<ValueName>jtl_paypal_set_checkboxes</ValueName>
<Setting type="selectbox" initialValue="N" sort="21" conf="Y">
<Name>Button im Mini-Warenkorb aktivieren?</Name>
<Description>Kunde gelangt von Mini-Warenkorb direkt zu PayPal.</Description>
<ValueName>jtl_paypal_express_cart_popup</ValueName>
<SelectboxOptions>
<Option value="Y" sort="1">Ja</Option>
<Option value="N" sort="2">Nein</Option>
</SelectboxOptions>
</Setting>
<Setting type="selectbox" initialValue="silver" sort="22" conf="Y">
<Name>Art des Buttons</Name>
<Description />
<ValueName>jtl_paypal_express_cart_popup_button_type</ValueName>
<SelectboxOptions>
<Option value="silver" sort="1">silber</Option>
<Option value="gold" sort="2">gold</Option>
</SelectboxOptions>
</Setting>
<Setting type="selectbox" initialValue="medium" sort="23" conf="Y">
<Name>Gre des Buttons</Name>
<Description />
<ValueName>jtl_paypal_express_cart_popup_size</ValueName>
<SelectboxOptions>
<Option value="small" sort="1">klein</Option>
<Option value="medium" sort="2">mittel</Option>
<Option value="large" sort="3">gro</Option>
</SelectboxOptions>
</Setting>
<Setting type="text" initialValue=".cart-dropdown" sort="24" conf="Y">
<Name>PHPQuery Selector</Name>
<Description />
<ValueName>jtl_paypal_express_cart_popup_selector</ValueName>
</Setting>
<Setting type="selectbox" initialValue="after" sort="25" conf="Y">
<Name>PHPQuery Methode</Name>
<Description />
<ValueName>jtl_paypal_express_cart_popup_method</ValueName>
<SelectboxOptions>
<Option value="after" sort="1">after</Option>
<Option value="before" sort="2">before</Option>
<Option value="prepend" sort="3">prepend</Option>
<Option value="append" sort="4">append</Option>
</SelectboxOptions>
</Setting>
<Setting type="text" initialValue="Y" sort="30" conf="N">
<Name>Einstellungen fr PayPal Button im Bestellvorgang</Name>
<Description />
<ValueName>jtl_paypal_express_checkout_headline</ValueName>
</Setting>
<Setting type="selectbox" initialValue="N" sort="31" conf="Y">
<Name>Button auf Auswahlseite anzeigen?</Name>
<Description>(Ich bin bereits Kunde, als Neukunde fortfahren)</Description>
<ValueName>jtl_paypal_express_checkout</ValueName>
<SelectboxOptions>
<Option value="Y" sort="1">Ja</Option>
<Option value="N" sort="2">Nein</Option>
</SelectboxOptions>
</Setting>
<Setting type="selectbox" initialValue="silver" sort="32" conf="Y">
<Name>Art des Buttons</Name>
<Description />
<ValueName>jtl_paypal_express_checkout_button_type</ValueName>
<SelectboxOptions>
<Option value="silver" sort="1">silber</Option>
<Option value="gold" sort="2">gold</Option>
</SelectboxOptions>
</Setting>
<Setting type="selectbox" initialValue="medium" sort="33" conf="Y">
<Name>Gre des Buttons</Name>
<Description />
<ValueName>jtl_paypal_express_checkout_button_size</ValueName>
<SelectboxOptions>
<Option value="small" sort="1">klein</Option>
<Option value="medium" sort="2">mittel</Option>
<Option value="large" sort="3">gro</Option>
</SelectboxOptions>
</Setting>
<Setting type="text" initialValue="#order_register_or_login" sort="34" conf="Y">
<Name>PHPQuery Selector</Name>
<Description />
<ValueName>jtl_paypal_express_checkout_selector</ValueName>
</Setting>
<Setting type="selectbox" initialValue="after" sort="34" conf="Y">
<Name>PHPQuery Methode</Name>
<Description />
<ValueName>jtl_paypal_express_checkout_method</ValueName>
<SelectboxOptions>
<Option value="after" sort="1">after</Option>
<Option value="before" sort="2">before</Option>
<Option value="prepend" sort="3">prepend</Option>
<Option value="append" sort="4">append</Option>
</SelectboxOptions>
</Setting>
</Settingslink>
<Settingslink sort="3">
<Name>PayPal Ratenzahlung</Name>
......
......@@ -584,7 +584,7 @@ class PayPalFinance extends PaymentMethod
$payment = Payment::get($paymentId, $apiContext);
if ($payment->getState() != 'created') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
/*
......
......@@ -566,7 +566,7 @@ class PayPalPlus extends PaymentMethod
$payment = Payment::get($paymentId, $apiContext);
if ($payment->getState() != 'created') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
/*
......
......@@ -606,7 +606,7 @@ class PayPalFinance extends PaymentMethod
$payment = Payment::get($paymentId, $apiContext);
if ($payment->getState() != 'created') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
$this->patch($payment, $orderNumber, $_SESSION['Lieferadresse']);
......
......@@ -504,7 +504,7 @@ class PayPalPlus extends PaymentMethod
$payment = Payment::get($paymentId, $apiContext);
if ($payment->getState() != 'created') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
/*
......
......@@ -732,7 +732,7 @@ class PayPalFinance extends PaymentMethod
$this->logResult('ExecutePayment', $execution, $payment);
if ($payment->getState() !== 'approved') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
$sale = $payment->getTransactions()[0]
......
......@@ -5,13 +5,13 @@
</div>
{/if}
<h2>Zugangsdaten fr PayPal Express / Basis abrufen</h2>
<h2>Zugangsdaten f&uuml;r PayPal Express / Basis abrufen</h2>
<p>
<a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_get-api-signature&generic-flow=true" class="btn btn-primary" target="_blank">Live-Zugangsdaten</a>
<a href="https://www.sandbox.paypal.com/de/cgi-bin/webscr?cmd=_get-api-signature&generic-flow=true" class="btn btn-default" target="_blank">Sandbox-Zugangsdaten</a>
</p>
<h2>Konfiguration validieren</h2>
<h2>Konfiguration validieren</h2>
<p>
Durch Klick auf einen der nachfolgenden Buttons wird ein Test-Aufruf mit den von Ihnen hinterlegten Zugangsdaten an PayPal-Server abgesetzt.
......@@ -43,15 +43,15 @@
</div>
{/if}
<h2>TLS 1.2 Untersttzung prfen</h2>
<h2>TLS 1.2 Unterst&uuml;tzung pr&uuml;fen</h2>
<p>
Prfen Sie, ob Ihr System eine mit TLS 1.2 verschlsselte Verbindung ber HTTP/1.1 zu PayPal aufbauen kann.
Pr&uuml;fen Sie, ob Ihr System eine mit TLS 1.2 verschl&uuml;sselte Verbindung &uuml;ber HTTP/1.1 zu PayPal aufbauen kann.
</p>
<form id="paypal-test-credentials" method="post" action="{$post_url}">
<div class="btn-group" role="group">
<button class="btn btn-default" name="security" value="basic">Jetzt prfen</button>
<button class="btn btn-default" name="security" value="basic">Jetzt pr&uuml;fen</button>
<a href="https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ1913&expand=true&locale=de_DE" target="_blank" class="btn btn-default">Weitere Informationen</a>
</div>
</form>
......@@ -75,4 +75,4 @@
<p>
<a href="http://jtl-url.de/paypaldocs" class="btn btn-primary" target="_blank"><i class="fa fa-file-pdf-o"></i> Integrationshandbuch zu diesem Plugin lesen</a>
</p>
</div>
\ No newline at end of file
</div>
......@@ -11,12 +11,12 @@
</div>
{else}
<div class="alert alert-info">
<i class="fa fa-info-circle"></i> Whlen Sie bis zu 5 zustzliche Zahlungsarten aus, die in der Payment Wall unter den Standard-Bezahlmethoden von PayPal PLUS angeboten werden.
<i class="fa fa-info-circle"></i> W&auml;hlen Sie bis zu 5 zus&auml;tzliche Zahlungsarten aus, die in der Payment Wall unter den Standard-Bezahlmethoden von PayPal PLUS angeboten werden.
</div>
{/if}
<div class="panel panel-default">
<div class="panel-heading" style="border-bottom:0">
<h3 class="panel-title">Verfgbare Zahlungsarten</h3>
<h3 class="panel-title">Verf&uuml;gbare Zahlungsarten</h3>
</div>
<form method="post" action="{$postUrl}">
<input type="hidden" name="save" value="1">
......
This diff is collapsed.
<?php
/**
* @copyright (c) JTL-Software-GmbH
* @license http://jtl-url.de/jtlshoplicense
*/
/**
* HOOK_CHECKBOX_CLASS_GETCHECKBOXFRONTEND.
*/
if ($oPlugin->oPluginEinstellungAssoc_arr['jtl_paypal_set_checkboxes'] !== 'N' && isset($_SESSION['paypalexpress']) && isset($args_arr['bSprache'])) {
$sql = "SELECT kCheckBox
FROM tcheckbox
WHERE cAnzeigeOrt LIKE '%;" . intval(CHECKBOX_ORT_REGISTRIERUNG) . ";%'
AND cKundengruppe LIKE '%;" . $_SESSION['Kundengruppe']->kKundengruppe . ";%'
AND nAktiv = 1
ORDER BY nSort";
$oCheckBoxTMP_arr = Shop::DB()->query($sql, 2);
if (count($oCheckBoxTMP_arr) > 0) {
foreach ($oCheckBoxTMP_arr as $oCheckBoxTMP) {
$exists = false;
foreach ($args_arr['oCheckBox_arr'] as $oCheckBox) {
if ((int) $oCheckBox->kCheckBox === (int) $oCheckBoxTMP->kCheckBox) {
$exists = true;
break;
}
}
if (!$exists) {
$args_arr['oCheckBox_arr'][] = new CheckBox($oCheckBoxTMP->kCheckBox, $args_arr['bSprache']);
}
}
}
}
......@@ -62,17 +62,25 @@
/**
* paypal express
*/
button.paypalexpress {
.paypalexpress.btn-ppe-article {
padding: 0;
margin-top: 15px;
background: none;
border: 0;
}
a.paypalexpress {
.paypalexpress.btn-ppe-cart {
float: left;
}
.paypalexpress.btn-ppe-checkout {
text-align: center;
display: block;
}
.paypalexpress.btn-ppe-cart-popup {
}
/**
* paypal installments
*/
......
......@@ -104,8 +104,12 @@ class PayPalExpress extends PaymentMethod
$this->tZahlungsart = (class_exists('Shop')) ? Shop::DB()->query($sql, 1) : $GLOBALS['DB']->executeQuery($sql, 1);
$this->oPlugin = $oPlugin;
$this->pluginbez = 'kPlugin_' . $oPlugin->kPlugin . '_paypalexpress';
$this->currencyISO = (isset($_SESSION['Waehrung'])) ? $_SESSION['Waehrung']->cISO : null;
$this->cISOSprache = (isset($_SESSION['cISOSprache'])) ? $_SESSION['cISOSprache'] : null;
if (407 > Shop::getVersion()) {
$this->currencyISO = (isset($_SESSION['Waehrung'])) ? $_SESSION['Waehrung']->cISO : null;
} else {
$this->currencyISO = Session::Currency()->getCode() ?: null;
}
$this->cISOSprache = (isset($_SESSION['cISOSprache'])) ? $_SESSION['cISOSprache'] : null;
if ($oPlugin->oPluginEinstellungAssoc_arr[$this->pluginbez . '_api_live_sandbox'] === 'live') {
$this->PayPalURL = 'https://www.paypal.com/checkoutnow?useraction=continue&token=';
$this->endPoint = 'https://api-3t.paypal.com/nvp';
......@@ -378,7 +382,7 @@ class PayPalExpress extends PaymentMethod
unset($_SESSION['reshash'], $_SESSION['paypalexpress']);
if (isset($_SESSION['Kunde']) && intval($_SESSION['Kunde']->nRegistriert) === 0) {
if (isset($_SESSION['Kunde']) && (int)$_SESSION['Kunde']->nRegistriert === 0) {
unset($_SESSION['Kunde']);
}
}
......@@ -454,7 +458,7 @@ class PayPalExpress extends PaymentMethod
{
foreach ($oVersandart_arr as $key => $oVersandart) {
if (!isset($oVersandart->kZahlungsart)) {
$sql = 'SELECT
$sql = 'SELECT
kZahlungsart
FROM tversandartzahlungsart
WHERE tversandartzahlungsart.kVersandart = ' . $oVersandart->kVersandart . '
......
......@@ -734,7 +734,7 @@ class PayPalFinance extends PaymentMethod
$this->logResult('ExecutePayment', $execution, $payment);
if ($payment->getState() === 'failed') {
throw new Exception('Unhandled payment state', $payment->getState());
throw new Exception(sprintf('Unhandled payment state %s', $payment->getState()));
}
$sale = $payment->getTransactions()[0]
......
{if $error}
<p class="alert alert-danger">{$error}</p>
<a href="bestellvorgang.php?editZahlungsart=1" class="btn btn-primary btn-lg pull-right submit submit_once">
{lang key="modifyPaymentOption" section="checkout"}
</a>
{/if}
{if $error}
<p class="alert alert-danger">{$error}</p>
<a href="bestellvorgang.php?editZahlungsart=1" class="btn btn-primary btn-lg pull-right submit submit_once">
{lang key="modifyPaymentOption" section="checkout"}
</a>
{/if}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment