New methods signature convention #1876
Replies: 2 comments
-
I think this the best option
Nicely separated, there are no common fields really other than sku between Here is my reasoning:
Let me know of your thoughs |
Beta Was this translation helpful? Give feedback.
-
Yep, looks good to me for splitting the sku/skus 👍 To be consistent I would rename either Edit: Thinking about it, would make more sense to have
3/4. Correct! I already did that in here but I'm splitting the PR in smaller ones to make it easier to review |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
To continue the discussion we started here, we are wondering how to refactor methods parameters, and deal with specific platforms props.
1. Flatten shared properties + objects for platform specific
2. Only per-platform parameters
Another "issue" would be to deal with methods that take same argument, but either as a single value, or as an array. For example the following method:
either:
or
@andresesfm also suggested something like this:
But that would imho make validation more complicated to handle both type of signature and some overhead to adapt that on all methods.
The second question is how to name those platform specific-objects? The approach we like is to name them by their payment provider
appStore
,playStore
,amazon
?To summarise, and to give my preference, I think the "nicest" approach would be the following:
requestSubscription example:
getProducts example:
requestPurchase example:
What do you folks think?
cc/ @andresesfm @hyochan
Beta Was this translation helpful? Give feedback.
All reactions