buckaroo-it / Magento2_Hyva

This repository contains the additional module to support Hyvä React Checkout
3 stars 0 forks source link

iDEAL payment method GraphQL error "Please select a issuer from the list" #11

Closed ennostuurman closed 1 year ago

ennostuurman commented 1 year ago

Issue: When selecting iDEAL as payment method in the Hyva React checkout the GraphQL mutation setPaymentMethodOnCart returns an error with the message "Please select a issuer from the list"

Magento 2.4.5-p1 with sample data clean install no other 3rd party modules Buckaroo Magento 2 extension v1.43.1

buckaroo-hyva-react-checkout-please-select-a-issuer-from-the-list

buckaroo-hyva-react-graphiql-please-select-a-issuer-from-the-list

harli91 commented 1 year ago

Hello @ennostuurman, from what i can tell you haven't properly installed our Hyva plugin, you need to follow the readme, when correctly installed you will have a select where you can chose the issuer

ennostuurman commented 1 year ago

hey @harli91 thanks maybe I didn't properly install the Buckaroo module or missed a step so let's verify:

1) I have in my composer.json

"config": {
    "paymentMethodsRepo": {
      "buckaroo": "git@github.com:buckaroo-it/Magento2_Hyva.git"
    }

2) I ran npm --prefix app/code/Hyva/CheckoutExample/reactapp/ install

3) I copied all files in Hyva/CheckoutExample/reactapp/src/paymentMethods/buckaroo/src/lib/overrides to Hyva/CheckoutExample/reactapp/src/

4) As a result I have Buckaroo in app/code/Hyva/CheckoutExample/paymentMethods/buckaroo and the Totals.jsx override om in app/code/Hyva/CheckoutExample/src/components/totals/Totals.jsx

buckaroo-hyva-checkout-example-files

Am I missing something?

harli91 commented 1 year ago

@ennostuurman yes, you forgot to build the app with the new changes npm run build

ennostuurman commented 1 year ago

hey @harli91 yes I forgot to run npm - indeed :-/ I ran the build process and now the bank options do show up indeed. During build eslint warnings showed up, that I temporarily suppressed in eslintrc.js 'react-hooks/exhaustive-deps': 0, 'react-hooks/rules-of-hooks': 0, . Should I create a new issue for that?

harli91 commented 1 year ago

yes, feedback is always welcomed :)

ennostuurman commented 1 year ago

Okay I'll create an issue for the eslint errors.

Before I create another issue can you please verify below. When I try to place an order with iDEAL the GraphQL endpoint returns an error on the mutation setPaymentMethodAndPlaceOrderMutation($cartId: String!)

Console

{
    "message": "Field \"buckaroo_additional\" is not defined by type PaymentMethodInput.; Cannot query field \"buckaroo_additional\" on type \"Order\"."
}

PHP error log

main.ERROR: Cannot query field "buckaroo_additional" on type "Order". {"exception":"[object] (GraphQL\\Error\\Error(code: 0): Cannot query field \"buckaroo_additional\" on type \"Order\". at /var/www/html/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php:56)"} []

FE

buckaroo-hyva-checkout-graphql-error

GraphiQL

buckaroo-graphql-error-graphiql

The mutation is defined in app/code/Hyva/CheckoutExample/reactapp/src/paymentMethods/buckaroo/src/lib/hooks/placeOrder.js

I checked this with Magento versions 2.4.3p3 and 2.4.5p1 and errors appear in both installs.

harli91 commented 1 year ago

you need to have installed the graphQL module https://github.com/buckaroo-it/Magento2_GraphQL

ennostuurman commented 1 year ago

hey @harli91 yes I found out in the meanwhile :-/ Installed it checked out to the develop branch and this issue is fixed.

ennostuurman commented 1 year ago

Non-issue fixed ;-) closing issue.