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

Web examples #416

Draft
wants to merge 749 commits into
base: main
Choose a base branch
from
Draft

Web examples #416

wants to merge 749 commits into from

Conversation

nicktaras
Copy link
Contributor

@nicktaras nicktaras commented Jan 11, 2021

Hi @oleggrib

This is my latest update towards merging our work together.

I've added what I understand to the be the steps we should apply to create the hotel demo. Let's review and go from there.

zhangzhongnan928 and others added 30 commits October 4, 2019 14:06
correctly reference tokenscript.xsd in schemaLocation
…me. Plus the new thing we discussed last week: data-objects
…fore Thursday meeting and published after (with links to the result of discussion)
…oc can work with svg (if rsvg-convert is installed). also fix some typo
first sprint of UEFA tsml ticket
Weiwu Zhang and others added 23 commits October 20, 2020 16:52
as we couldn't get the validator to work with the new <assert> statement
documented here
#395
…edDevonTicket.jsto work with this polyfill library.
… a string inside the react component instead.
@nicktaras nicktaras requested a review from oleggrib January 11, 2021 08:43
@oleggrib
Copy link
Contributor

Hi, Nick.

Let me describe updated logic

  1. init negotiator with filter
    Negotiator({ "ticketClass": "VIP"});
  2. ask for tokens
    negotiator.negotiate().then((tickets) => {
    this.sendBackendRequestToRerenderProductsAndDiscounts(tickets)
    })
  3. If user click "useTicket" then webster run
    const useDevconTicket = await Authenticator.getAuthenticationBlob({ ticket });
    // webster sign useDevconTicket with metamask and send it to the smartContract
    const signedTicket = await Authenticator.signToken(useDevconTicket);
    // for bogota example: I will add Authenticator method to sign ticket with Metamask and return result object. and you can send that object to the backend for autorization+dicounted checkout.
    const = this.backendRequestForCheckoutWithDiscount(product, signedTicket);
    // backend can authorize user based on useDevconTicket signature. also backend have to compare user address in authorization and user signature. it should fit.

Lets download products list JSON (not import), because download JSON is similar to download rendered product list from server.

Lets add few JSONS to simulate different discounts. Like roomTypesDataMock_ticketClass_2.json, roomTypesDataMock_ticketClass_2-3.json

Also we can extend example to show checkout page based on signed ticket. (we can add few JSONs for that too)

@oleggrib
Copy link
Contributor

I have added sample backend https://bogotabackend.herokuapp.com/
"/" GET will answer with products JSON
"/" POST send serialized tickets list and it will answer with updated products
POST body: tickets:[{"devconId":"6n","ticketId":"48646n","ticketClass":"0n"}]

its nodejs server app, so we can add cone to validate ticket/attestation too.

@SmartLayer SmartLayer force-pushed the main branch 2 times, most recently from e54d791 to 1368554 Compare June 30, 2023 10:50
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

Successfully merging this pull request may close these issues.

8 participants