tiki-archive / integrations

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

Save the current discount id to the user metafields upon Payable creation #122

Closed ricardobrg closed 1 year ago

ricardobrg commented 1 year ago

As a customer, I want that my discount is saved when accepting an offer so that I can get it when I buy something.

After the creation of the License, a Payable should be created with the discount ID as a reference and our API should be called to register that the user is allowed to use that discount.

This is going to be an unauthenticated request for now, but needs to be replaced by the authenticated one before merging.

ricardobrg commented 1 year ago

This is done by saving static data to the License, Payable, and making a request to the Postman echo, instead of the backend.

After tiki/tiki-shopify#6 the static data can be replaced by the app meta fields data and the /customer/discount endpoint will replace the Postman echo endpoint. which should be done in tiki/integrations#131.

ricardobrg commented 1 year ago

Waiting on https://github.com/tiki/tiki-sdk-js/issues/100 for testing

ricardobrg commented 1 year ago

Created the Title, License and Payable registries and prepared the request object in tiki/integrations#132

ricardobrg commented 1 year ago

The JavaScript part of the code is done. tiki/tiki-shopify#9 will deal with the saving in the backend.