buckaroo-it / Magento2_GraphQL

Repository containing the Magento 2 GraphQL plugin by Buckaroo
MIT License
1 stars 1 forks source link

selected_payment_method in cart #13

Closed raoulguillermo closed 2 years ago

raoulguillermo commented 2 years ago

Hi,

Would it be possible to add the buckaroo_additional data in selected_payment_method to the cart graphql as well?

{ cart(cart_id: "cartid") { selected_payment_method { code title buckaroo_additional { method_code issuer } } }

harli91 commented 2 years ago

Yes you need to do the following:

available_payment_methods {
    code
    title
    buckaroo_additional {
            key
            values {
                name
                code
                img
            }
            value
    }
}
raoulguillermo commented 2 years ago

Thanks but i didn't mean that. I need to be able to query the '_selected_paymentmethod'. For now it only returns the payment method but not the buckaroo_additional data.

Cannot query field buckaroo_additional on type SelectedPaymentMethod

harli91 commented 2 years ago

why you need the saved additional data?

raoulguillermo commented 2 years ago

Because i show the cart and overview in a new screen. Then i access the api data again to show the cart. (selected shipping method, payment method, products, prices etc.) Now i save the issuer data in a react context state. But it would be much better to get it from the api.

In your readme it allready states that this is the case? https://github.com/buckaroo-it/Magento2_GraphQL/blob/1014d793bb480bf7a8018c317984d25dd69f0a67/README.md

Correction it states that i can access the issuer when calling : setPaymentMethodOnCart But it would be nice to also get it from the regular cart query?

harli91 commented 2 years ago

sorry, we don't offer this functionality, in my opinion is better to save this settings in a js variable / session storage

raoulguillermo commented 2 years ago

No problem. Thanks anyway.