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

Fix/piwoo 125 - Add woocommerce checkout blocks support #808

Merged
merged 5 commits into from
Sep 13, 2023

Conversation

inpsyde-maticluznar
Copy link
Collaborator

Woocommerce checkout blocks require implementation of the following class: Automattic\WooCommerce\Blocks\Payments\Integration\AbstractPaymentMethodType

I implemented a class MollieCheckoutBlocksSupport.php which extends AbstractPaymentMethodType and registered its object using PaymentMethodRegistry in woocommerce_blocks_payment_method_type_registration hook.

Some of the code was removed from the AssetModule and some of the code was moved from the AssetsModule to the MollieCheckoutBlocksSupport.

Additionally I updated Woocommerce stubs and included <file name="vendor/php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php"/> in psalm.xml.

@inpsyde-maticluznar inpsyde-maticluznar changed the title Fix/piwoo 125 Fix/piwoo 125 - Add woocommerce checkout blocks support Jul 31, 2023
@inpsyde-maticluznar
Copy link
Collaborator Author

@mmaymo I had to restore some parts of the code that handled rendering of the payment methods on the checkout. Before that, Payment methods were registered using PaymentMethodRegistry in PHP, but this caused a lot of issues when we were trying to filter them. Now we generate payment method data using PHP and send it to JS where we do a registration. Because of that, payment method filtering now works.

@mmaymo mmaymo merged commit 0c72a7c into develop Sep 13, 2023
4 checks passed
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.

2 participants