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

PWA Studio Integration #1133

Closed
ptylek opened this issue Jun 7, 2022 · 4 comments
Closed

PWA Studio Integration #1133

ptylek opened this issue Jun 7, 2022 · 4 comments
Assignees

Comments

@ptylek
Copy link
Contributor

ptylek commented Jun 7, 2022

Hey,
Are there any plans to extend and prepare more details about PWA Studio integration of this Magento 2 plugin? I found GraphQL API documentation but matching it together with Amazon Pay developer docs it's not as clear especially that the latter uses Amazon Pay SDK. Is the same functionality also prepared on the module so everything can be requested from Magento using GraphQL API?
I would be grateful for some more information in this matter.
Many thanks!

@sgabhart22
Copy link
Contributor

Hello again @ptylek !

Yes, comparing the GraphQL docs with the AP dev docs could be a little difficult, since the Amazon Pay module deals with the SDK directly so the developer doesn't have to. Instead, I would recommend having a look at the Frontend Customisation section of the module documentation, specifically the Notes on the Checkout Session API section and the example flow in Configurable URLs. You should be able to match most of the GraphQL queries/mutations pretty closely to the corresponding REST endpoints.

Also bear in mind that there are more details you'll have to handle yourself on the frontend side, such as placing and rendering the Amazon Pay button and handling the redirects. See Add the Amazon Pay Button for details on adding the Amazon Pay script, and do note that the module will generate the button payload and signature for you. You'll also need to make sure that your site can handle the various responses from Amazon throughout a checkout session by properly defining the Configurable URLs in your module configuration, and placing appropriate logic there to obtain the checkoutSessionId, redirect to your checkout URL, complete the checkout session, etc.

Please let us know if this helps,
Spencer

@ptylek
Copy link
Contributor Author

ptylek commented Jun 7, 2022

Hey @sgabhart22, thanks for your reply, this is helpful and probably the only solution for now.
Are there any plans to introduce extension that adds Amazon Pay payment option during checkout for PWA Studio in the future?

@zichicc zichicc self-assigned this Jun 7, 2022
@sgabhart22
Copy link
Contributor

sgabhart22 commented Jun 7, 2022

@ptylek I don't believe there is anything concretely planned as far as developing an Amazon Pay extension specifically for the Venia theme/PWA studio right now. There are so many different frontend options that a development team can choose with a headless Magento implementation that we initially chose to keep the GraphQL implementation generic, and available to be used with whatever frontend framework a merchant might have.

If one of your goals is to display the AP button as a payment option, Lars Roettig has an excellent article on adding payment methods to the venia-ui checkoutPagePaymentTypes: https://larsroettig.dev/demystified-pwa-studio-checkout

@ptylek
Copy link
Contributor Author

ptylek commented Jun 8, 2022

@sgabhart22 Thank you for your replies. It's really helpful 🙇🏻

@zichicc zichicc pinned this issue Jun 9, 2022
@zichicc zichicc closed this as completed Jun 9, 2022
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

No branches or pull requests

3 participants