@@ -73,6 +73,7 @@ spec: web-authn; urlPrefix: https://w3c.github.io/webauthn/
73
73
text: authentication extension; url: authentication-extension
74
74
text: extension identifier; url: extension-identifier
75
75
text: user member; url: dom-publickeycredentialcreationoptions-user
76
+ text: user-verifying platform authenticator; url: user-verifying-platform-authenticator
76
77
77
78
spec: webdriver; urlPrefix: https://w3c.github.io/webdriver/
78
79
type: dfn
@@ -365,7 +366,7 @@ presumes access to await/async, for easier to read promise handling.
365
366
const spcAvailable =
366
367
PaymentRequest &&
367
368
PaymentRequest.isSecurePaymentConfirmationAvailable &&
368
- await PaymentRequest.isSecurePaymentConfirmationAvailable();
369
+ ( await PaymentRequest.isSecurePaymentConfirmationAvailable()) === 'available' ;
369
370
if (!spcAvailable) {
370
371
/* Browser does not support SPC; merchant should fallback to traditional flows. */
371
372
}
@@ -658,15 +659,51 @@ A static API is added to {{PaymentRequest}} in order to provide developers a
658
659
simplified method of checking whether Secure Payment Confirmation is available.
659
660
660
661
<xmp class="idl">
662
+ enum IsSecurePaymentConfirmationAvailableResult {
663
+ "available",
664
+ "unavailable-unknown-reason",
665
+ "unavailable-feature-not-enabled",
666
+ "unavailable-no-permission-policy",
667
+ "unavailable-no-user-verifying-platform-authenticator",
668
+ };
669
+
661
670
partial interface PaymentRequest {
662
- static Promise<boolean > isSecurePaymentConfirmationAvailable();
671
+ static Promise<IsSecurePaymentConfirmationAvailableResult > isSecurePaymentConfirmationAvailable();
663
672
};
664
673
</xmp>
665
674
<dl dfn-type="attribute" dfn-for="PaymentRequest">
666
675
: {{PaymentRequest/isSecurePaymentConfirmationAvailable()}}
667
- :: Upon invocation, a promise is returned that resolves with a value of
668
- `true` if the Secure Payment Confirmation feature is available, or
669
- `false` otherwise.
676
+ :: Upon invocation, a promise is returned that resolves with one of the
677
+ members of {{IsSecurePaymentConfirmationAvailableResult}} , based on the
678
+ current availability of the Secure Payment Confirmation feature.
679
+ </dl>
680
+ <dl dfn-type="enum-value" dfn-for="IsSecurePaymentConfirmationAvailableResult">
681
+ : <dfn>available</dfn>
682
+ :: Indicates that the user agent believes that the Secure Payment
683
+ Confirmation API is available in the calling frame.
684
+
685
+ Note: This result does not indicate whether or not any particular [=SPC
686
+ credential=] is or will be available.
687
+
688
+ : <dfn>unavailable-unknown-reason</dfn>
689
+ :: Indicates that the Secure Payment Confirmation API is not avaiable in
690
+ the calling frame, for an unknown reason. A user agent MAY always choose
691
+ to return this result instead of a more specific reason, in order to
692
+ protect user privacy.
693
+
694
+ : <dfn>unavailable-feature-not-enabled</dfn>
695
+ :: Indicates that the Secure Payment Confirmation API is not available in
696
+ the calling frame, because the feature is not enabled.
697
+
698
+ : <dfn>unavailable-no-permission-policy</dfn>
699
+ :: Indicates that the Secure Payment Confirmation API is not available in
700
+ the calling frame, because the frame lacks the "[=payment permission
701
+ string|payment=] " permission policy.
702
+
703
+ : <dfn>unavailable-no-user-verifying-platform-authenticator</dfn>
704
+ :: Indicates that the Secure Payment Confirmation API is not available in
705
+ the calling frame, because there is no [=user-verifying platform
706
+ authenticator=] available.
670
707
</dl>
671
708
672
709
This allows a developer to perform the following check when deciding whether to
@@ -676,13 +713,16 @@ initiate a SPC flow:
676
713
const spcAvailable =
677
714
PaymentRequest &&
678
715
PaymentRequest.isSecurePaymentConfirmationAvailable &&
679
- await PaymentRequest.isSecurePaymentConfirmationAvailable();
716
+ await PaymentRequest.isSecurePaymentConfirmationAvailable() === 'available' ;
680
717
</pre>
681
718
682
719
NOTE: The use of the static {{PaymentRequest/isSecurePaymentConfirmationAvailable}} method is recommended for
683
720
SPC feature detection, instead of calling {{PaymentRequest/canMakePayment}} on an already-constructed
684
721
PaymentRequest object.
685
722
723
+ Note: For privacy considerations of this API, see
724
+ [[#sctn-fingerprinting-via-is-secure-payment-confirmation-available]] .
725
+
686
726
### Steps to validate payment method data ### {#sctn-steps-to-validate-payment-method-data}
687
727
688
728
The [=steps to validate payment method data=] for this payment method, for an
@@ -1548,6 +1588,40 @@ they are strong, cross-site identifiers. However in order to obtain them from
1548
1588
the [=Relying Party=] , the merchant already needs an as-strong identifier to
1549
1589
give to the [=Relying Party=] (e.g., the credit card number).
1550
1590
1591
+ ## Fingerprinting via isSecurePaymentConfirmationAvailable ## {#sctn-fingerprinting-via-is-secure-payment-confirmation-available}
1592
+
1593
+ The {{isSecurePaymentConfirmationAvailable}} API presents a possible
1594
+ fingerprinting risk, as it can silently return specific reasons that the
1595
+ Secure Payment Confirmation API is not available for a specific frame. These
1596
+ reasons are not believed to leak significant information, but should be
1597
+ considered:
1598
+
1599
+ - {{IsSecurePaymentConfirmationAvailableResult/unavailable-feature-not-enabled}} :
1600
+ some risk of fingerprinting, depending on under what circumstances the user
1601
+ agent considers Secure Payment Confirmation to be available or not. User
1602
+ agents are encouraged to make Secure Payment Confirmation available to all
1603
+ users (if implementing the specification), or at least to significantly
1604
+ sized groups such that no (additional) fingerprinting is possible. For
1605
+ example, a user agent may ship Secure Payment Confirmation to all users on
1606
+ a given OS but not others - this then reduces the fingerprinting risk to
1607
+ no more than the user agent string already reveals.
1608
+ - {{IsSecurePaymentConfirmationAvailableResult/unavailable-no-permission-policy}} :
1609
+ no (additional) fingerprinting risk, as the "[=payment permission
1610
+ string|payment=] " permission policy is already silently detectable by
1611
+ attempting to construct a {{PaymentRequest}} object (construction will throw
1612
+ an error if the permission policy is not enabled).
1613
+ - {{IsSecurePaymentConfirmationAvailableResult/unavailable-no-user-verifying-platform-authenticator}} :
1614
+ no (additional) fingerprinting risk over the existing
1615
+ {{PublicKeyCredential/isUserVerifyingPlatformAuthenticatorAvailable}} API.
1616
+
1617
+ In addition to the above considerations, this specification allows a user agent
1618
+ to choose to return
1619
+ {{IsSecurePaymentConfirmationAvailableResult/unavailable-unknown-reason}} even
1620
+ when a specific reason is known, should it wish to in order to preserve user
1621
+ privacy. This might be done in the case, e.g., that a user agent has detected
1622
+ that the current frame has already accessed other APIs that pose a
1623
+ fingerprinting risk.
1624
+
1551
1625
## User opt out ## {#sctn-user-opt-out}
1552
1626
1553
1627
The API option {{SecurePaymentConfirmationRequest/showOptOut}} tells the
0 commit comments