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

feat(demo): add payment form (unzer payment integration) #671

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

itscark
Copy link
Contributor

@itscark itscark commented Feb 25, 2024

Description

PR for 568

Copy link

vercel bot commented Feb 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
shopware-frontends-docs ✅ Ready (Inspect) Visit Preview May 6, 2024 11:42am

Copy link

codspeed-hq bot commented Feb 25, 2024

CodSpeed Performance Report

Merging #671 will not alter performance

Comparing itscark:feat/payment-form (506fe2a) with main (18d8528)

Summary

✅ 9 untouched benchmarks

@BrocksiNet BrocksiNet changed the title feat(demo): add payment form feat(demo): add payment form (unzer payment integration) Mar 4, 2024
@BrocksiNet BrocksiNet requested a review from mkucmus March 18, 2024 15:06
@BrocksiNet BrocksiNet added documentation Improvements or additions to documentation composables labels Mar 18, 2024
@mkucmus
Copy link
Collaborator

mkucmus commented Apr 10, 2024

hey @itscark! thank you for providing a PR. Here's a little update from our side: we are about to check it out but still need the creadentials for test unzer account to run it in entire flow. I asked for an account and it just can take a while.

Copy link
Collaborator

@mkucmus mkucmus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! thank you very much for a great PR!

I've checked twice and ran into a problem only with missing unzer instance (or sth related) so I suggested two solutions for that.

anyway, the overall is really great and using a dynamic import for component relying on its name in the backend is a good move 💪🏼
I was able to finish the flow and it worked 💙


if (creditCard.value !== null) {
try {
const response: { id: string } = await creditCard.value.createResource();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

}

onBeforeMount(() => {
useHead({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attaching the unzer.js script is too lazy. It's not being loaded in the test env: https://stackblitz.com/edit/github-c9t5on?file=nuxt.config.ts (backend is temporary, we can talk about it in DM later on)

it causes the error in here: https://github.com/shopware/frontends/pull/671/files#diff-a73f8d424b5c2834bf69de34a0cd276893eb9a66a9a84ef96553079f816ab0e1R49

I can see two solutions for that:

  • I would wrap useHead things in a function and export it in the composable to be used directly in the setup function of the component - then run it in onBeforeMount lifecycle hook in a component.
  • use a plugin (server + client) to register a script for specific page, in client plugin initialize the unzer instance

wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
composables documentation Improvements or additions to documentation
Projects
Status: Developer Backlog
Development

Successfully merging this pull request may close these issues.

3 participants