moltin / ios-sdk

Swift SDK for the Moltin eCommerce API
https://moltin.github.io/ios-sdk
MIT License
37 stars 18 forks source link

Custom cart items #46

Closed gje4 closed 5 years ago

gje4 commented 5 years ago

Allows the user to follow the docs and pass a custom object that represents a product. It is up to the user to follow the docs to make sure the payload has all of the required data.

This is unlike other moltin objects as it is meant to give the user freedom to pass through their needed data, ie shipping and other add ons.

Do not think should remove CustomCartItem yet

Status

Notes

Do not think should remove CustomCartItem yet

craigtweedy commented 5 years ago

Hey George! 👋

Good spot on CustomCartItem not being fully fleshed out.

[String: any] I guess would work and make it pretty flexible, but would lose any type safety we have for adding new items to the cart ahead of time. What's required on a custom cart item for it to be useful? Assuming name, description, price? Could those be added to the class instead?

Could also end up simplifying that buildCustomItem method by having something like a toDictionary() on the CustomCartItem. Spitballin' there.