You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebKit is interested in adding something along these lines.
For Apple Pay specifically, we require that a unsigned long version is provided as part of the object data in PaymentMethodData that corresponds to the desired supported Apple Pay version. Currently, we suggest that developers use ApplePaySession.supportsVersion to check if the desired feature (more specifically the related first version to include that feature) is supported before attempting to do anything with payments (including showing UI). We'd love for there to be a standardized approach for this :)
Along these lines, would hasEnrolledInstrument just result in false or reject with an explanatory error if the value provided for object data in PaymentMethodData (or a PaymentDetailsModifier) has issues? As an example, if a developer specified a total with a negative value in its amount and then called hasEnrolledInstrument, what would happen? What about if, using the Apple Pay example above, a developer specified version: 999? I ask because it would be nice to have some way of distinguishing between the data provided being invalid (e.g. the Promise is rejected with something like "total cannot be negative") and the data provided being unsupported (e.g. the Promise resolves with false).
WebKit is interested in adding something along these lines.
For Apple Pay specifically, we require that a
unsigned long version
is provided as part of theobject data
inPaymentMethodData
that corresponds to the desired supported Apple Pay version. Currently, we suggest that developers useApplePaySession.supportsVersion
to check if the desired feature (more specifically the related first version to include that feature) is supported before attempting to do anything with payments (including showing UI). We'd love for there to be a standardized approach for this :)Along these lines, would
hasEnrolledInstrument
just result infalse
or reject with an explanatory error if the value provided forobject data
inPaymentMethodData
(or aPaymentDetailsModifier
) has issues? As an example, if a developer specified atotal
with a negativevalue
in itsamount
and then calledhasEnrolledInstrument
, what would happen? What about if, using the Apple Pay example above, a developer specifiedversion: 999
? I ask because it would be nice to have some way of distinguishing between the data provided being invalid (e.g. thePromise
is rejected with something like "total
cannot be negative") and the data provided being unsupported (e.g. thePromise
resolves withfalse
).Originally posted by @dcrousso in #931 (comment)
The text was updated successfully, but these errors were encountered: