Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mag2 305 paydirekt #535

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Helper/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Payment extends \Payone\Core\Helper\Base
PayoneConfig::METHOD_ADVANCE_PAYMENT,
PayoneConfig::METHOD_INVOICE,
PayoneConfig::METHOD_OBT_SOFORTUEBERWEISUNG,
PayoneConfig::METHOD_OBT_GIROPAY,
#PayoneConfig::METHOD_OBT_GIROPAY,#Giropay has been disabled, Paydirekt is now Giropay
PayoneConfig::METHOD_OBT_EPS,
PayoneConfig::METHOD_OBT_POSTFINANCE_EFINANCE,
PayoneConfig::METHOD_OBT_POSTFINANCE_CARD,
Expand Down
6 changes: 6 additions & 0 deletions Model/Methods/Paydirekt.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ public function getPaymentSpecificParameters(Order $oOrder)
$aParams['add_paydata[terminal_address_streetnumber]'] = '';// IS THIS NECESSARY?
$aParams['add_paydata[terminal_address_zip]'] = $this->shopHelper->getConfigParam('postcode', 'store_information', 'general');
$aParams['add_paydata[terminal_id]'] = $this->shopHelper->getConfigParam('name', 'store_information', 'general');
}

$blSecuredOrder = (bool)$this->getCustomConfigParam('order_secured');
if ($blSecuredOrder === true && $this->getAuthorizationMode() == PayoneConfig::REQUEST_TYPE_PREAUTHORIZATION) { // params only available with preauth
$aParams['add_paydata[order_secured]'] = 'yes';
$aParams['add_paydata[preauthorization_validity]'] = (int)$this->getCustomConfigParam('preauthorization_validity');
}

return $aParams;
}

Expand Down
35 changes: 35 additions & 0 deletions Model/Source/GuaranteeTime.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Payone\Core\Model\Source;

use Magento\Framework\Option\ArrayInterface;

class GuaranteeTime implements ArrayInterface
{
/**
* @var int
*/
protected $iAllowedDaysMin = 1;

/**
* @var int
*/
protected $iAllowedDaysMax = 15;

/**
* Return allowed guarantee times
*
* @return array
*/
public function toOptionArray()
{
$aOptions = [];
for($i = $this->iAllowedDaysMin; $i <= $this->iAllowedDaysMax; $i ++) {
$aOptions[] = [
'value' => $i,
'label' => $i,
];
}
return $aOptions;
}
}
8 changes: 4 additions & 4 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@
<frontend_model>Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping</frontend_model>
<backend_model>Payone\Core\Model\Config\Backend\SerializedOrJson</backend_model>
</field>
<field id="payone_obt_giropay" translate="label" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="1">
<!--field id="payone_obt_giropay" translate="label" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="1">
<label>giropay</label>
<frontend_model>Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping</frontend_model>
<backend_model>Payone\Core\Model\Config\Backend\SerializedOrJson</backend_model>
</field>
</field Giropay has been disabled, Paydirekt is now Giropay -->
<field id="payone_obt_eps" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
<label>eps - Online-Ueberweisung</label>
<frontend_model>Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping</frontend_model>
Expand Down Expand Up @@ -177,7 +177,7 @@
<backend_model>Payone\Core\Model\Config\Backend\SerializedOrJson</backend_model>
</field>
<field id="payone_paydirekt" translate="label" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Paydirekt</label>
<label>Giropay</label>
<frontend_model>Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping</frontend_model>
<backend_model>Payone\Core\Model\Config\Backend\SerializedOrJson</backend_model>
</field>
Expand Down Expand Up @@ -306,7 +306,7 @@
<include path="Payone_Core::system/payone_advance_payment.xml"/>
<include path="Payone_Core::system/payone_invoice.xml"/>
<include path="Payone_Core::system/payone_obt_sofortueberweisung.xml"/>
<include path="Payone_Core::system/payone_obt_giropay.xml"/>
<!--include path="Payone_Core::system/payone_obt_giropay.xml"/ Giropay has been disabled, Paydirekt is now Giropay -->
<include path="Payone_Core::system/payone_obt_eps.xml"/>
<include path="Payone_Core::system/payone_obt_postfinance_efinance.xml"/>
<include path="Payone_Core::system/payone_obt_postfinance_card.xml"/>
Expand Down
17 changes: 15 additions & 2 deletions etc/adminhtml/system/payone_paydirekt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="payone_paydirekt" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Paydirekt</label>
<label>Giropay</label>
<field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
Expand All @@ -40,7 +40,20 @@
<label>Title</label>
<config_path>payment/payone_paydirekt/title</config_path>
</field>
<field id="order_status" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="order_secured" translate="label,comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Secured order</label>
<comment>In the case of a secured pre-order, the retailer is granted a payment guarantee for the selected period (maximum 15 calendar days). Captures (partial payments) must always be executed within the guarantee period. Only available in preauthorization mode.</comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="preauthorization_validity" translate="label,comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Guarantee time period</label>
<depends>
<field id="order_secured">1</field>
</depends>
<comment>Desired guarantee time period (max. 15 running days) für a secured ore-order.</comment>
<source_model>Payone\Core\Model\Source\GuaranteeTime</source_model>
</field>
<field id="order_status" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>New Order Status</label>
<source_model>Magento\Sales\Model\Config\Source\Order\Status\NewStatus</source_model>
<config_path>payment/payone_paydirekt/order_status</config_path>
Expand Down
14 changes: 8 additions & 6 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@
<allowspecific>0</allowspecific>
<group>payone</group>
</payone_obt_sofortueberweisung>
<payone_obt_giropay translate="title" module="Payone_Core">
<!--payone_obt_giropay translate="title" module="Payone_Core">
<active>1</active>
<payment_action>Authorization</payment_action>
<model>Payone\Core\Model\Methods\OnlineBankTransfer\Giropay</model>
<order_status>pending</order_status>
<title>PAYONE Giropay</title>
<allowspecific>0</allowspecific>
<group>payone</group>
</payone_obt_giropay>
</payone_obt_giropay Giropay has been disabled, Paydirekt is now Giropay -->
<payone_obt_eps translate="title" module="Payone_Core">
<active>1</active>
<payment_action>Authorization</payment_action>
Expand Down Expand Up @@ -160,7 +160,7 @@
<payment_action>Authorization</payment_action>
<model>Payone\Core\Model\Methods\Paydirekt</model>
<order_status>pending</order_status>
<title>PAYONE paydirekt</title>
<title>PAYONE Giropay</title>
<allowspecific>0</allowspecific>
<group>payone</group>
</payone_paydirekt>
Expand Down Expand Up @@ -376,7 +376,7 @@
<payone_invoice>{"_1338893611948_948":{"txaction":"appointed","state_status":"processing"}}</payone_invoice>
<payone_advance_payment>{"_1338893618715_715":{"txaction":"appointed","state_status":"pending"},"_1458214328719_719":{"txaction":"paid","state_status":"processing"}}</payone_advance_payment>
<payone_obt_sofortueberweisung>{"_1343137411652_152":{"txaction":"appointed","state_status":"processing"}}</payone_obt_sofortueberweisung>
<payone_obt_giropay>{"_1343137411652_252":{"txaction":"appointed","state_status":"processing"}}</payone_obt_giropay>
<!--payone_obt_giropay>{"_1343137411652_252":{"txaction":"appointed","state_status":"processing"}}</payone_obt_giropay Giropay has been disabled, Paydirekt is now Giropay -->
<payone_obt_eps>{"_1343137411652_352":{"txaction":"appointed","state_status":"processing"}}</payone_obt_eps>
<payone_obt_postfinance_efinance>{"_1343137411652_452":{"txaction":"appointed","state_status":"processing"}}</payone_obt_postfinance_efinance>
<payone_obt_postfinance_card>{"_1343137411652_552":{"txaction":"appointed","state_status":"processing"}}</payone_obt_postfinance_card>
Expand Down Expand Up @@ -481,9 +481,9 @@
<payone_obt_sofortueberweisung>
<use_global>1</use_global>
</payone_obt_sofortueberweisung>
<payone_obt_giropay>
<!--payone_obt_giropay>
<use_global>1</use_global>
</payone_obt_giropay>
</payone_obt_giropay Giropay has been disabled, Paydirekt is now Giropay -->
<payone_obt_eps>
<use_global>1</use_global>
</payone_obt_eps>
Expand All @@ -504,6 +504,8 @@
</payone_barzahlen>
<payone_paydirekt>
<use_global>1</use_global>
<order_secured>0</order_secured>
<preauthorization_validity>15</preauthorization_validity>
</payone_paydirekt>
<payone_safe_invoice>
<use_global>1</use_global>
Expand Down
4 changes: 2 additions & 2 deletions etc/payment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
<method name="payone_obt_sofortueberweisung">
<allow_multiple_address>0</allow_multiple_address>
</method>
<method name="payone_obt_giropay">
<!--method name="payone_obt_giropay">
<allow_multiple_address>0</allow_multiple_address>
</method>
</method Giropay has been disabled, Paydirekt is now Giropay -->
<method name="payone_obt_eps">
<allow_multiple_address>0</allow_multiple_address>
</method>
Expand Down
5 changes: 5 additions & 0 deletions i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,11 @@
"Billing address as delivery address","Rechnungsadresse als Lieferadresse"
"Transmit the billing address as delivery address if delivery address is missing.","Rechnungsadresse bei fehlender Lieferadresse als Lieferadresse &uuml;bergeben."

