bigcommerce / subscription-foundation

Foundation for building custom subscription applications w/ BigCommerce
MIT License
11 stars 42 forks source link

stripe customer ID is hardcoded to 1 #27

Closed kesarweb closed 1 year ago

kesarweb commented 1 year ago

image

huntario commented 1 year ago

Hunter, with BigCommerce here again.

The BigCommerce APIs have an entity called Customer Attributes - https://developer.bigcommerce.com/docs/rest-management/customers/customer-attributes#get-all-customer-attributes

The attribute keys are recorded separate from the customer. These keys can then be assigned specific values for a specific customer. When the app installs, it will create a customer attribute. This attribute will have a storewide ID, and each customer will have a unique value.

This storewide attribute ID is stored in the store’s row within the Store table. See the screenshot to see how this value is then placed within the script. This will not always be 1, but will be the ID of the customer attribute created on installation.

Screenshot 2023-06-28 at 8 53 07 PM