Skip to content

Commit

Permalink
Merge pull request #62 from buckaroo-it/develop
Browse files Browse the repository at this point in the history
Update, Test & Release (1.3.0)
  • Loading branch information
vegimcarkaxhija authored Feb 6, 2025
2 parents 81092c5 + 16c81a3 commit ff74ca8
Show file tree
Hide file tree
Showing 19 changed files with 489 additions and 450 deletions.
11 changes: 2 additions & 9 deletions Block/Totals/Fee.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ class Fee extends \Magento\Framework\View\Element\Template
{
protected PaymentFee $feeHelper;

protected SessionCheckout $sessionCheckout;

public function __construct(
Context $context,
array $data,
PaymentFee $feeHelper,
SessionCheckout $sessionCheckout
)
{
parent::__construct($context, $data);
$this->feeHelper = $feeHelper;
$this->sessionCheckout = $sessionCheckout;
}

/**
Expand All @@ -34,12 +30,9 @@ public function __construct(
public function getTitle(): string
{
try {
$payment = $this->sessionCheckout
->getQuote()
->getPayment();
return $this->feeHelper->getBuckarooPaymentFeeLabel($payment->getMethod());
return $this->feeHelper->getBuckarooPaymentFeeLabel();
} catch (\Throwable $th) {
return __('Payment Fee');
return 'Payment Fee';
}
}
}
10 changes: 4 additions & 6 deletions Magewire/Payment/Method/Applepay.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ public function updateData(string $paymentData, string $billingContact)
{
try {
$quote = $this->sessionCheckout->getQuote();
$quote->getPayment()->setAdditionalInformation('applepayTransaction', $paymentData);
$applePayEncoded = base64_encode($paymentData);
$quote->getPayment()->setAdditionalInformation('applepayTransaction', $applePayEncoded);
$quote->getPayment()->setAdditionalInformation('billingContact', $billingContact);

$this->quoteRepository->save($quote);
} catch (LocalizedException $exception) {
$this->dispatchErrorMessage($exception->getMessage());
}
return $paymentData;
}
public function evaluateCompletion(EvaluationResultFactory $resultFactory): EvaluationResultInterface
{
Expand All @@ -96,13 +98,10 @@ public function evaluateCompletion(EvaluationResultFactory $resultFactory): Eval
} catch (LocalizedException $exception) {
$this->dispatchErrorMessage($exception->getMessage());
}



return $resultFactory->createSuccess();
}

public function getJsSdkUrl(): string
public function getJsSdkUrl()
{
try {
return $this->assetRepo->getUrl('Buckaroo_HyvaCheckout::js/applepay.js');
Expand Down Expand Up @@ -149,7 +148,6 @@ private function getTotalLines(): array
];
}
}

return $totals;
}

Expand Down
42 changes: 31 additions & 11 deletions Magewire/Payment/Method/Billink.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct(
if($validator->getValidator("nlBeDePhone") === null) {
$validator->addValidator("nlBeDePhone", new NlBeDePhone());
}

parent::__construct($validator);

$this->sessionCheckout = $sessionCheckout;
Expand Down Expand Up @@ -295,23 +295,26 @@ private function getFullName(): string
private function getFormValues(): array
{
$values = [
'tos' => $this->tos,
'dateOfBirth' => $this->dateOfBirth,
'gender' => $this->gender
'tos' => $this->tos
];

if ($this->showPhone()) {
$values = array_merge($values, ['phone' => $this->phone]);
}

if(!$this->showB2b()) {
$values = array_merge($values, [
'dateOfBirth' => $this->dateOfBirth,
'gender' => $this->gender
]);
}
if($this->showB2b()) {
$values = array_merge($values, [
'coc' => $this->coc
]);
}



return $values;
}

Expand All @@ -323,12 +326,16 @@ private function getFormValues(): array
private function getFormRules(): array
{
$rules = [
'tos' => self::RULES_TOS,
'dateOfBirth' => self::RULES_DATE_OF_BIRTH,
'gender' => $this->getGenderRules()
'tos' => self::RULES_TOS
];

if(!$this->showB2b()) {
$rules = array_merge($rules, [
'dateOfBirth' => self::RULES_DATE_OF_BIRTH,
'gender' => $this->getGenderRules()
]);

}
if ($this->showPhone()) {
$rules = array_merge($rules, ['phone' => $this->getPhoneRules()]);
}
Expand All @@ -344,7 +351,20 @@ private function getFormRules(): array

public function showB2b()
{
return $this->helper->checkCustomerGroup('buckaroo_magento2_billink');
$quote = $this->getQuote();
if ($quote === null) {
return false;
}

$shippingCountry = $quote->getShippingAddress()->getCountryId();
$billingCompany = $quote->getBillingAddress()->getCompany();
$shippingCompany = $quote->getShippingAddress()->getCompany();

return
(
($this->getCountryId() === 'NL' && !empty(trim((string)$billingCompany))) ||
($shippingCountry === 'NL' && !empty(trim((string)$shippingCompany)))
);
}


Expand Down
85 changes: 0 additions & 85 deletions Magewire/Payment/Method/Giropay.php

This file was deleted.

1 change: 0 additions & 1 deletion Plugin/MethodList.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ private function getSvgLogo(string $methodCode): string
"mrcash" => "svg/bancontact.svg",
"p24" => "svg/przelewy24.svg",
"sepadirectdebit" => "svg/sepa-directdebit.svg",
"sofortbanking" => "svg/sofort.svg",
"emandate" => "emandate.png",
"pospayment" => "pos.png",
"transfer" => "svg/sepa-credittransfer.svg",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"docs": "https://support.buckaroo.nl"
},
"homepage": "https://www.buckaroo.nl",
"version" : "v1.2.0",
"version" : "v1.3.0",
"minimum-stability": "stable",
"autoload": {
"files": [
Expand Down
4 changes: 1 addition & 3 deletions etc/frontend/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<arguments>
<argument name="placeOrderServiceList" xsi:type="array">
<item name="buckaroo_magento2_belfius" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_sofortbanking" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_alipay" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_wechatpay" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_trustly" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
Expand All @@ -27,7 +26,6 @@
<item name="buckaroo_magento2_afterpay20" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_billink" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_capayablein3" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_giropay" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_tinka" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_sepadirectdebit" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
<item name="buckaroo_magento2_payperemail" xsi:type="object">\Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService</item>
Expand All @@ -42,7 +40,7 @@
</argument>
</arguments>
</type>
<type name="Hyva\Checkout\Model\Form\EntityFormFieldFactory">
<type name="Hyva\Checkout\Model\Form\EntityFormFieldFactory">
<arguments>
<!-- Hide idin customer fields -->
<argument name="customFields" xsi:type="array">
Expand Down
6 changes: 6 additions & 0 deletions view/frontend/layout/hyva_checkout_cart_index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="buckaroo_magento2.checkout.cart.ideal.fast.checkout" remove="true" />
</body>
</page>
Loading

0 comments on commit ff74ca8

Please sign in to comment.