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

Address form for paper products #472

Open
vapaj opened this issue Nov 26, 2020 · 0 comments
Open

Address form for paper products #472

vapaj opened this issue Nov 26, 2020 · 0 comments
Labels

Comments

@vapaj
Copy link
Contributor

vapaj commented Nov 26, 2020

In order to support paper products, we need to know the first name, last name and address of the customer. We should add this step after we register the new customer (or login an existing customer) but before we create any payments to Nets (if/when credit card is used).

When creating an order to Bottega (POST /order), the server will return an descriptive error message if it was unable to perform the wanted action due to missing account details. If we encounter this HTTP error, we should render the address form. What the HTTP error actually looks like is not yet decided 🤠

We should parse the error here https://github.com/KSF-Media/affresco/blob/master/packages/vetrina/src/Vetrina/Vetrina.purs#L465-L477 and add an approriate constructor for the OrderFailure type (perhaps called InsufficientAccount). We should set the state.purchaseState to PurchaseFailed InsufficientAccount here whenever this error occurs.

After the account has been updated, we should run the same POST /order call which previously failed and follow the normal flow.

@vapaj vapaj added the vetrina label Nov 26, 2020
@vapaj vapaj closed this as completed Jun 30, 2021
@vapaj vapaj reopened this Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant