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

Create REST API endpoints for main features (OCC-253) #450

Closed
wAsnk opened this issue May 22, 2024 · 3 comments · Fixed by #455
Closed

Create REST API endpoints for main features (OCC-253) #450

wAsnk opened this issue May 22, 2024 · 3 comments · Fixed by #455
Labels
enhancement New feature or request

Comments

@wAsnk
Copy link
Contributor

wAsnk commented May 22, 2024

Currently, there is no way to control shopping cart, checkout through an ApiController, REST API endpoint.

What's missing:

  1. Shopping cart:
  • Get shopping cart
  • Add item
  • Remove item
  • Update line item, or shopping cart update
  1. Checkout process

Jira issue

@wAsnk wAsnk added the enhancement New feature or request label May 22, 2024
@github-actions github-actions bot changed the title Create REST API endpoints for main features Create REST API endpoints for main features (OCC-253) May 22, 2024
@Piedone
Copy link
Member

Piedone commented May 22, 2024

Maybe not with an ApiControllet but a potentially more efficient minimal API endpoint, see e.g. https://github.com/OrchardCMS/OrchardCore/tree/main/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api. See rationale and metrics: OrchardCMS/OrchardCore#15294.

@infofromca
Copy link
Contributor

infofromca commented May 28, 2024

Hi : any update by somebody?
for shopping cart ,( or add Item) , I think we need User info. ( for ex. user token) for the api.
currently, we use user session for the shopping cart , is it ok for multi-instances of OC or the client app?
what is your opinion?

BY THE WAY, IT SEEMS THAT WE DID NOT USE shoppingCartId in whole project

@sarahelsaig
Copy link
Contributor

Hi : any update by somebody?

Not yet. We will certainly do this eventually. But in the meantime if you want to contribute (even partially) or make further suggestions here, that's also welcome.

for shopping cart ,( or add Item) , I think we need User info. ( for ex. user token) for the api. currently, we use user session for the shopping cart , is it ok for multi-instances of OC or the client app?

There should be an OpenID Connect or JWT bearer token which is required to connect (see info about AuthenticationSchemes in ASP.NET Core docs). OC's OpenID Server module can provide either type. This is not related to the shopping cart ID, which is optional. But you make a good point about the session storage, connecting through API will likely require a different IShoppingCartPersistence implementation.

BY THE WAY, IT SEEMS THAT WE DID NOT USE shoppingCartId in whole project

I think we only don't use it in specific payment provider implementations that don't support multiple shopping carts. If you find it missing somewhere else too, please point it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants