tiki-deprecated / integrations

A collection of example implementations
MIT License
1 stars 1 forks source link

Save the Shopify discount information #84

Closed ricardobrg closed 1 year ago

ricardobrg commented 1 year ago

This issue scope changed. See https://github.com/tiki/integrations/issues/84#issuecomment-1589484579.

When the user accepts the license, a new License is created. With the License's ID, we make a Payable through TIKI SDK JS to store the discount information.

The values for this Payable creation should be added in the app-theme-block:

These values are passed to the TIKI_SETTINGS js object. On license acceptance, the License is used to create a payable:

Update the discount function to use these values instead of the hard-coded ones, defined in #76.

ricardobrg commented 1 year ago

The amount, expiry and type will come from the discount configuration. Using fixed values for now. The description will be the same from the offer license as a placeholder. It should be changed later for something that could be edited (maybe in the discounts interface?)

ricardobrg commented 1 year ago

The scope of this changed. We are now using the UIs created in #90 #91 for discount settings.

It should be saved as a new Shopify discount. In #76 it should grab the discount information and apply it.

The payable will hold the discount gid that should be used in the discount function to check if the discount should be applied

ricardobrg commented 1 year ago

The discount information is saved by posting it the /api/latest/discount endpoint.

We don't need to use 2 different UIs for the product/order discounts. It could be just one, with a switcher, and this information should be saved in the discount options object. #109 will handle this

ricardobrg commented 1 year ago

Taking back the change in the UIs, in #111 I am updating the UIs to follow Shopify, with 2 pages for order and product discounts.

mike-audi commented 1 year ago

This will be refactored to be consistent with both the standard Oauth2.0 spec and the Shopify's token security pattern of decoupling session tokens from access token in #113. Merge as is.