giantmonkey / gomus-components-doc

https://giantmonkey.github.io/gomus-components-doc/
1 stars 0 forks source link

Docs: CheckoutComponent #4

Closed Markus-MfN closed 5 years ago

Markus-MfN commented 6 years ago

Related page: CheckoutComponent

Could you please give a general description of the checkout process and how to implement it?

As far as I understand it by now, it works like this:

(1) Implement the "CheckoutComponent" on its own page (e. g. checkout.html), let "CartComponent" link to it:

<go-cart options='{"action": {"mode": "url", "url": "checkout.html"}}'></go-cart>

(2) On checkout.html:

` <ng-template #goCheckoutSuccess let-item>

Ihr Einkauf war erfolgreich!!

<p>Ihre Bestellbestätigung und Rechnung wurden per E-Mail an Sie geschickt.</p>
<button go-checkout-success-action>Weiter Einkaufen</button>

<ng-template #goCheckoutPending let-item>

Der Status der Bezahlung ist noch schwebend...

<ng-template #goCheckoutFailure let-item>

Ihr Einkauf war nicht erfolgreich!!

<button go-checkout-failure-action>Zurück zum Warenkorb</button>

`

(3) You need to be informed about the <Payment-Service-Provider-URL> , so you can configure the redirecting of the payment service provider's answers to the corresponding state of the "CheckoutComponent" .

Thanks!

douglasward commented 6 years ago

Hi Markus, yes that's nearly right.

(2) On checkout.html:

Here the user_url should be for the page where the user can login/register etc. To proceed with the checkout the user has to be logged in, so if he/she is not the components will redirect the user to the login section, and then redirect the user back to the checkout process once they are logged in.

(3) You need to be informed about the

Yes, when you have a payment provider we would need to be informed so we can set up the tokens and redirects in the backend, or in a staging/test environment we can set it up to skip this part.

We also need to know the chosen checkout and cart URL, so we can correctly redirect on checkout success/failure and on cancel etc.

Hope this helps to clear up any confusion. Let me know if you have any further questions.

Markus-MfN commented 6 years ago

Thank you. I did not know that being logged in is required. It would be helpful if you could describe registration. Is the data send to the staging instance and stored there?

Does the demo in the documentation work?

Markus-MfN commented 6 years ago

OK, demo works. It just took some time until the confirmation mail arrived. But more information about registration is still needed.

douglasward commented 6 years ago

Is the data send to the staging instance and stored there?

Yes, the data is always stored in the instance you are talking to: demo/staging/production.

What other information do you need to know? The user processes are quite a large topic. If it isn't component specific it might be better to speak to your assigned project manager about it, but otherwise I am happy to answer any questions you have here.

Markus-MfN commented 6 years ago

Thanks, I guess with this information I can go on. Specific questions will probably arise as soon as I start to make the registration work in my test installation.

Markus-MfN commented 6 years ago

OK, the UserComponent is showing the forms. I'm on my local machine and there is a staging instance I'm talking to, which is working.

(1) Clicking on "register" or "login" won't work in this environment because at this point I already need to tell the staging instance a public URL? Even before talking to a payment provider?

(2) Can I configure this and/or redirection myself in the staging instance? If yes, how?

douglasward commented 6 years ago

(1) Clicking on "register" or "login" won't work in this environment because at this point I already need to tell the staging instance a public URL? Even before talking to a payment provider?

It is possible to log in, and register - the redirects however will not work. You need to set the shop_domain in the _gomusOptions to shop-staging.naturkundemuseum.berlin. Then click on the confirmation link in the email, and after the registration redirect you could change the host in the URL back to http and localhost.

I just put the staging instance in demo mode for payments, so you shouldn't need to configure a payment provider at this point.

Can I configure this and/or redirection myself in the staging instance? If yes, how?

Yes the redirection urls you can configure under Stammdaten > Shops. Then you can edit the "default" shop. The Shop test url domain is the redirect domain you need, and this has to be the same as the shop_domain value in _gomusOptions.

Hope this helps.

Markus-MfN commented 6 years ago

You need to set the shop_domain in the _gomusOptions to shop-staging.naturkundemuseum.berlin.

This means that shop_domain and domain will not be the same. Correct? After clicking on "Register" I should be redirected to the staging instance? Does not work.

Markus-MfN commented 6 years ago

OK, clients are added in the staging instance, but the system is not sending out e-mails. So confirmation is not possible. Anything else to be configured in the staging instance?

douglasward commented 6 years ago

This means that shop_domain and domain will not be the same. Correct?

Correct. domain is the go\~mus domain to which the shop talks to, and shop_domain is the domain that the shop is using, used by go\~mus to identify which shop it is talking with.

After clicking on "Register" I should be redirected to the staging instance? Does not work.

What does not work? I would need a few more details here.

but the system is not sending out e-mails

I just tried and received an email with a confirmation link. I have seen that you have successfully registered a few times, but only a couple of users are confirmed - all of which have invalid email addresses. I'm guessing you confirmed these over the go~mus interface? I have also checked the email queue and it is empty, so you should also have received an email confirmation for the accounts with a valid email address.

If not, then let me know. No further configuration is needed at the moment in the staging instance.

Markus-MfN commented 6 years ago

What does not work? I would need a few more details here.

Being redirected to the instance does not work, if that's what's intended. But I might be able to configure this myself by setting the correct URLs for redirecting.

I have seen that you have successfully registered a few times, but only a couple of users are confirmed - all of which have invalid email addresses.

All e-mail addresses were valid in the first place. Because I did not receive a confirmation request e-mail, I changed the addresses later to be able to try again being not able to delete clients (I just have one valid e-mail address). Just tried again and the confirmation process is working now, e-mails are being send. This did not work on Friday. For one account I registered on Friday ("Arne Banane") I received the confimation mail yesterday.

douglasward commented 6 years ago

Being redirected to the instance does not work, if that's what's intended. But I might be able to configure this myself by setting the correct URLs for redirecting.

Just to make sure we are talking about the same thing, as per default there are 2 redirects:

  1. after the user fills in the registration form and clicks register, the user is redirected to a confirmation page. This is defined in the action option in the component itself and is used to let the user know that he needs to click on the confirmation link in the email.
  2. after receiving the email, the user clicks on the confirmation link. This is defined in the shop settings in go~mus UI. It is made up of the shop domain and the "Confirmation link".

Both redirects work if properly defined.

I received the confimation mail yesterday

Glad to hear the email has arrived.

Markus-MfN commented 6 years ago

(1) On my local system (just html pages) I'm able to checkout and receive e-mails. Today I integrated everything in the Drupal system on the server. Talking to the instance works fine, I can log in etc. But checkout does not work. Do I have to change "Shop-Test-URL" in the go~mus staging instance and "shop_domain" in the Components to the Domain of the system on the server? I tried, but it still did not work. What is missing or do you have to configure something?

(2) To make integration into Drupal easier I put the script tags inside the html body. Works fine. Is this OK or should they be inside the html header?

Thanks!

douglasward commented 6 years ago

(1) What does checkout does not work mean? Can you be a bit more specific? Or can I use your test website to reproduce the error?

I can see that you managed to create a successful order in the staging instance at 17:17 on Friday, so you must have done something right. The "Shop-Test-URL" at the moment is configured to **, if this is the domain of you test website then this is correct. The "shop_domain" should match this.

At the moment the success link in the shop configuration in the staging go\~mus instance is empty. This would lead to go\~mus redirecting to the ** on checkout success. Maybe this is causing some confusion? Feel free to update the shop config, or let me know the correct path and I can do so.

(2) If it works fine, then there is no problem in putting them inside the html body.

Markus-MfN commented 6 years ago

