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

PAYOSWXP-125: Shopware 6.6 compatibilty & BugFixes & Cypress-Tests #300

Merged
merged 45 commits into from
May 2, 2024

Conversation

rommelfreddy
Copy link
Collaborator

see ticket for more information

PLEASE DO NOT SQUASH!

@rommelfreddy rommelfreddy force-pushed the task/PAYOSWXP-125_66x-compatibility branch 2 times, most recently from 86d5a75 to 1f2b393 Compare April 12, 2024 17:14
+ required for SW6.6 compatibility
+ fixed configuration validation
invoice: b2b was never allowed (should be allowed if enabled)
+ add unit-tests
+ remove not required constraint (which was used for unzer)
+ replaced legacy sw-field component
+ replaced model binding
+ add correct content-slot for sw-page
+ replace component-icon (prev. icon does not exist anymore)
+ add missing position-identifier
@rommelfreddy rommelfreddy force-pushed the task/PAYOSWXP-125_66x-compatibility branch from 6b05367 to b351cc9 Compare April 18, 2024 00:45
@rommelfreddy rommelfreddy force-pushed the task/PAYOSWXP-125_66x-compatibility branch 3 times, most recently from f36d9ee to 22ebd05 Compare April 18, 2024 01:22
@rommelfreddy rommelfreddy force-pushed the task/PAYOSWXP-125_66x-compatibility branch from 22ebd05 to 2738659 Compare April 18, 2024 17:28
@rommelfreddy rommelfreddy force-pushed the task/PAYOSWXP-125_66x-compatibility branch from 2738659 to 2929345 Compare April 18, 2024 21:18
@rommelfreddy rommelfreddy force-pushed the task/PAYOSWXP-125_66x-compatibility branch from ec9e9d6 to 92be8c2 Compare April 18, 2024 23:23
@rommelfreddy rommelfreddy force-pushed the task/PAYOSWXP-125_66x-compatibility branch 2 times, most recently from 98c99d8 to 12702c6 Compare April 29, 2024 12:03
}

/** @var CustomerEntity|null $customer */
$customer = $this->customerRepository->search(new Criteria([$customerId]), $context)->first();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you get to this point, it would make sense to add the “defaultBillingAddress” association here, as you need it in the “getCustomerAddress” function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! Done.

protected function saveCustomerData(CustomerEntity $customer, RequestDataBag $dataBag, Context $context): void
{
$birthday = $dataBag->get(RequestConstants::BIRTHDAY);
$birthday = \is_string($birthday) ? \DateTime::createFromFormat('Y-m-d', $birthday) ?: null : null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put the \DateTime::createFromFormat('Y-m-d', $birthday) ?: null in brackets to make it easier to read?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

<service id="PayonePayment\Components\CustomerDataPersistor\CustomerDataPersistor" autowire="true">
<argument key="$orderAddressRepository" type="service" id="order_address.repository" />
<argument key="$customerRepository" type="service" id="customer.repository" />
<argument key="$customerAddressRepository" type="service" id="customer_address.repository" />
Copy link
Collaborator

@momocode-de momocode-de Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are using “autowire” anyway, you can actually omit the repository declarations, as autowiring should also work by default for these, if the variables are named accordingly (The way you did it).

Copy link
Collaborator Author

@rommelfreddy rommelfreddy May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know. But in the past Shopware does have a few problems with injecting the repositories, so i never used this in production.
my suggestion is to keep it in the backlog and refactoring this on the next SW 6.7 release.

Are you fine with that?

+ move saving to separate class to prevent saving during other request-builder calls
+ add saving of phonenumber into customer-address (prev. it was only saved into order-address)
@rommelfreddy rommelfreddy force-pushed the task/PAYOSWXP-125_66x-compatibility branch from d3b990f to e19c5b1 Compare May 2, 2024 10:20
@janteuber janteuber merged commit cd90fc3 into master May 2, 2024
38 checks passed
@janteuber janteuber deleted the task/PAYOSWXP-125_66x-compatibility branch May 2, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants