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

Supporting "Custom" configuration for <CartProvider /> #264

Open
dayhaysoos opened this issue Jan 17, 2022 · 2 comments
Open

Supporting "Custom" configuration for <CartProvider /> #264

dayhaysoos opened this issue Jan 17, 2022 · 2 comments

Comments

@dayhaysoos
Copy link
Owner

Overview

Not all countries are able to use Stripe, however, users would like to take advantage of the shopping cart state and logic that USC provides. Right now, there are Stripe values that are required in the current set up.

Goal

It would be ideal to pass a "custom" prop to the CartProvider that makes it so that no config is required at all.

Approach

As of right now, there is a ClientOnly config and a CustomCheckout config. They each share a "Common Config" which is where the Stripe values are required:

interface CheckoutSessionConfig extends CommonConfig {

We would need a "CustomConfig" that requires only one prop: currency

It's needed for adding items to the cart and creating total values for display. I don't think it would be a good idea to leave currency out of it.

Possibilities

Perhaps users may want to take advantage of using props that DO get passed to the CartProvider. Was wondering if it would be a good idea to make a useCustomProps hook to do this.

Providing Feedback

Feel free to comment here with any issues/concerns!

@LarsBuur
Copy link

Given we are removing stripe most people will need a way to do some form of gathering customer info and maybe using a different payment gateway. Besides currency we should add a prop called checkoutUrl.

Let´s add the useCustomProps hook once we have a basic CartProvider working without stripe.

@dayhaysoos
Copy link
Owner Author

Sounds good! Do you want me to assign this to you btw?

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

No branches or pull requests

2 participants