Skip to content

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

Open
@dayhaysoos

Description

@dayhaysoos

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions