diff --git a/Api/Data/QuoteCreateResponseInterface.php b/Api/Data/QuoteCreateResponseInterface.php
index c8e06f765..f8bc6cf6d 100644
--- a/Api/Data/QuoteCreateResponseInterface.php
+++ b/Api/Data/QuoteCreateResponseInterface.php
@@ -19,8 +19,6 @@
*/
namespace Buckaroo\Magento2\Api\Data;
-use Buckaroo\Magento2\Api\Data\BreakdownItemInterface;
-
interface QuoteCreateResponseInterface extends BreakdownItemInterface
{
/**
@@ -36,4 +34,4 @@ public function getBreakdown();
* @return string
*/
public function getCartId();
-}
\ No newline at end of file
+}
diff --git a/Api/IdealQuoteCreateInterface.php b/Api/IdealQuoteCreateInterface.php
index e9aa88e57..3bead625c 100644
--- a/Api/IdealQuoteCreateInterface.php
+++ b/Api/IdealQuoteCreateInterface.php
@@ -21,9 +21,6 @@
namespace Buckaroo\Magento2\Api;
-use Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface;
-use Buckaroo\Magento2\Api\Data\Ideal\ShippingAddressRequestInterface;
-
interface IdealQuoteCreateInterface
{
/**
@@ -31,7 +28,7 @@ interface IdealQuoteCreateInterface
*
* @param string $page
* @param string|null $order_data
- * @return QuoteCreateResponseInterface
+ * @return \Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface
*/
public function execute(
string $page,
diff --git a/Api/PayWithGiftcardInterface.php b/Api/PayWithGiftcardInterface.php
index e6de57d84..cc3f9d729 100644
--- a/Api/PayWithGiftcardInterface.php
+++ b/Api/PayWithGiftcardInterface.php
@@ -23,15 +23,14 @@
use Buckaroo\Magento2\Api\Data\Giftcard\PayRequestInterface;
-interface PayWithGiftcardInterface
+interface PayWithGiftcardInterface
{
/**
* Rest method for paying with giftcards
*
* @param string $cartId
* @param string $giftcardId
- * @param \Buckaroo\Magento2\Api\Data\Giftcard\PayRequestInterface $requestBody
- *
+ * @param \Buckaroo\Magento2\Api\Data\Giftcard\PayRequestInterface $payment
* @return \Buckaroo\Magento2\Api\Data\Giftcard\PayResponseInterface
*/
public function pay(string $cartId, string $giftcardId, PayRequestInterface $payment);
diff --git a/Api/PaypalExpressQuoteCreateInterface.php b/Api/PaypalExpressQuoteCreateInterface.php
index 74947cd96..053f376e0 100644
--- a/Api/PaypalExpressQuoteCreateInterface.php
+++ b/Api/PaypalExpressQuoteCreateInterface.php
@@ -22,7 +22,6 @@
namespace Buckaroo\Magento2\Api;
use Buckaroo\Magento2\Api\Data\PaypalExpress\ShippingAddressRequestInterface;
-use Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface;
interface PaypalExpressQuoteCreateInterface
{
@@ -32,7 +31,7 @@ interface PaypalExpressQuoteCreateInterface
* @param \Buckaroo\Magento2\Api\Data\PaypalExpress\ShippingAddressRequestInterface $shipping_address
* @param string $page
* @param string|null $order_data
- * @return QuoteCreateResponseInterface
+ * @return \Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface
*/
public function execute(
ShippingAddressRequestInterface $shipping_address,
diff --git a/Block/Widget/Button/Toolbar.php b/Block/Widget/Button/Toolbar.php
index 058ddb6f3..ba4996afa 100644
--- a/Block/Widget/Button/Toolbar.php
+++ b/Block/Widget/Button/Toolbar.php
@@ -49,7 +49,6 @@ class Toolbar
'buckaroo_magento2_belfius',
'buckaroo_magento2_transfer',
'buckaroo_magento2_eps',
- 'buckaroo_magento2_giropay',
'buckaroo_magento2_kbc',
'buckaroo_magento2_klarna',
'buckaroo_magento2_klarnakp',
diff --git a/Controller/Redirect/Process.php b/Controller/Redirect/Process.php
index 570f78069..a78c6f241 100755
--- a/Controller/Redirect/Process.php
+++ b/Controller/Redirect/Process.php
@@ -330,13 +330,16 @@ private function redirectProcess() {
|| $paymentMethod->getConfigData('order_email', $store) === "1"
)
) {
- if (!($this->hasPostData('add_initiated_by_magento', 1) &&
- $this->hasPostData('brq_primary_service', 'KlarnaKp') &&
- $this->hasPostData('add_service_action_from_magento', 'reserve') &&
- !empty($this->response['brq_service_klarnakp_reservationnumber'])
+ if (!(
+ ($this->hasPostData('add_initiated_by_magento', 1) &&
+ $this->hasPostData('brq_primary_service', 'KlarnaKp') &&
+ $this->hasPostData('add_service_action_from_magento', 'reserve') &&
+ !empty($this->response['brq_service_klarnakp_reservationnumber']))
+ ||
+ $this->hasPostData('add_service_action_from_magento', 'payfastcheckout')
)) {
if ($statusCode == $this->helper->getStatusCode('BUCKAROO_MAGENTO2_STATUSCODE_SUCCESS')) {
- $this->logger->addDebug(__METHOD__ . '|sendemail|');
+ $this->logger->addDebug(__METHOD__ . '|sendemail| |1|');
$this->orderSender->send($this->order, true);
}
}
diff --git a/Helper/Data.php b/Helper/Data.php
index d80e6b8c0..9683068b2 100644
--- a/Helper/Data.php
+++ b/Helper/Data.php
@@ -384,7 +384,7 @@ public function areEqualAmounts($amount1, $amount2)
if ($amount2 == 0) {
return $amount1 == $amount2;
} else {
- return abs((floatval($amount1) - floatval($amount2)) / floatval($amount2)) < 0.00001;
+ return abs((floatval($amount1) - floatval($amount2)) / floatval($amount2)) <= 0.01;
}
}
@@ -433,7 +433,6 @@ public function getPaymentMethodsList()
['value' => 'emandate', 'label' => __('Digital Debit Authorization')],
['value' => 'eps', 'label' => __('EPS')],
['value' => 'giftcards', 'label' => __('Giftcards')],
- ['value' => 'giropay', 'label' => __('Giropay')],
['value' => 'ideal', 'label' => __('iDEAL')],
['value' => 'idealprocessing', 'label' => __('iDEAL Processing')],
['value' => 'kbc', 'label' => __('KBC')],
diff --git a/Model/Config/Source/PaymentMethods/AfterExpiry.php b/Model/Config/Source/PaymentMethods/AfterExpiry.php
index 661e8016e..ab15b983c 100644
--- a/Model/Config/Source/PaymentMethods/AfterExpiry.php
+++ b/Model/Config/Source/PaymentMethods/AfterExpiry.php
@@ -37,7 +37,6 @@ public function toOptionArray()
['value' => 'dankort', 'label' => __('Dankort')],
['value' => 'eps', 'label' => __('EPS')],
['value' => 'giftcard', 'label' => __('Giftcards')],
- ['value' => 'giropay', 'label' => __('Giropay')],
['value' => 'ideal', 'label' => __('iDEAL')],
['value' => 'idealprocessing', 'label' => __('iDEAL Processing')],
['value' => 'maestro', 'label' => __('Maestro')],
diff --git a/Model/Config/Source/PaymentMethods/PayLink.php b/Model/Config/Source/PaymentMethods/PayLink.php
index 7de64040d..8c558c2be 100644
--- a/Model/Config/Source/PaymentMethods/PayLink.php
+++ b/Model/Config/Source/PaymentMethods/PayLink.php
@@ -38,7 +38,6 @@ public function toOptionArray()
['value' => 'dankort', 'label' => __('Dankort')],
['value' => 'eps', 'label' => __('EPS')],
['value' => 'giftcard', 'label' => __('Giftcards')],
- ['value' => 'giropay', 'label' => __('Giropay')],
['value' => 'ideal', 'label' => __('iDEAL')],
['value' => 'idealprocessing', 'label' => __('iDEAL Processing')],
['value' => 'maestro', 'label' => __('Maestro')],
diff --git a/Model/Config/Source/PaymentMethods/PayPerEmail.php b/Model/Config/Source/PaymentMethods/PayPerEmail.php
index f191f7d0a..8f65f5351 100644
--- a/Model/Config/Source/PaymentMethods/PayPerEmail.php
+++ b/Model/Config/Source/PaymentMethods/PayPerEmail.php
@@ -70,11 +70,6 @@ public function toOptionArray()
'label' => __('Giftcards'),
'code' => 'buckaroo_magento2_giftcards'
],
- [
- 'value' => 'giropay',
- 'label' => __('Giropay'),
- 'code' => 'buckaroo_magento2_giropay'
- ],
[
'value' => 'ideal',
'label' => __('iDEAL'),
diff --git a/Model/ConfigProvider/Method/Giropay.php b/Model/ConfigProvider/Method/Giropay.php
deleted file mode 100644
index 7ebedd842..000000000
--- a/Model/ConfigProvider/Method/Giropay.php
+++ /dev/null
@@ -1,81 +0,0 @@
-getBuckarooPaymentFeeLabel(
- \Buckaroo\Magento2\Model\Method\Giropay::PAYMENT_METHOD_CODE
- );
-
- return [
- 'payment' => [
- 'buckaroo' => [
- 'giropay' => [
- 'paymentFeeLabel' => $paymentFeeLabel,
- 'subtext' => $this->getSubtext(),
- 'subtext_style' => $this->getSubtextStyle(),
- 'subtext_color' => $this->getSubtextColor(),
- 'allowedCurrencies' => $this->getAllowedCurrencies(),
- ],
- ],
- ],
- ];
- }
-
- /**
- * @param null|int $storeId
- *
- * @return float
- */
- public function getPaymentFee($storeId = null)
- {
- $paymentFee = $this->scopeConfig->getValue(
- self::XPATH_GIROPAY_PAYMENT_FEE,
- \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
- $storeId
- );
-
- return $paymentFee ? $paymentFee : false;
- }
-}
diff --git a/Model/Method/AbstractMethod.php b/Model/Method/AbstractMethod.php
index 95b207980..01d5633b3 100644
--- a/Model/Method/AbstractMethod.php
+++ b/Model/Method/AbstractMethod.php
@@ -2124,9 +2124,20 @@ public function getArticleArrayLine(
protected function getTaxCategory($order)
{
- $request = $this->taxCalculation->getRateRequest(null, null, null, $order->getStore());
- $taxClassId = $this->configProviderBuckarooFee->getTaxClass($order->getStore());
- $percent = $this->taxCalculation->getRate($request->setProductClassId($taxClassId));
+ $shippingAddress = $order->getShippingAddress();
+ $billingAddress = $order->getBillingAddress();
+ $customerTaxClassId = $order->getCustomerTaxClassId();
+ $storeId = $order->getStoreId();
+ $taxClassId = $this->configProviderBuckarooFee->getTaxClass();
+
+ $request = $this->taxCalculation->getRateRequest(
+ $shippingAddress,
+ $billingAddress,
+ $customerTaxClassId,
+ $storeId
+ );
+ $request->setProductClassId($taxClassId);
+ $percent = $this->taxCalculation->getRate($request);
return $percent;
}
diff --git a/Model/Method/Giropay.php b/Model/Method/Giropay.php
deleted file mode 100644
index 69a7318ab..000000000
--- a/Model/Method/Giropay.php
+++ /dev/null
@@ -1,109 +0,0 @@
-transactionBuilderFactory->get('order');
-
- $services = [
- 'Name' => 'giropay',
- 'Action' => 'Pay',
- 'Version' => 2,
- ];
-
- /**
- * @noinspection PhpUndefinedMethodInspection
- */
- $transactionBuilder->setOrder($payment->getOrder())
- ->setServices($services)
- ->setMethod('TransactionRequest');
-
- return $transactionBuilder;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCaptureTransactionBuilder($payment)
- {
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAuthorizeTransactionBuilder($payment)
- {
- return false;
- }
-
- protected function getRefundTransactionBuilderVersion()
- {
- return 2;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getVoidTransactionBuilder($payment)
- {
- return true;
- }
-
- /**
- * @param \Magento\Sales\Api\Data\OrderPaymentInterface|\Magento\Payment\Model\InfoInterface $payment
- *
- * @return bool|string
- */
- public function getPaymentMethodName($payment)
- {
- return $this->buckarooPaymentMethodCode;
- }
-
- protected function getRefundTransactionBuilderChannel()
- {
- return 'Web';
- }
-}
diff --git a/Model/Method/Ideal.php b/Model/Method/Ideal.php
index 2402a8f30..bc10eb8d3 100644
--- a/Model/Method/Ideal.php
+++ b/Model/Method/Ideal.php
@@ -53,6 +53,14 @@ public function assignData(\Magento\Framework\DataObject $data)
$this->getInfoInstance()->setAdditionalInformation('issuer', $data['additional_data']['issuer']);
}
+ $payment = $this->getInfoInstance();
+ $quote = $payment->getQuote();
+
+ if ($quote) {
+ $shippingCost = $quote->getShippingAddress()->getShippingAmount();
+ $this->getInfoInstance()->setAdditionalInformation('shippingCost', $shippingCost);
+ }
+
return $this;
}
@@ -67,6 +75,7 @@ public function getOrderTransactionBuilder($payment)
'Name' => 'ideal',
'Action' => $this->getPayRemainder($payment, $transactionBuilder,'PayFastCheckout'),
'Version' => 2,
+ 'RequestParameter' => $this->getIdealFastCheckoutOrderRequestParameters($payment),
];
/**
@@ -110,6 +119,20 @@ private function getOrderRequestParameters($payment): array
return $parameters;
}
+ private function getIdealFastCheckoutOrderRequestParameters($payment): array
+ {
+ $parameters = [];
+
+ if ($this->isFastCheckout($payment) && $payment->getAdditionalInformation('shippingCost')) {
+ $parameters = [[
+ '_' => $payment->getAdditionalInformation('shippingCost'),
+ 'Name' => 'shippingCost',
+ ]];
+ }
+
+ return $parameters;
+ }
+
protected function getRefundTransactionBuilderVersion()
{
return null;
diff --git a/Model/Push.php b/Model/Push.php
index 6c3fff0bd..140777368 100644
--- a/Model/Push.php
+++ b/Model/Push.php
@@ -259,10 +259,6 @@ public function receivePush()
try {
$response = $this->pushProcess();
- if ($this->isFastCheckout()) {
- $this->updateOrderAddressesIfFastCheckout();
- }
-
return $response;
} catch (\Throwable $e) {
$this->logging->addDebug(__METHOD__ . '|Exception|' . $e->getMessage());
@@ -597,6 +593,9 @@ private function pushProcess()
);
}
+ if ($this->isFastCheckout()) {
+ $this->updateOrderAddressesIfFastCheckout();
+ }
if (!$this->isGroupTransactionInfo()) {
$this->setTransactionKey();
diff --git a/Model/Service/Order.php b/Model/Service/Order.php
index 889dde04d..26912dc69 100644
--- a/Model/Service/Order.php
+++ b/Model/Service/Order.php
@@ -29,6 +29,7 @@
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
use Buckaroo\Magento2\Helper\Data;
use Magento\Framework\App\ResourceConnection;
+use Laminas\Db\Sql\Expression;
class Order
{
@@ -43,16 +44,17 @@ class Order
private Factory $configProviderFactory;
public function __construct(
- Account $accountConfig,
- MethodFactory $configProviderMethodFactory,
- Factory $configProviderFactory,
+ Account $accountConfig,
+ MethodFactory $configProviderMethodFactory,
+ Factory $configProviderFactory,
StoreRepositoryInterface $storeRepository,
- CollectionFactory $orderFactory,
- OrderStatusFactory $orderStatusFactory,
- Data $helper,
- Log $logging,
- ResourceConnection $resourceConnection
- ) {
+ CollectionFactory $orderFactory,
+ OrderStatusFactory $orderStatusFactory,
+ Data $helper,
+ Log $logging,
+ ResourceConnection $resourceConnection
+ )
+ {
$this->accountConfig = $accountConfig;
$this->configProviderMethodFactory = $configProviderMethodFactory;
$this->configProviderFactory = $configProviderFactory;
@@ -94,11 +96,11 @@ protected function cancelExpiredTransferOrdersPerStore($store)
)
->addFieldToFilter(
'created_at',
- ['lt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . $dueDays . ' DAY')]
+ ['lt' => new Expression('NOW() - INTERVAL ' . $dueDays . ' DAY')]
)
->addFieldToFilter(
'created_at',
- ['gt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')]
+ ['gt' => new Expression('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')]
);
$orderCollection->getSelect()
@@ -154,11 +156,11 @@ protected function cancelExpiredPPEOrdersPerStore($store)
)
->addFieldToFilter(
'created_at',
- ['lt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . $dueDays . ' DAY')]
+ ['lt' => new Expression('NOW() - INTERVAL ' . $dueDays . ' DAY')]
)
->addFieldToFilter(
'created_at',
- ['gt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')]
+ ['gt' => new Expression('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')]
);
$orderCollection->getSelect()
@@ -216,7 +218,7 @@ public function cancel($order, $statusCode)
$this->logging->addDebug(__METHOD__ . '|20|');
if (in_array($order->getPayment()->getMethodInstance()->buckarooPaymentMethodCode, ['klarnakp'])) {
- $methodInstanceClass = get_class($order->getPayment()->getMethodInstance());
+ $methodInstanceClass = get_class($order->getPayment()->getMethodInstance());
$methodInstanceClass::$requestOnVoid = false;
}
diff --git a/Model/Total/Quote/BuckarooAlreadyPay.php b/Model/Total/Quote/BuckarooAlreadyPay.php
index c7bb6ccf5..9efb45f73 100644
--- a/Model/Total/Quote/BuckarooAlreadyPay.php
+++ b/Model/Total/Quote/BuckarooAlreadyPay.php
@@ -1,5 +1,4 @@
setCode('buckaroo_already_paid');
$this->priceCurrency = $priceCurrency;
@@ -50,53 +66,53 @@ public function __construct(
/**
* Add buckaroo fee information to address
*
- * @param \Magento\Quote\Model\Quote $quote
- * @param \Magento\Quote\Model\Quote\Address\Total $total
- * @return $this
+ * @param Quote $quote
+ * @param Total $total
+ * @return array
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total)
+ public function fetch(Quote $quote, Total $total)
{
$orderId = $quote->getReservedOrderId();
$customTitle = [];
if ($orderId) {
- $items = $this->groupTransaction->getGroupTransactionItemsNotRefunded($orderId);
-
- foreach ($items as $giftcard) {
- $foundGiftcard = $this->giftcardCollection->getItemByColumnValue(
- 'servicecode',
- $giftcard['servicecode']
- );
-
- if ($foundGiftcard !== null || $giftcard['servicecode'] === 'buckaroovoucher') {
-
-
- if ($giftcard['servicecode'] === 'buckaroovoucher') {
- $label = __('Voucher');
- } else {
- $label = $foundGiftcard['label'];
+ try {
+ $items = $this->groupTransaction->getGroupTransactionItemsNotRefunded($orderId);
+
+ foreach ($items as $giftcard) {
+ $foundGiftcard = $this->giftcardCollection->getItemByColumnValue(
+ 'servicecode',
+ $giftcard['servicecode']
+ );
+
+ if ($foundGiftcard !== null || $giftcard['servicecode'] === 'buckaroovoucher') {
+ if ($giftcard['servicecode'] === 'buckaroovoucher') {
+ $label = __('Voucher');
+ } else {
+ $label = $foundGiftcard['label'];
+ }
+
+ $customTitle[] = [
+ 'label' => __('Paid with') . ' ' . $label,
+ 'amount' => -$giftcard['amount'],
+ 'servicecode' => $giftcard['servicecode'],
+ 'serviceamount' => $giftcard['amount'],
+ 'transaction_id' => $giftcard['transaction_id'],
+ ];
}
-
- $customTitle[] = [
- 'label' => __('Paid with') . ' ' . $label,
- 'amount' => -$giftcard['amount'],
- 'servicecode' => $giftcard['servicecode'],
- 'serviceamount' => $giftcard['amount'],
- 'transaction_id' => $giftcard['transaction_id'],
- ];
}
+ } catch (\Exception $e) {
+ // $this->logger->error($e->getMessage());
}
}
- /**
- * @noinspection PhpUndefinedMethodInspection
- */
- $totals = [
- 'code' => $this->getCode(),
+ return [
+ 'code' => $this->getCode(),
'title' => $customTitle ? __(json_encode($customTitle)) : $this->getLabel(),
- 'value' => $this->groupTransaction->getAlreadyPaid($orderId),
+ 'value' => -$this->groupTransaction->getAlreadyPaid($orderId),
];
- return $totals;
}
/**
diff --git a/Model/Total/Quote/BuckarooFee.php b/Model/Total/Quote/BuckarooFee.php
index 765cf0f4e..294fb4fce 100644
--- a/Model/Total/Quote/BuckarooFee.php
+++ b/Model/Total/Quote/BuckarooFee.php
@@ -231,25 +231,35 @@ public function getBaseFee(
$configProvider = $this->configProviderMethodFactory->get($buckarooPaymentMethodCode);
$basePaymentFee = trim($configProvider->getPaymentFee($quote->getStore()));
+ $inclTax = $this->configProviderBuckarooFee->getPaymentFeeTax() ==
+ Calculation::DISPLAY_TYPE_INCLUDING_TAX;
+
+ $shippingAddress = $quote->getShippingAddress();
+ $billingAddress = $quote->getBillingAddress();
+ $customerTaxClassId = $quote->getCustomerTaxClassId();
+ $storeId = $quote->getStoreId();
+ $taxClassId = $this->configProviderBuckarooFee->getTaxClass();
+
+ $request = $this->taxCalculation->getRateRequest(
+ $shippingAddress,
+ $billingAddress,
+ $customerTaxClassId,
+ $storeId
+ );
+ $request->setProductClassId($taxClassId);
+ $percent = $this->taxCalculation->getRate($request);
if (is_numeric($basePaymentFee)) {
if (in_array($buckarooPaymentMethodCode, ['billink','afterpay20','afterpay','paypal'])) {
-
- $inclTax = $this->configProviderBuckarooFee->getPaymentFeeTax() ==
- Calculation::DISPLAY_TYPE_INCLUDING_TAX;
-
if ($inclTax) {
- $request = $this->taxCalculation->getRateRequest(null, null, null, $quote->getStore());
- $taxClassId = $this->configProviderBuckarooFee->getTaxClass($quote->getStore());
- $percent = $this->taxCalculation->getRate($request->setProductClassId($taxClassId));
if ($percent > 0) {
return $basePaymentFee / (1 + ($percent / 100));
}
}
return $basePaymentFee;
} else {
- if ($inclTax) {
- return $basePaymentFee;
+ if ($inclTax){
+ return $basePaymentFee / (1 + ($percent / 100));
}
/**
* Payment fee is a number
@@ -286,8 +296,15 @@ public function getBaseFee(
$total = $address->getBaseSubtotalTotalInclTax();
break;
}
+ $percentageFee = ($percentage / 100) * $total;
- $basePaymentFee = ($percentage / 100) * $total;
+ if($inclTax){
+ if($percent > 0){
+ return $percentageFee / (1 + ($percent / 100));
+ }
+ } else{
+ return $percentageFee;
+ }
return $basePaymentFee;
}
diff --git a/Model/Total/Quote/BuckarooFeeHyva.php b/Model/Total/Quote/BuckarooFeeHyva.php
index 5f500bdf5..9e04a3a2d 100644
--- a/Model/Total/Quote/BuckarooFeeHyva.php
+++ b/Model/Total/Quote/BuckarooFeeHyva.php
@@ -217,17 +217,27 @@ public function getBaseFee(
$configProvider = $this->configProviderMethodFactory->get($buckarooPaymentMethodCode);
$basePaymentFee = trim($configProvider->getPaymentFee($quote->getStore()));
+ $inclTax = $this->configProviderBuckarooFee->getPaymentFeeTax() ==
+ Calculation::DISPLAY_TYPE_INCLUDING_TAX;
+
+ $shippingAddress = $quote->getShippingAddress();
+ $billingAddress = $quote->getBillingAddress();
+ $customerTaxClassId = $quote->getCustomerTaxClassId();
+ $storeId = $quote->getStoreId();
+ $taxClassId = $this->configProviderBuckarooFee->getTaxClass();
+
+ $request = $this->taxCalculation->getRateRequest(
+ $shippingAddress,
+ $billingAddress,
+ $customerTaxClassId,
+ $storeId
+ );
+ $request->setProductClassId($taxClassId);
+ $percent = $this->taxCalculation->getRate($request);
if (is_numeric($basePaymentFee)) {
if (in_array($buckarooPaymentMethodCode, ['billink','afterpay20','afterpay','paypal'])) {
-
- $inclTax = $this->configProviderBuckarooFee->getPaymentFeeTax() ==
- Calculation::DISPLAY_TYPE_INCLUDING_TAX;
-
if ($inclTax) {
- $request = $this->taxCalculation->getRateRequest(null, null, null, $quote->getStore());
- $taxClassId = $this->configProviderBuckarooFee->getTaxClass($quote->getStore());
- $percent = $this->taxCalculation->getRate($request->setProductClassId($taxClassId));
if ($percent > 0) {
return $basePaymentFee / (1 + ($percent / 100));
}
@@ -235,7 +245,7 @@ public function getBaseFee(
return $basePaymentFee;
} else {
if ($inclTax) {
- return $basePaymentFee;
+ return $basePaymentFee / (1 + ($percent / 100));
}
/**
* Payment fee is a number
@@ -272,8 +282,15 @@ public function getBaseFee(
$total = $address->getBaseSubtotalTotalInclTax();
break;
}
+ $percentageFee = ($percentage / 100) * $total;
- $basePaymentFee = ($percentage / 100) * $total;
+ if($inclTax){
+ if($percent > 0){
+ return $percentageFee / (1 + ($percent / 100));
+ }
+ } else{
+ return $percentageFee;
+ }
return $basePaymentFee;
}
diff --git a/Model/Total/Quote/BuckarooRemainingAmount.php b/Model/Total/Quote/BuckarooRemainingAmount.php
new file mode 100644
index 000000000..bc6eff67a
--- /dev/null
+++ b/Model/Total/Quote/BuckarooRemainingAmount.php
@@ -0,0 +1,76 @@
+setCode('remaining_amount');
+ $this->groupTransaction = $groupTransaction;
+ }
+
+ /**
+ * Fetch remaining amount for display in the frontend
+ *
+ * @param Quote $quote
+ * @param Total $total
+ * @return array
+ */
+ public function fetch(Quote $quote, Total $total)
+ {
+ // Fetch the already paid amount
+ $alreadyPaid = $this->groupTransaction->getAlreadyPaid($quote->getReservedOrderId());
+ $grandTotal = $quote->getGrandTotal();
+ $remainingAmount = max(0, $grandTotal - $alreadyPaid);
+
+ return [
+ 'code' => $this->getCode(),
+ 'title' => __('Remaining Amount'),
+ 'value' => $remainingAmount
+ ];
+ }
+
+ /**
+ * Get Buckaroo label
+ *
+ * @return \Magento\Framework\Phrase
+ */
+ public function getLabel()
+ {
+ return __('Fee');
+ }
+}
diff --git a/Test/Unit/Model/Config/Source/PaymentMethods/AfterExpiryTest.php b/Test/Unit/Model/Config/Source/PaymentMethods/AfterExpiryTest.php
index 33bde4377..5fb49443f 100644
--- a/Test/Unit/Model/Config/Source/PaymentMethods/AfterExpiryTest.php
+++ b/Test/Unit/Model/Config/Source/PaymentMethods/AfterExpiryTest.php
@@ -41,9 +41,6 @@ public function toOptionArrayProvider()
[
['value' => 'giftcard', 'label' => 'Giftcards']
],
- [
- ['value' => 'giropay', 'label' => 'Giropay']
- ],
[
['value' => 'ideal', 'label' => 'iDEAL']
],
diff --git a/Test/Unit/Model/Config/Source/PaymentMethods/PayPerEmailTest.php b/Test/Unit/Model/Config/Source/PaymentMethods/PayPerEmailTest.php
index b9964fd5a..2d3dd894f 100644
--- a/Test/Unit/Model/Config/Source/PaymentMethods/PayPerEmailTest.php
+++ b/Test/Unit/Model/Config/Source/PaymentMethods/PayPerEmailTest.php
@@ -44,9 +44,6 @@ public function toOptionArrayProvider()
[
['value' => 'giftcard', 'label' => 'Giftcards']
],
- [
- ['value' => 'giropay', 'label' => 'Giropay']
- ],
[
['value' => 'ideal', 'label' => 'iDEAL']
],
diff --git a/Test/Unit/Model/ConfigProvider/Method/GiropayTest.php b/Test/Unit/Model/ConfigProvider/Method/GiropayTest.php
deleted file mode 100644
index 0e3325832..000000000
--- a/Test/Unit/Model/ConfigProvider/Method/GiropayTest.php
+++ /dev/null
@@ -1,137 +0,0 @@
- [
- [
- 'payment' => [
- 'buckaroo' => [
- 'giropay' => [
- 'paymentFeeLabel' => 'Fee',
- 'allowedCurrencies' => ['EUR']
- ]
- ]
- ]
- ]
- ]
- ];
- }
-
- /**
- * @param $expected
- *
- * @dataProvider getConfigProvider
- */
- public function testGetConfig($expected)
- {
- $scopeConfigMock = $this->getFakeMock(ScopeConfigInterface::class)
- ->setMethods(['getValue'])
- ->getMockForAbstractClass();
- $scopeConfigMock->expects($this->atLeastOnce())
- ->method('getValue')
- ->withConsecutive(
- [Giropay::XPATH_ALLOWED_CURRENCIES, ScopeInterface::SCOPE_STORE, null]
- )
- ->willReturnOnConsecutiveCalls('EUR');
-
- $paymentFeeMock = $this->getFakeMock(PaymentFee::class)->setMethods(['getBuckarooPaymentFeeLabel'])->getMock();
- $paymentFeeMock->method('getBuckarooPaymentFeeLabel')->with(GiropayMethod::PAYMENT_METHOD_CODE)->willReturn('Fee');
-
- $instance = $this->getInstance(['scopeConfig' => $scopeConfigMock, 'paymentFeeHelper' => $paymentFeeMock]);
- $result = $instance->getConfig();
-
- $this->assertEquals($expected, $result);
- }
-
- public function getPaymentFeeProvider()
- {
- return [
- 'null value' => [
- null,
- false
- ],
- 'false value' => [
- false,
- false
- ],
- 'empty int value' => [
- 0,
- false
- ],
- 'empty float value' => [
- 0.00,
- false
- ],
- 'empty string value' => [
- '',
- false
- ],
- 'int value' => [
- 1,
- 1
- ],
- 'float value' => [
- 2.34,
- 2.34
- ],
- 'string value' => [
- '5.67',
- 5.67
- ],
- ];
- }
-
- /**
- * @param $value
- * @param $expected
- *
- * @dataProvider getPaymentFeeProvider
- */
- public function testGetPaymentFee($value, $expected)
- {
- $scopeConfigMock = $this->getFakeMock(ScopeConfigInterface::class)
- ->setMethods(['getValue'])
- ->getMockForAbstractClass();
- $scopeConfigMock->expects($this->once())
- ->method('getValue')
- ->with(Giropay::XPATH_GIROPAY_PAYMENT_FEE, ScopeInterface::SCOPE_STORE)
- ->willReturn($value);
-
- $instance = $this->getInstance(['scopeConfig' => $scopeConfigMock]);
- $result = $instance->getPaymentFee();
-
- $this->assertEquals($expected, $result);
- }
-}
diff --git a/Test/Unit/Model/Method/GiropayTest.php b/Test/Unit/Model/Method/GiropayTest.php
deleted file mode 100644
index 34e5b533a..000000000
--- a/Test/Unit/Model/Method/GiropayTest.php
+++ /dev/null
@@ -1,241 +0,0 @@
-getObject(DataObject::class);
- $data->setBuckarooSkipValidation(0);
- $data->setAdditionalData([
- 'customer_bic' => 'NL32INGB'
- ]);
-
- $infoInstanceMock = $this->getFakeMock(InfoInterface::class)
- ->setMethods(['setAdditionalInformation'])
- ->getMockForAbstractClass();
- $infoInstanceMock->expects($this->exactly(2))->method('setAdditionalInformation')->withConsecutive(
- ['buckaroo_skip_validation', 0],
- ['customer_bic', 'NL32INGB']
- );
-
- $instance = $this->getInstance();
- $instance->setData('info_instance', $infoInstanceMock);
-
- $result = $instance->assignData($data);
- $this->assertInstanceOf(Giropay::class, $result);
- }
-
- /**
- * Test the getOrderTransactionBuilder method.
- */
- public function testGetOrderTransactionBuilder()
- {
- $fixture = [
- 'customer_bic' => 'biccib',
- 'order' => 'orderrr!',
- ];
-
- $paymentMock = $this->getFakeMock(Payment::class)
- ->setMethods(['getOrder', 'getAdditionalInformation'])
- ->getMock();
- $paymentMock->expects($this->once())->method('getOrder')->willReturn($fixture['order']);
- $paymentMock->expects($this->once())
- ->method('getAdditionalInformation')
- ->with('customer_bic')
- ->willReturn($fixture['customer_bic']);
-
- $orderMock =$this->getFakeMock(Order::class)->setMethods(['setOrder', 'setMethod', 'setServices'])->getMock();
- $orderMock->expects($this->once())->method('setOrder')->with($fixture['order'])->willReturnSelf();
- $orderMock->expects($this->once())->method('setMethod')->with('TransactionRequest')->willReturnSelf();
- $orderMock->expects($this->once())->method('setServices')->willReturnCallback(
- function ($services) use ($fixture, $orderMock) {
- $this->assertEquals('giropay', $services['Name']);
- $this->assertEquals($fixture['customer_bic'], $services['RequestParameter'][0]['_']);
-
- return $orderMock;
- }
- );
-
- $trxFactoryMock = $this->getFakeMock(TransactionBuilderFactory::class)->setMethods(['get'])->getMock();
- $trxFactoryMock->expects($this->once())->method('get')->with('order')->willReturn($orderMock);
-
- $infoInterface = $this->getFakeMock(InfoInterface::class)->getMockForAbstractClass();
-
- $instance = $this->getInstance(['transactionBuilderFactory' => $trxFactoryMock]);
- $instance->setData('info_instance', $infoInterface);
-
- $this->assertEquals($orderMock, $instance->getOrderTransactionBuilder($paymentMock));
- }
-
- /**
- * Test the getCaptureTransactionBuilder method.
- */
- public function testGetCaptureTransactionBuilder()
- {
- $instance = $this->getInstance();
- $this->assertFalse($instance->getCaptureTransactionBuilder(''));
- }
-
- /**
- * Test the getAuthorizeTransactionBuild method.
- */
- public function testGetAuthorizeTransactionBuilder()
- {
- $instance = $this->getInstance();
- $this->assertFalse($instance->getAuthorizeTransactionBuilder(''));
- }
-
- /**
- * Test the getRefundTransactionBuilder method.
- */
- public function testGetRefundTransactionBuilder()
- {
- $paymentMock = $this->getFakeMock(Payment::class)
- ->setMethods(['getOrder', 'getAdditionalInformation'])
- ->getMock();
- $paymentMock->expects($this->once())->method('getOrder')->willReturn('orderr');
- $paymentMock->expects($this->once())
- ->method('getAdditionalInformation')
- ->with(Giropay::BUCKAROO_ORIGINAL_TRANSACTION_KEY_KEY)
- ->willReturn('getAdditionalInformation');
-
- $trxFactoryMock = $this->getFakeMock(TransactionBuilderFactory::class)
- ->setMethods(['get', 'setOrder', 'setMethod', 'setChannel', 'setOriginalTransactionKey', 'setServices'])
- ->getMock();
- $trxFactoryMock->expects($this->once())->method('get')->with('refund')->willReturnSelf();
- $trxFactoryMock->expects($this->once())->method('setOrder')->with('orderr')->willReturnSelf();
- $trxFactoryMock->expects($this->once())->method('setMethod')->with('TransactionRequest')->willReturnSelf();
- $trxFactoryMock->expects($this->once())->method('setChannel')->with('CallCenter')->willReturnSelf();
- $trxFactoryMock->expects($this->once())
- ->method('setOriginalTransactionKey')
- ->with('getAdditionalInformation')
- ->willReturnSelf();
- $trxFactoryMock->expects($this->once())->method('setServices')->willReturnCallback(
- function ($services) use ($trxFactoryMock) {
- $services['Name'] = 'giropay';
- $services['Action'] = 'Refund';
-
- return $trxFactoryMock;
- }
- );
-
- $instance = $this->getInstance(['transactionBuilderFactory' => $trxFactoryMock]);
-
- $this->assertEquals($trxFactoryMock, $instance->getRefundTransactionBuilder($paymentMock));
- }
-
- /**
- * Test the getVoidTransactionBuild method.
- */
- public function testGetVoidTransactionBuilder()
- {
- $instance = $this->getInstance();
- $this->assertTrue($instance->getVoidTransactionBuilder(''));
- }
-
- /**
- * Test the validation method happy path.
- */
- public function testValidate()
- {
- $paymentInfoMock = $this->getFakeMock(InfoInterface::class)
- ->setMethods(['getQuote', 'getBillingAddress', 'getCountryId', 'getAdditionalInformation'])
- ->getMockForAbstractClass();
- $paymentInfoMock->expects($this->once())->method('getQuote')->willReturnSelf();
- $paymentInfoMock->expects($this->once())->method('getBillingAddress')->willReturnSelf();
- $paymentInfoMock->expects($this->once())->method('getCountryId')->willReturn(4);
- $paymentInfoMock->expects($this->exactly(2))
- ->method('getAdditionalInformation')
- ->withConsecutive(['buckaroo_skip_validation'], ['customer_bic'])
- ->willReturnOnConsecutiveCalls(false, 'ABCDEF1E');
-
- $instance = $this->getInstance();
- $instance->setData('info_instance', $paymentInfoMock);
- $result = $instance->validate();
-
- $this->assertInstanceOf(Giropay::class, $result);
- }
-
- /**
- * Test the validation method happy path.
- */
- public function testValidateInvalidBic()
- {
- $paymentInfoMock = $this->getFakeMock(InfoInterface::class)
- ->setMethods(['getQuote', 'getBillingAddress', 'getCountryId', 'getAdditionalInformation'])
- ->getMockForAbstractClass();
- $paymentInfoMock->expects($this->once())->method('getQuote')->willReturnSelf();
- $paymentInfoMock->expects($this->once())->method('getBillingAddress')->willReturnSelf();
- $paymentInfoMock->expects($this->once())->method('getCountryId')->willReturn(4);
- $paymentInfoMock->expects($this->exactly(2))
- ->method('getAdditionalInformation')
- ->withConsecutive(['buckaroo_skip_validation'], ['customer_bic'])
- ->willReturnOnConsecutiveCalls(false, 'wrong');
-
- $instance = $this->getInstance();
- $instance->setData('info_instance', $paymentInfoMock);
-
- try {
- $instance->validate();
- } catch (LocalizedException $e) {
- $this->assertEquals('Please enter a valid BIC number', $e->getMessage());
- }
- }
-
- /**
- * Test the validation method happy path.
- */
- public function testValidateSkipValidation()
- {
- $paymentInfoMock = $this->getFakeMock(InfoInterface::class)
- ->setMethods(['getQuote', 'getBillingAddress', 'getCountryId', 'getAdditionalInformation'])
- ->getMockForAbstractClass();
- $paymentInfoMock->expects($this->once())->method('getQuote')->willReturnSelf();
- $paymentInfoMock->expects($this->once())->method('getBillingAddress')->willReturnSelf();
- $paymentInfoMock->expects($this->once())->method('getCountryId')->willReturn(4);
- $paymentInfoMock->expects($this->once())
- ->method('getAdditionalInformation')
- ->with('buckaroo_skip_validation')
- ->willReturn(true);
-
- $instance = $this->getInstance();
- $instance->setData('info_instance', $paymentInfoMock);
-
- $result = $instance->validate();
-
- $this->assertInstanceOf(Giropay::class, $result);
- }
-}
diff --git a/etc/adminhtml/system/payment_methods.xml b/etc/adminhtml/system/payment_methods.xml
index 2aa07251a..3a80f1638 100644
--- a/etc/adminhtml/system/payment_methods.xml
+++ b/etc/adminhtml/system/payment_methods.xml
@@ -66,8 +66,6 @@
-
-
diff --git a/etc/adminhtml/system/payment_methods/giropay.xml b/etc/adminhtml/system/payment_methods/giropay.xml
deleted file mode 100644
index 6ba00f4cb..000000000
--- a/etc/adminhtml/system/payment_methods/giropay.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-
-
-
-
-
-
- Buckaroo\Magento2\Block\Config\Form\Field\Fieldset
-
-
-
-
- Buckaroo\Magento2\Model\Config\Source\Enablemode
- payment/buckaroo_magento2_giropay/active
-
-
-
-
-
- payment/buckaroo_magento2_giropay/title
-
-
-
-
-
- payment/buckaroo_magento2_giropay/subtext
-
-
-
-
-
- Buckaroo\Magento2\Model\Config\Source\SubtextStyle
- payment/buckaroo_magento2_giropay/subtext_style
-
-
-
-
-
- payment/buckaroo_magento2_giropay/subtext_color
- Buckaroo\Magento2\Block\Config\Form\Field\ColorPicker
-
-
-
-
-
-
- payment/buckaroo_magento2_giropay/sort_order
-
-
-
-
-
-
-
-
- Magento\Config\Model\Config\Source\Yesno
- payment/buckaroo_magento2_giropay/order_email
-
-
-
-
- Configuration > Sales > Tax.]]>
- payment/buckaroo_magento2_giropay/payment_fee
- Buckaroo\Magento2\Model\Config\Backend\PaymentFee
-
-
-
-
-
- payment/buckaroo_magento2_giropay/payment_fee_label
-
-
-
-
-
- The payment method shows only for orders with an order amount greater than the minimum amount.
- payment/buckaroo_magento2_giropay/min_amount
- Buckaroo\Magento2\Model\Config\Backend\Price
-
-
-
-
-
- The payment method shows only for orders with an order amount smaller than the maximum amount.
- payment/buckaroo_magento2_giropay/max_amount
- Buckaroo\Magento2\Model\Config\Backend\Price
-
-
-
-
-
- Magento\Config\Model\Config\Source\Yesno
- payment/buckaroo_magento2_giropay/active_status
-
-
-
-
-
- To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.
- Buckaroo\Magento2\Model\Config\Source\StatusesSuccess
- payment/buckaroo_magento2_giropay/order_status_success
-
- 1
-
-
-
-
-
-
- To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.
- Buckaroo\Magento2\Model\Config\Source\StatusesFailed
- payment/buckaroo_magento2_giropay/order_status_failed
-
- 1
-
-
-
-
-
-
- Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.
- payment/buckaroo_magento2_giropay/allowed_currencies
- Buckaroo\Magento2\Model\Config\Source\AllowedCurrencies::giropay
- Buckaroo\Magento2\Model\Config\Backend\AllowedCurrencies
-
-
-
-
- Buckaroo\Magento2\Model\Config\Source\AllOrSpecificCountries
- payment/buckaroo_magento2_giropay/allowspecific
-
-
-
-
-
- Magento\Config\Model\Config\Source\Locale\Country
- payment/buckaroo_magento2_giropay/specificcountry
-
- 1
-
-
-
-
-
-
- Magento developer client restrictions.
- Magento\Config\Model\Config\Source\Yesno
- payment/buckaroo_magento2_giropay/limit_by_ip
-
-
-
-
- Buckaroo\Magento2\Model\Config\Source\SpecificCustomerGroups
- 1
- payment/buckaroo_magento2_giropay/specificcustomergroup
-
-
-
-
diff --git a/etc/config.xml b/etc/config.xml
index 320d22a16..d95dba683 100644
--- a/etc/config.xml
+++ b/etc/config.xml
@@ -95,7 +95,7 @@
buckaroo_magento2
order
0
- amex,bancontactmrcash,cartebancaire,cartebleuevisa,nexi,postepay,dankort,eps,giftcard,giropay,ideal,mastercard,paypal,sofortueberweisung,transfer,visa,maestro,visaelectron,vpay,alipay,wechatpay,p24,trustly,belfius,blik
+ amex,bancontactmrcash,cartebancaire,cartebleuevisa,nexi,postepay,dankort,eps,giftcard,ideal,mastercard,paypal,sofortueberweisung,transfer,visa,maestro,visaelectron,vpay,alipay,wechatpay,p24,trustly,belfius,blik
@@ -182,23 +182,9 @@
buckaroo_magento2
order
1
- amex,bancontactmrcash,cartebancaire,cartebleuevisa,nexi,postepay,dankort,eps,giftcard,giropay,ideal,mastercard,paypal,sofortueberweisung,transfer,visa,maestro,visaelectron,vpay,alipay,wechatpay,p24,trustly,belfius,blik
+ amex,bancontactmrcash,cartebancaire,cartebleuevisa,nexi,postepay,dankort,eps,giftcard,ideal,mastercard,paypal,sofortueberweisung,transfer,visa,maestro,visaelectron,vpay,alipay,wechatpay,p24,trustly,belfius,blik
-
- 0
- Buckaroo\Magento2\Model\Method\Giropay
- pending
- Giropay
- 0
- 160
- 1
- Fee
- buckaroo_magento2
- order
- 0
-
-
0
Buckaroo\Magento2\Model\Method\Mrcash
@@ -290,8 +276,8 @@
1
1
1
- amex,bancontactmrcash,cartebancaire,cartebleuevisa,nexi,postepay,dankort,eps,sepadirectdebit,giftcard,giropay,ideal,mastercard,paypal,sofortueberweisung,transfer,visa,maestro,visaelectron,vpay,alipay,wechatpay,p24,trustly,belfius,blik
- amex,bancontactmrcash,cartebancaire,cartebleuevisa,nexi,postepay,dankort,eps,giftcard,giropay,ideal,mastercard,paypal,sofortueberweisung,transfer,visa,maestro,visaelectron,vpay,alipay,wechatpay,p24,trustly,belfius,blik
+ amex,bancontactmrcash,cartebancaire,cartebleuevisa,nexi,postepay,dankort,eps,sepadirectdebit,giftcard,ideal,mastercard,paypal,sofortueberweisung,transfer,visa,maestro,visaelectron,vpay,alipay,wechatpay,p24,trustly,belfius,blik
+ amex,bancontactmrcash,cartebancaire,cartebleuevisa,nexi,postepay,dankort,eps,giftcard,ideal,mastercard,paypal,sofortueberweisung,transfer,visa,maestro,visaelectron,vpay,alipay,wechatpay,p24,trustly,belfius,blik
7
1
diff --git a/etc/csp_whitelist.xml b/etc/csp_whitelist.xml
index 35c36e996..8aadc2928 100644
--- a/etc/csp_whitelist.xml
+++ b/etc/csp_whitelist.xml
@@ -18,15 +18,18 @@ list.xsd">
+ https://portal.payconiq.com
https://static.buckaroo.nl
+ wss://websocketservice-externalapi.prod.buckaroo.io
https://static.buckaroo.nl
wss://websockets.buckaroo.io/
https://checkout.buckaroo.nl
https://testcheckout.buckaroo.nl
+ https://applepay.buckaroo.io
diff --git a/etc/di.xml b/etc/di.xml
index 89cf99a36..75c61345c 100644
--- a/etc/di.xml
+++ b/etc/di.xml
@@ -249,10 +249,6 @@
- creditcards
- Buckaroo\Magento2\Model\ConfigProvider\Method\Creditcards
- -
-
- giropay
- - Buckaroo\Magento2\Model\ConfigProvider\Method\Giropay
-
-
- mrcash
- Buckaroo\Magento2\Model\ConfigProvider\Method\Mrcash
diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml
index 6bd197d3b..d217359d4 100644
--- a/etc/frontend/di.xml
+++ b/etc/frontend/di.xml
@@ -36,7 +36,6 @@
- Buckaroo\Magento2\Model\ConfigProvider\Method\Mrcash
- Buckaroo\Magento2\Model\ConfigProvider\Method\Sofortbanking
- Buckaroo\Magento2\Model\ConfigProvider\Method\Belfius
- - Buckaroo\Magento2\Model\ConfigProvider\Method\Giropay
- Buckaroo\Magento2\Model\ConfigProvider\Method\Afterpay
- Buckaroo\Magento2\Model\ConfigProvider\Method\Afterpay2
- Buckaroo\Magento2\Model\ConfigProvider\Method\PayPerEmail
diff --git a/etc/payment.xml b/etc/payment.xml
index 80e06896c..93dffa21d 100644
--- a/etc/payment.xml
+++ b/etc/payment.xml
@@ -51,9 +51,6 @@
0
-
- 0
-
0
diff --git a/etc/sales.xml b/etc/sales.xml
index a884141fb..3171d1aaf 100644
--- a/etc/sales.xml
+++ b/etc/sales.xml
@@ -31,11 +31,16 @@
+
+
+ -
+
+
diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv
index e13182196..42f141d39 100644
--- a/i18n/de_DE.csv
+++ b/i18n/de_DE.csv
@@ -97,8 +97,6 @@
"Enable Przelewy24","Przelewy24 activieren"
"Trustly","Trustly"
"Enable Trustly","Trustly activieren"
-"Giropay","Giropay"
-"Enable Giropay","Giropay activieren"
"Refunding","Erstattung"
"Enable or disable refunding.","Gutschrift/Rückerstattung aktivieren oder deaktivieren."
"Set to 'No' refunds must be done manualy in Payment Plaza.","Mit der Auswahl 'Nein' werden Gutschriften in Magento bei Payment Plaza nicht angeboten."
diff --git a/i18n/es_ES.csv b/i18n/es_ES.csv
index 37a3d4c79..25943735f 100644
--- a/i18n/es_ES.csv
+++ b/i18n/es_ES.csv
@@ -99,8 +99,6 @@
"Enable Trustly","Activar Trustly"
"Request To Pay","Request To Pay"
"Enable Request To Pay","Activar Request To Pay"
-"Giropay","Giropay"
-"Enable Giropay","Activar Giropay"
"Refunding","Reembolso"
"Enable or disable refunding.","Activar o desactivar el reembolso."
"Set to 'No' refunds must be done manualy in Payment Plaza.","Elegir 'No' para 'los reembolsos se deben realizar manualmente en Payment Plaza'."
diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv
index 08d54046d..76b72f06a 100644
--- a/i18n/fr_FR.csv
+++ b/i18n/fr_FR.csv
@@ -97,8 +97,6 @@
"Enable Przelewy24","Activer Przelewy24"
"Trustly","Trustly"
"Enable Trustly","Activer Trustly"
-"Giropay","Giropay"
-"Enable Giropay","Activer Giropay"
"Refunding","Remboursement"
"Enable or disable refunding.","Activer ou désactiver le remboursement"
"Set to 'No' refunds must be done manualy in Payment Plaza.","Défini sur "Non", les remboursements doivent être effectués manuellement dans Payment Plaza."
diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv
index 598df015d..bd82c60ab 100644
--- a/i18n/nl_BE.csv
+++ b/i18n/nl_BE.csv
@@ -97,8 +97,6 @@
"Enable Przelewy24","Przelewy24 inschakelen"
"Trustly","Trustly"
"Enable Trustly","Trustly inschakelen"
-"Giropay","Giropay"
-"Enable Giropay","Giropay inschakelen"
"Refunding","Terugbetaling"
"Enable or disable refunding.","Schakel de creditering/terugstorten in of uit."
"Set to 'No' refunds must be done manualy in Payment Plaza.","Bij de selectie 'Nee' worden credit memo's in Magento niet aangeboden bij Payment Plaza."
diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv
index 0eba9f0e5..65b8ee68f 100644
--- a/i18n/nl_NL.csv
+++ b/i18n/nl_NL.csv
@@ -99,8 +99,6 @@
"Enable Przelewy24","Przelewy24 inschakelen"
"Trustly","Trustly"
"Enable Trustly","Trustly inschakelen"
-"Giropay","Giropay"
-"Enable Giropay","Giropay inschakelen"
"Blik","Blik"
"Enable Blik","Blik inschakelen"
"Refunding","Terugbetaling"
diff --git a/view/frontend/layout/catalog_product_view.xml b/view/frontend/layout/catalog_product_view.xml
index 96ba3015a..46239ee9d 100644
--- a/view/frontend/layout/catalog_product_view.xml
+++ b/view/frontend/layout/catalog_product_view.xml
@@ -18,6 +18,9 @@
* @license https://tldrlegal.com/license/mit-license
-->
+
+
+
-
\ No newline at end of file
+
diff --git a/view/frontend/layout/checkout_cart_index.xml b/view/frontend/layout/checkout_cart_index.xml
index 17a7d2bdb..abf009c79 100644
--- a/view/frontend/layout/checkout_cart_index.xml
+++ b/view/frontend/layout/checkout_cart_index.xml
@@ -6,6 +6,9 @@
*/
-->
+
+
+
- -
-
- Buckaroo_Magento2/js/view/checkout/summary/grand-total
- -
-
- Order Total Excl. Tax
- - Order Total Incl. Tax
- - You will be charged for
- - Order Total
-
+
+ -
+
- Buckaroo_Magento2/js/view/checkout/summary/remaining-amount
+ - 250
+ - Remaining Amount
+ - false
+
+
+ -
+
- Buckaroo_Magento2/js/view/checkout/summary/already-paid
+ - 300
+ - Already Paid
+ - false
@@ -117,9 +122,6 @@
-
- true
- -
-
- true
-
-
- true
diff --git a/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml b/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml
index 17acf5b5a..fb83b3c14 100644
--- a/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml
+++ b/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml
@@ -1,45 +1,52 @@
canShowProductButton()): ?>
-
-
+if ($block->canShowProductButton()): ?>
-
+
diff --git a/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml b/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml
index ba779e13c..4eb96518f 100644
--- a/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml
+++ b/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml
@@ -1,45 +1,52 @@
canShowCartButton()): ?>
-
-
-
-
+
diff --git a/view/frontend/web/css/ideal-fast-checkout.css b/view/frontend/web/css/ideal-fast-checkout.css
new file mode 100644
index 000000000..e107f91ac
--- /dev/null
+++ b/view/frontend/web/css/ideal-fast-checkout.css
@@ -0,0 +1,17 @@
+#fast-checkout-ideal-btn {
+ height: 45px;
+ padding: 0;
+ border: none;
+ background: none;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin: 20px 0;
+}
+
+#fast-checkout-ideal-btn img {
+ max-height: 100%;
+ max-width: 100%;
+ display: block;
+ margin: auto;
+}
diff --git a/view/frontend/web/css/styles.css b/view/frontend/web/css/styles.css
index 7afb0da75..e3c2cd600 100644
--- a/view/frontend/web/css/styles.css
+++ b/view/frontend/web/css/styles.css
@@ -133,15 +133,15 @@
margin-top: 20px;
}
-.payment-method-second-col input::placeholder {
+.payment-method-second-col input::placeholder {
color: #c0c0c0;
- opacity: 1;
+ opacity: 1;
}
-
+
.payment-method-second-col input:-ms-input-placeholder {
color: #c0c0c0;
}
-
+
.payment-method-second-col input::-ms-input-placeholder {
color: #c0c0c0;
}
@@ -173,7 +173,6 @@
.buckaroo_magento2_afterpay20 .payment-method-second-col,
.buckaroo_magento2_billink .payment-method-second-col,
.buckaroo_magento2_sepadirectdebit .payment-method-second-col,
- .buckaroo_magento2_giropay .payment-method-second-col,
.buckaroo_magento2_payperemail .payment-method-second-col,
.buckaroo_magento2_klarna .payment-method-second-col,
.buckaroo_magento2_klarnakp .payment-method-second-col,
@@ -205,7 +204,6 @@
.buckaroo_magento2_afterpay20 .payment-method-billing-address,
.buckaroo_magento2_billink .payment-method-billing-address,
.buckaroo_magento2_sepadirectdebit .payment-method-billing-address,
- .buckaroo_magento2_giropay .payment-method-billing-address,
.buckaroo_magento2_payperemail .payment-method-billing-address,
.buckaroo_magento2_klarna .payment-method-billing-address,
.buckaroo_magento2_klarnakp .payment-method-billing-address,
@@ -241,7 +239,6 @@
.magento-blank .buckaroo_magento2_afterpay20 .fieldset > .field:not(.choice) > .label,
.magento-blank .buckaroo_magento2_billink .fieldset > .field:not(.choice) > .label,
.magento-blank .buckaroo_magento2_sepadirectdebit .fieldset > .field:not(.choice) > .label,
- .magento-blank .buckaroo_magento2_giropay .fieldset > .field:not(.choice) > .label,
.magento-blank .buckaroo_magento2_payperemail .fieldset > .field:not(.choice) > .label,
.magento-blank .buckaroo_magento2_klarna .fieldset > .field:not(.choice) > .label,
.magento-blank .buckaroo_magento2_klarnakp .fieldset > .field:not(.choice) > .label,
@@ -268,7 +265,6 @@
.magento-blank .buckaroo_magento2_afterpay20 .fieldset > .field:not(.choice) > .control,
.magento-blank .buckaroo_magento2_billink .fieldset > .field:not(.choice) > .control,
.magento-blank .buckaroo_magento2_sepadirectdebit .fieldset > .field:not(.choice) > .control,
- .magento-blank .buckaroo_magento2_giropay .fieldset > .field:not(.choice) > .control,
.magento-blank .buckaroo_magento2_payperemail .fieldset > .field:not(.choice) > .control,
.magento-blank .buckaroo_magento2_klarna .fieldset > .field:not(.choice) > .control,
.magento-blank .buckaroo_magento2_klarnakp .fieldset > .field:not(.choice) > .control,
@@ -293,7 +289,6 @@
.magento-blank .buckaroo_magento2_afterpay20 .fieldset > .field.choice:before,
.magento-blank .buckaroo_magento2_billink .fieldset > .field.choice:before,
.magento-blank .buckaroo_magento2_sepadirectdebit .fieldset > .field.choice:before,
- .magento-blank .buckaroo_magento2_giropay .fieldset > .field.choice:before,
.magento-blank .buckaroo_magento2_payperemail .fieldset > .field.choice:before,
.magento-blank .buckaroo_magento2_klarna .fieldset > .field.choice:before,
.magento-blank .buckaroo_magento2_klarnakp .fieldset > .field.choice:before,
@@ -643,4 +638,4 @@
.fieldset > .field .addon .bk-paybybank-selector .bank-method-input {
display:none;
}
-}
\ No newline at end of file
+}
diff --git a/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js b/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js
index 5235ef3d0..272012621 100644
--- a/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js
+++ b/view/frontend/web/js/view/checkout/ideal-fast-checkout/pay.js
@@ -1,23 +1,49 @@
define([
- 'jquery',
+ 'uiComponent',
'mage/url',
+ 'jquery',
'Magento_Customer/js/customer-data',
'mage/translate',
'mage/storage'
-], function ($, urlBuilder, customerData, $t, storage) {
+], function (Component, urlBuilder, $, customerData, $t, storage) {
'use strict';
- return {
- createQuoteAndPlaceOrder: function (productData) {
- this.showLoader();
+ return Component.extend({
+ page: null,
+ paymentData: null,
+
+ initialize: function (config) {
+ this._super();
- this.page = productData.page;
- productData.order_data = this.getOrderData();
+ this.page = config.page;
+ this.paymentData = config.paymentData;
var customerDataObject = customerData.get('customer');
customerDataObject.subscribe(function (updatedCustomer) {
}.bind(this));
+
+ $(document).on('click', '#fast-checkout-ideal-btn', function() {
+ this.onCheckout();
+ }.bind(this));
+ },
+
+ onCheckout: function () {
+ var qty = $("#qty").val();
+
+ var productData = {
+ qty: qty,
+ page: this.page,
+ paymentData: this.paymentData,
+ order_data: this.getOrderData()
+ };
+
+ this.createQuoteAndPlaceOrder(productData);
+ },
+
+ createQuoteAndPlaceOrder: function (productData) {
+ this.showLoader();
+
this.processOrderFlow(productData)
.then(this.onQuoteCreateSuccess.bind(this, productData))
.catch(this.onQuoteCreateFail.bind(this));
@@ -33,7 +59,7 @@ define([
getOrderData: function () {
let form = $("#product_addtocart_form");
- return this.page === 'product' ? form.serialize() : null;
+ return this.page === "product" ? form.serialize() : null;
},
onQuoteCreateSuccess: function (productData, quoteResponse) {
@@ -123,5 +149,5 @@ define([
hideLoader: function () {
$('body').loader('hide');
}
- };
+ });
});
diff --git a/view/frontend/web/js/view/checkout/summary/already-paid.js b/view/frontend/web/js/view/checkout/summary/already-paid.js
new file mode 100644
index 000000000..189a9e139
--- /dev/null
+++ b/view/frontend/web/js/view/checkout/summary/already-paid.js
@@ -0,0 +1,42 @@
+define([
+ 'Magento_Checkout/js/view/summary/abstract-total',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Catalog/js/price-utils',
+ 'Magento_Checkout/js/model/totals'
+], function (Component, quote, priceUtils, totals) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Buckaroo_Magento2/checkout/summary/already-paid'
+ },
+ isDisplayed: function () {
+ return this.getAlreadyPaidTotal() > 0;
+ },
+ getValue: function () {
+ var alreadyPaid = this.getAlreadyPaidTotal();
+ return this.getFormattedPrice(alreadyPaid);
+ },
+ getAlreadyPaidTotal: function () {
+ var buckarooFeeSegment = totals.getSegment('buckaroo_already_paid');
+ try {
+ if (buckarooFeeSegment.title) {
+ var items = JSON.parse(buckarooFeeSegment.title);
+ var total = 0;
+ if ((typeof items === 'object') && (items.length > 0)) {
+ for (var i = 0; i < items.length; i++) {
+ total = parseFloat(total) + parseFloat(items[i].serviceamount);
+ }
+ return parseFloat(total).toFixed(2);
+ }
+ }
+ } catch (e) {
+ }
+
+ return parseFloat(buckarooFeeSegment.value).toFixed(2);
+ },
+ getFormattedPrice: function (price) {
+ return priceUtils.formatPrice(price, quote.getPriceFormat());
+ }
+ });
+});
diff --git a/view/frontend/web/js/view/checkout/summary/grand-total.js b/view/frontend/web/js/view/checkout/summary/grand-total.js
deleted file mode 100644
index 3c1c89431..000000000
--- a/view/frontend/web/js/view/checkout/summary/grand-total.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-/**
- * @api
- */
-
-define([
- 'Magento_Checkout/js/view/summary/abstract-total',
- 'Magento_Checkout/js/model/quote',
- 'Magento_Catalog/js/price-utils',
- 'Magento_Checkout/js/model/totals'
-], function (Component, quote, priceUtils, totals) {
- 'use strict';
-
- return Component.extend({
- defaults: {
- isFullTaxSummaryDisplayed: window.checkoutConfig.isFullTaxSummaryDisplayed || false,
- template: 'Buckaroo_Magento2/checkout/summary/grand-total'
- },
- totals: quote.getTotals(),
- isTaxDisplayedInGrandTotal: window.checkoutConfig.includeTaxInGrandTotal || false,
-
- /**
- * @return {*}
- */
- isDisplayed: function () {
- return this.isFullMode();
- },
-
- /**
- * @return {*|String}
- */
- getValue: function () {
- var price = 0;
-
- if (this.totals()) {
- price = totals.getSegment('grand_total').value;
-
- if(!isNaN(parseFloat(this.getAlreadyPayTotal()))){
- price = parseFloat(price) - parseFloat(this.getAlreadyPayTotal());
- }
- }
-
- return this.getFormattedPrice(price);
- },
-
- /**
- * @return {*|String}
- */
- getBaseValue: function () {
- var price = 0;
-
- if (this.totals()) {
- price = this.totals()['base_grand_total'];
- }
-
- return priceUtils.formatPriceLocale(price, quote.getBasePriceFormat());
- },
-
- /**
- * @return {*}
- */
- getGrandTotalExclTax: function () {
- var total = this.totals(),
- amount;
-
- if (!total) {
- return 0;
- }
-
- amount = total['grand_total'] - total['tax_amount'];
-
- if (amount < 0) {
- amount = 0;
- }
-
- return this.getFormattedPrice(amount);
- },
-
- /**
- * @return {Boolean}
- */
- isBaseGrandTotalDisplayNeeded: function () {
- var total = this.totals();
-
- if (!total) {
- return false;
- }
-
- return total['base_currency_code'] != total['quote_currency_code']; //eslint-disable-line eqeqeq
- },
-
- getAlreadyPayTotal : function () {
- var buckarooFeeSegment = totals.getSegment('buckaroo_already_paid');
- try {
- if (buckarooFeeSegment.title) {
- var items = JSON.parse(buckarooFeeSegment.title);
- var total = 0;
- if ((typeof items === 'object') && (items.length > 0)) {
- for (var i = 0; i < items.length; i++) {
- total = parseFloat(total) + parseFloat(items[i].serviceamount);
- }
- return parseFloat(total).toFixed(2);
- }
- }
- } catch (e) {
- // console.log(e);
- }
-
- return parseFloat(buckarooFeeSegment.value).toFixed(2);
- }
- });
-});
diff --git a/view/frontend/web/js/view/checkout/summary/remaining-amount.js b/view/frontend/web/js/view/checkout/summary/remaining-amount.js
new file mode 100644
index 000000000..9a12ae4f2
--- /dev/null
+++ b/view/frontend/web/js/view/checkout/summary/remaining-amount.js
@@ -0,0 +1,37 @@
+define([
+ 'Magento_Checkout/js/view/summary/abstract-total',
+ 'Magento_Checkout/js/model/quote',
+ 'Magento_Catalog/js/price-utils',
+ 'Magento_Checkout/js/model/totals'
+], function (Component, quote, priceUtils, totals) {
+ 'use strict';
+
+ return Component.extend({
+ defaults: {
+ template: 'Buckaroo_Magento2/checkout/summary/remaining-amount'
+ },
+ isDisplayed: function () {
+ return this.getAlreadyPaidTotal() < 0;
+ },
+ getValue: function () {
+ var remainingAmount = 0;
+ if (totals.getSegment('remaining_amount')) {
+ remainingAmount = totals.getSegment('remaining_amount').value;
+ }
+ return this.getFormattedPrice(remainingAmount);
+ },
+ getAlreadyPaidTotal: function () {
+ var remainingAmount = 0;
+ if (totals.getSegment('buckaroo_already_paid')) {
+ remainingAmount = totals.getSegment('buckaroo_already_paid').value;
+ }
+ return remainingAmount;
+ },
+ getTitle: function () {
+ return this.title;
+ },
+ getFormattedPrice: function (price) {
+ return priceUtils.formatPrice(price, quote.getPriceFormat());
+ }
+ });
+});
diff --git a/view/frontend/web/js/view/payment/buckaroo-payments.js b/view/frontend/web/js/view/payment/buckaroo-payments.js
index efa1abc6a..b574b68b1 100644
--- a/view/frontend/web/js/view/payment/buckaroo-payments.js
+++ b/view/frontend/web/js/view/payment/buckaroo-payments.js
@@ -93,10 +93,6 @@ define(
type: 'buckaroo_magento2_transfer',
component: 'Buckaroo_Magento2/js/view/payment/method-renderer/transfer'
},
- {
- type: 'buckaroo_magento2_giropay',
- component: 'Buckaroo_Magento2/js/view/payment/method-renderer/giropay'
- },
{
type: 'buckaroo_magento2_mrcash',
component: 'Buckaroo_Magento2/js/view/payment/method-renderer/mrcash'
diff --git a/view/frontend/web/js/view/payment/method-renderer/giftcards.js b/view/frontend/web/js/view/payment/method-renderer/giftcards.js
index fe87d5dcf..ced797fd1 100644
--- a/view/frontend/web/js/view/payment/method-renderer/giftcards.js
+++ b/view/frontend/web/js/view/payment/method-renderer/giftcards.js
@@ -66,7 +66,7 @@ define(
}
function checkPayments(){
- var p = ["billink","klarnakp","capayableinstallments","sofortbanking","giropay","transfer","sepadirectdebit","capayablein3","creditcard","mrcash","payperemail","emandate"];
+ var p = ["billink","klarnakp","capayableinstallments","sofortbanking","transfer","sepadirectdebit","capayablein3","creditcard","mrcash","payperemail","emandate"];
p.forEach(function(item) {
$('.buckaroo_magento2_'+item).remove();
});
diff --git a/view/frontend/web/js/view/payment/method-renderer/giropay.js b/view/frontend/web/js/view/payment/method-renderer/giropay.js
deleted file mode 100644
index cb2804922..000000000
--- a/view/frontend/web/js/view/payment/method-renderer/giropay.js
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * NOTICE OF LICENSE
- *
- * This source file is subject to the MIT License
- * It is available through the world-wide-web at this URL:
- * https://tldrlegal.com/license/mit-license
- * If you are unable to obtain it through the world-wide-web, please send an email
- * to support@buckaroo.nl so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade this module to newer
- * versions in the future. If you wish to customize this module for your
- * needs please contact support@buckaroo.nl for more information.
- *
- * @copyright Copyright (c) Buckaroo B.V.
- * @license https://tldrlegal.com/license/mit-license
- */
-/*browser:true*/
-/*global define*/
-define(
- [
- 'jquery',
- 'Magento_Checkout/js/view/payment/default',
- 'Magento_Checkout/js/model/payment/additional-validators',
- 'Buckaroo_Magento2/js/action/place-order',
- 'ko',
- 'Magento_Checkout/js/checkout-data',
- 'Magento_Checkout/js/action/select-payment-method',
- 'buckaroo/checkout/common'
- ],
- function (
- $,
- Component,
- additionalValidators,
- placeOrderAction,
- ko,
- checkoutData,
- selectPaymentMethodAction,
- checkoutCommon
- ) {
- 'use strict';
-
- return Component.extend(
- {
- defaults: {
- template: 'Buckaroo_Magento2/payment/buckaroo_magento2_giropay'
- },
- paymentFeeLabel : window.checkoutConfig.payment.buckaroo.giropay.paymentFeeLabel,
- subtext : window.checkoutConfig.payment.buckaroo.giropay.subtext,
- subTextStyle : checkoutCommon.getSubtextStyle('giropay'),
- currencyCode : window.checkoutConfig.quoteData.quote_currency_code,
- baseCurrencyCode : window.checkoutConfig.quoteData.base_currency_code,
-
- /**
- * @override
- */
- initialize : function (options) {
- if (checkoutData.getSelectedPaymentMethod() == options.index) {
- window.checkoutConfig.buckarooFee.title(this.paymentFeeLabel);
- }
-
- return this._super(options);
- },
-
- /**
- * Place order.
- *
- * placeOrderAction has been changed from Magento_Checkout/js/action/place-order to our own version
- * (Buckaroo_Magento2/js/action/place-order) to prevent redirect and handle the response.
- */
- placeOrder: function (data, event) {
- var self = this,
- placeOrder;
-
- if (event) {
- event.preventDefault();
- }
-
- if (this.validate() && additionalValidators.validate()) {
- this.isPlaceOrderActionAllowed(false);
- placeOrder = placeOrderAction(this.getData(), this.redirectAfterPlaceOrder, this.messageContainer);
-
- $.when(placeOrder).fail(
- function () {
- self.isPlaceOrderActionAllowed(true);
- }
- ).done(this.afterPlaceOrder.bind(this));
- return true;
- }
- return false;
- },
-
- afterPlaceOrder: function () {
- var response = window.checkoutConfig.payment.buckaroo.response;
- checkoutCommon.redirectHandle(response);
- },
-
- selectPaymentMethod: function () {
- window.checkoutConfig.buckarooFee.title(this.paymentFeeLabel);
-
- selectPaymentMethodAction(this.getData());
- checkoutData.setSelectedPaymentMethod(this.item.method);
- return true;
- },
-
- payWithBaseCurrency: function () {
- var allowedCurrencies = window.checkoutConfig.payment.buckaroo.giropay.allowedCurrencies;
-
- return allowedCurrencies.indexOf(this.currencyCode) < 0;
- },
-
- getPayWithBaseCurrencyText: function () {
- var text = $.mage.__('The transaction will be processed using %s.');
-
- return text.replace('%s', this.baseCurrencyCode);
- }
- }
- );
- }
-);
diff --git a/view/frontend/web/template/checkout/summary/already-paid.html b/view/frontend/web/template/checkout/summary/already-paid.html
new file mode 100644
index 000000000..41d367b5b
--- /dev/null
+++ b/view/frontend/web/template/checkout/summary/already-paid.html
@@ -0,0 +1,11 @@
+
+
+
+
+
+ |
+
+
+ |
+
+
diff --git a/view/frontend/web/template/checkout/summary/grand-total.html b/view/frontend/web/template/checkout/summary/grand-total.html
deleted file mode 100644
index 5a324f922..000000000
--- a/view/frontend/web/template/checkout/summary/grand-total.html
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
- |
-
-
- |
-
-
-
-
- |
-
-
- |
-
-
-
-
-
-
- |
-
-
- |
-
-
-
-
- |
-
-
- |
-
-
diff --git a/view/frontend/web/template/checkout/summary/remaining-amount.html b/view/frontend/web/template/checkout/summary/remaining-amount.html
new file mode 100644
index 000000000..bcba4c746
--- /dev/null
+++ b/view/frontend/web/template/checkout/summary/remaining-amount.html
@@ -0,0 +1,10 @@
+
+
+
+
+ |
+
+
+ |
+
+
diff --git a/view/frontend/web/template/payment/buckaroo_magento2_giropay.html b/view/frontend/web/template/payment/buckaroo_magento2_giropay.html
deleted file mode 100644
index 8b71e76b2..000000000
--- a/view/frontend/web/template/payment/buckaroo_magento2_giropay.html
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
![]()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-