buckaroo-it / Magento2

Repository containing the Magento2 plugin by Buckaroo
MIT License
28 stars 35 forks source link

BP-3843 v1.50+ breaks Magento API schema #1072

Open MatthijsBreed opened 1 month ago

MatthijsBreed commented 1 month ago

On version v1.50

When requesting api schema via /rest/all/schema?services=all Magento returns the following error The "QuoteCreateResponseInterface" class doesn't exist and the namespace must be specified. Verify and try again.

This is because Magento needs fully namespaced interfaces for the return types of interface functions used by webapi

This patch fixes the errors:

diff --git a/vendor/buckaroo/magento2/Api/IdealQuoteCreateInterface.php b/vendor/buckaroo/magento2/Api/IdealQuoteCreateInterface.php
--- a/vendor/buckaroo/magento2/Api/IdealQuoteCreateInterface.php    
+++ b/vendor/buckaroo/magento2/Api/IdealQuoteCreateInterface.php    (date 1728984361036)
@@ -31,7 +31,7 @@
      *
      * @param string $page
      * @param string|null $order_data
-     * @return QuoteCreateResponseInterface
+     * @return \Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface
      */
     public function execute(
         string $page,
diff --git a/vendor/buckaroo/magento2/Api/PaypalExpressQuoteCreateInterface.php b/vendor/buckaroo/magento2/Api/PaypalExpressQuoteCreateInterface.php
--- a/vendor/buckaroo/magento2/Api/PaypalExpressQuoteCreateInterface.php    
+++ b/vendor/buckaroo/magento2/Api/PaypalExpressQuoteCreateInterface.php    (date 1728984654773)
@@ -32,7 +32,7 @@
    * @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,
Buckaroo-Rene commented 1 month ago

Hi @MatthijsBreed ,

Thank you for bringing this issue to our attention. We're currently investigating it and will keep you updated with any progress or resolutions.

Best regards, René

Buckaroo-Rene commented 1 month ago

Hi @MatthijsBreed ,

@vegimcarkaxhija created a fix for this issue. it will be included in the next upcoming release will let you know when there is more information regarding the actual release date.

You can check out his commit right here: https://github.com/buckaroo-it/Magento2/pull/1075/commits/9256d07b82b2784d84ee308f468fe220a220212f