WICG / digital-goods

Other
50 stars 28 forks source link

Clarify how to deal with devices/contexts where DGAPI is not supported #30

Open phoglenix opened 3 years ago

phoglenix commented 3 years ago

Asked by @toniengelhardt:

How do we handle purchases on devices that do not support the Digital Goods API, e.g. devices that do not use Chrome as default browser or a Chrome version that does not support the Digital Goods API? Is it PlayStore T&C conform to implement the Digtial Goods API and use it if the device supports it and otherwise fallback to an alternative payment provider, e.g. Stripe? If not, are there any solutions for this scenario?

phoglenix commented 3 years ago

I've updated the first code snippet in the explainer to clarify the code side of this a bit. The very first step of using the API is to detect if it's available in the current browser/context. If it's not available then you would need to use an alternative payment provider.

I believe that Play would require a site to use the DGAPI whenever it is available (please check with Play - I can't give advice on their T&C). Currently, for sites enrolled in the DGAPI Origin Trial, the DGAPI is available with the Play Billing service URL iff the current site is installed from the Play Store.

Perhaps we should make something more explicit in the API, eg. (please forgive naming and half-baked idea): DigitalGoodsService::isThisClientRequiredToUseThisService() -> bool For a digital goods service from the Play Billing service URL, this method would always return true (because otherwise the service would be unavailable and you wouldn't have a DigitalGoodsService object to call the method).

Does that clarify things? Should I add some of this to the explainer?

toniengelhardt commented 3 years ago

Thanks for following up @phoglenix! I think the implementation is fine, my question really was more on the policy side. I'll get in touch with Play folks directly to clarify.

Thanks a lot!