-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* NTR: Squashed commit of the following: commit 70fe37e Author: Vitalij Mik <[email protected]> Date: Mon Mar 18 15:17:08 2024 +0100 NTR: update mollie lbirary (#723) Co-authored-by: Vitalij Mik <[email protected]> * NTR: PISHPS-229: add bancomat pay * NTR: remove console.log * NTR: eslint fix * NTR: Squashed commit of the following: commit 1903129 Author: Vitalij Mik <[email protected]> Date: Tue Mar 19 08:33:14 2024 +0100 NTR: add the default system language (#726) Co-authored-by: Vitalij Mik <[email protected]> commit 77be51e Author: Vitalij Mik <[email protected]> Date: Tue Mar 19 08:32:52 2024 +0100 NTR: PISHPS-256: rebranding ideal (#725) Co-authored-by: Vitalij Mik <[email protected]> commit 70fe37e Author: Vitalij Mik <[email protected]> Date: Mon Mar 18 15:17:08 2024 +0100 NTR: update mollie lbirary (#723) Co-authored-by: Vitalij Mik <[email protected]> * NTR: fix pr * NTR: hide bancomat in order edit * NTR: bancomat pay numer ist noch required --------- Co-authored-by: Vitalij Mik <[email protected]>
- Loading branch information
1 parent
4d077fd
commit 8ca3c81
Showing
19 changed files
with
286 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Kiener\MolliePayments\Handler\Method; | ||
|
||
use Kiener\MolliePayments\Handler\PaymentHandler; | ||
use Kiener\MolliePayments\Struct\Order\OrderAttributes; | ||
use Mollie\Api\Types\PaymentMethod; | ||
use Shopware\Core\Checkout\Customer\CustomerEntity; | ||
use Shopware\Core\Checkout\Order\OrderEntity; | ||
use Shopware\Core\System\SalesChannel\SalesChannelContext; | ||
|
||
class BancomatPayment extends PaymentHandler | ||
{ | ||
public const PAYMENT_METHOD_NAME = PaymentMethod::BANCOMATPAY; | ||
public const PAYMENT_METHOD_DESCRIPTION = 'Bancomat Pay'; | ||
|
||
/** @var string */ | ||
protected $paymentMethod = self::PAYMENT_METHOD_NAME; | ||
|
||
/** | ||
* @param array<mixed> $orderData | ||
* @param OrderEntity $orderEntity | ||
* @param SalesChannelContext $salesChannelContext | ||
* @param CustomerEntity $customer | ||
* @return array<mixed> | ||
*/ | ||
public function processPaymentMethodSpecificParameters(array $orderData, OrderEntity $orderEntity, SalesChannelContext $salesChannelContext, CustomerEntity $customer): array | ||
{ | ||
$orderCustomFields = new OrderAttributes($orderEntity); | ||
$orderData['billingAddress']['phone'] = $orderCustomFields->getBancomatPayPhoneNumber(); | ||
return $orderData; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Resources/app/storefront/src/mollie-payments/plugins/bancomat-plugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import Plugin from '@shopware-storefront-sdk/plugin-system/plugin.class'; | ||
|
||
export default class MollieBancomatPlugin extends Plugin { | ||
|
||
init() { | ||
|
||
const phoneField = document.getElementById('mollieBancomatPayPhone'); | ||
if (phoneField === null) { | ||
|
||
return; | ||
} | ||
|
||
const inputFieldWrapper = document.querySelector('.mollie-bancomat-pay'); | ||
|
||
const errorMessageElement = document.querySelector('.mollie-bancomat-pay [data-form-validation-invalid-phone="true"]'); | ||
|
||
phoneField.addEventListener('focus',(e)=>{ | ||
inputFieldWrapper.classList.add('was-validated'); | ||
e.target.removeAttribute('invalid'); | ||
errorMessageElement.classList.add('d-none'); | ||
}); | ||
|
||
|
||
phoneField.addEventListener('blur', (e) => { | ||
const form = e.target.form; | ||
if(form.reportValidity() === false){ | ||
e.target.setAttribute('invalid',true); | ||
errorMessageElement.classList.remove('d-none'); | ||
} | ||
return form.reportValidity(); | ||
|
||
}) | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Resources/views/storefront/component/payment/component/bancomat-fields.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% if context.paymentMethod.translated.customFields.mollie_payment_method_name == 'bancomatpay' %} | ||
<div class="mollie-bancomat-pay"> | ||
|
||
<label for="mollieBancomatPayPhone">{{ "molliePayments.components.bancomatPay.headLine"|trans|striptags }}:</label> | ||
<input id="mollieBancomatPayPhone" | ||
placeholder="+49123456789" | ||
name="mollieBancomatPayPhone" form="confirmOrderForm" type="text" pattern="\+[1-9]\d{1,14}" | ||
class="form-control" | ||
value="{{ context.customer.activeBillingAddress.phoneNumber }}" | ||
/> | ||
<small class="form-text js-validation-message invalid-feedback d-none" | ||
data-form-validation-invalid-phone="true" invalid="true"> | ||
{{ "molliePayments.components.bancomatPay.phoneErrorMessage"|trans|striptags }} | ||
</small> | ||
|
||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
tests/Cypress/cypress/e2e/storefront/payment-methods/bancomat.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Devices from "Services/utils/Devices"; | ||
import Session from "Services/utils/Session" | ||
// ------------------------------------------------------ | ||
import PaymentAction from "Actions/storefront/checkout/PaymentAction"; | ||
import DummyBasketScenario from "Scenarios/DummyBasketScenario"; | ||
// ------------------------------------------------------ | ||
|
||
|
||
const devices = new Devices(); | ||
const session = new Session(); | ||
|
||
const paymentAction = new PaymentAction(); | ||
const scenarioDummyBasket = new DummyBasketScenario(1); | ||
|
||
const device = devices.getFirstDevice(); | ||
|
||
|
||
describe('Bancomat Pay', () => { | ||
|
||
context(devices.getDescription(device), () => { | ||
|
||
before(function () { | ||
devices.setDevice(device); | ||
}) | ||
|
||
beforeEach(() => { | ||
session.resetBrowserSession(); | ||
devices.setDevice(device); | ||
}); | ||
|
||
it('C2775016: Bancomat Pay is existing in checkout', () => { | ||
|
||
scenarioDummyBasket.execute(); | ||
|
||
paymentAction.switchPaymentMethod('Bancomat Pay'); | ||
}) | ||
|
||
}) | ||
|
||
}) | ||
|
Oops, something went wrong.