"Secured order","Gesicherte Vorbestellung"
"In the case of a secured pre-order, the retailer is granted a payment guarantee for the selected period (maximum 15 calendar days). Captures (partial payments) must always be executed within the guarantee period. Only available in preauthorization mode.","Bei einer gesicherten Vorbestellung wird dem Händler eine Zahlunqsgarantie für den gewählten Zeitraum (maximal 15 Kalendertage) gewährt. Captures (Teilzahlungen) müssen immer innerhalb des Garantiezeitraums ausgeruhrt werden. Nur im Vorautorisierung Modus verfügbar."
"Guarantee time period","Garantiezeitraum"
"Desired guarantee time period (max. 15 running days) für a secured ore-order.","Gewünschter Garantiezeitraum (maximal 15 Kalendertage) für eine gesicherte Vorbestellung."

"PayPal Express Enabled","PayPal Express aktiviert"
"An error occured during the PayPal Express transaction.","Während der PayPal Express Transaktion ist ein Fehler aufgetreten."
"Please sign in to check out.","Bitte loggen Sie sich ein für den Einkauf."
Expand Down
4 changes: 2 additions & 2 deletions view/frontend/layout/checkout_index_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
<item name="payone_obt_sofortueberweisung" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
<item name="payone_obt_giropay" xsi:type="array">
<!--item name="payone_obt_giropay" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
</item Giropay has been disabled, Paydirekt is now Giropay -->
<item name="payone_obt_eps" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
Expand Down
4 changes: 2 additions & 2 deletions view/frontend/web/js/view/payment/payone-payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ define(
type: 'payone_obt_sofortueberweisung',
component: 'Payone_Core/js/view/payment/method-renderer/obt_sofortueberweisung-method'
},
{
/*{
type: 'payone_obt_giropay',
component: 'Payone_Core/js/view/payment/method-renderer/obt_giropay-method'
},
}, Giropay has been disabled, Paydirekt is now Giropay */
{
type: 'payone_obt_eps',
component: 'Payone_Core/js/view/payment/method-renderer/obt_eps-method'
Expand Down
Loading