(1) "Does not work" means that after clicking on the submit button of the cart component nothing happens (no order created, no e-mails sent).

The successful order was created from my local system, not from the test site.

Does the page containing the checkout component have to have a specific path. At the moment it has the same path as the other pages (cart etc). As far as I can see there is no way of telling the cart compoment a checkout URL.

Could you please remove the URL of our test site from your comment. Thanks you.

douglasward commented 6 years ago

In order to create an order the CheckoutComponent is needed.

It would be best if you create a new page with this component on it, and then specify the url to this page in the CartComponent options.

<go-cart options='{"action": {"mode": "url", "url": "<url-of-checkout-component>"}}'></go-cart>

Currently you have the tickets-gomus path entered there, which is why when you click the "kostenpflichtig bestellen" button the page just reloads and no order is created:

Markus-MfN commented 6 years ago

Thanks, now the checkout component is found.

Markus-MfN commented 6 years ago

(1) How do I tell the CheckoutComponent where to go if the user is not logged in? This leads to the default URL /user: <go-checkout options='{"action": {"user_url": "<url-of-user-component>"}}'></go-checkout>

Markus-MfN commented 6 years ago

(2) How do I tell the system to go back to the test site after the user clicks on the confirmation link in the account confirmation mail? I can set a specific page with Confirmation link in the staging instance, but even if I set shop url to the test domain, the domain of the production site is chosen.

douglasward commented 6 years ago

(1) the user_url is in the main CheckoutOptions object, not in an action child object. This is because the user doesn't take the action himself (eg. by clicking) it happens automatically.

(2) the redirect is working as expected. go~mus however always uses https, which I believe your test website is not set up for, thus a redirect happens somewhere on your end to the main website.

Markus-MfN commented 6 years ago

Thank you, Douglas. Guest checkout is working now. I will look into (2)

I started to set up an English version today. Are the standard buttons available in English? I changed locale in _gomusOptions everywhere in my English versions, but only the language of the calender in the TicketsComponent changes to English.

douglasward commented 6 years ago

Hi Markus, great to hear the checkout is now working.

The locale property in _gomusOptions defines the locale to be used when talking to go\~mus - so all of the "dynamic" text. To change the language of the text in the default html elements you need to use custom templates and define the text in the language you need directly in the template.

Markus-MfN commented 6 years ago

How do you configure the URLs for the buttons the CheckoutComponent renders? For example "Weiter Einkaufen" (#/?checkout=success) or "Zurück zum Warenkorb" (#/?checkout=failure).

maxseeger commented 6 years ago

Hallo Markus, Douglas ist bis zum 7.8. im Urlaub, danach wird er dir auf deine Anfrage antworten können.

Markus-MfN commented 6 years ago

No answer necessary. Just found it out myself.

Markus-MfN commented 6 years ago

I don't know how to configure the URLs correctly for (1) registration confirmation e-mail (2) password reset e-mail (which component do I have to use?).

Please have a look at the staging instance to see my URLs for "Confirmation link" and "Password reset link" which are not working. Both URLs lead to "Shop test url"/?.

Markus-MfN commented 6 years ago

(1) Redirecting to a page specified on the shop configuration page in the staging instance does work now. The problem was that I first used the page with the UserProfileComponent and expected to land on the page as a logged-in user. Because confirmation does not log you in, the component does a redirection to the shop domain. Still think that being logged-in after clicking on the confirmation link in the email, would be more intuitive for the user because he could start shopping immediatley and would not have to log in first.

(2) Still don't know to which component I have to redirect to. Thought it would be the UserNewPasswordComponent, but it does not know the user. Please have a look at the new issue opened on theUserNewPasswordComponent.

Markus-MfN commented 6 years ago

(2) Answered and closed.

(1) Still open.

douglasward commented 6 years ago

(1) I added #/ to the url in the shop settings. Now the user is logged in after clicking on the confirmation link.

Markus-MfN commented 5 years ago

Thank you, this has done the trick.