<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.25 (Ruby 3.1.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ozdemir-gnap-spc-extension-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.16.0 -->
  <front>
    <title>GNAP Secure Payment Confirmation Extension</title>
    <seriesInfo name="Internet-Draft" value="draft-ozdemir-gnap-spc-extension-00"/>
    <author fullname="Omer Talha Ozdemir">
      <organization>Fynbos</organization>
      <address>
        <email>omer@fynbos.dev</email>
      </address>
    </author>
    <author fullname="Adrian Hope-Bailie">
      <organization>Fynbos</organization>
      <address>
        <email>adrian@fynbos.dev</email>
      </address>
    </author>
    <date year="2023" month="March" day="13"/>
    <area>Security</area>
    <workgroup>Grant Negotiation and Authorization Protocol</workgroup>
    <keyword>gnap</keyword>
    <keyword>secure payment confirmation</keyword>
    <keyword>extension</keyword>
    <abstract>
      <t>GNAP Secure Payment Confirmation (SPC) Extension is a Grant Negotiation and Authorization Protocol (<xref target="GNAP"/>) extension that defines a method for authentication of the end user during a payment transaction. This extension helps leverage hardware and software authenticators such as biometric scanners while authenticating the end user.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://fynbos-dev.github.io/gnap-spc-extension/draft-ozdemir-gnap-spc-extension.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ozdemir-gnap-spc-extension/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/fynbos-dev/gnap-spc-extension"/>.</t>
    </note>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>GNAP Secure Payment Confirmation Extension is an extension developed on top of the Grant Negotiation and Agreement Protocol <xref target="GNAP"/>. It defines a method for authentication of the end user during a payment transaction using Secure Payment Confirmation (<xref target="SPC"/>). This extension helps leverage authenticators such as fingerprint scanners, facial recognition systems, etc. while authenticating during a GNAP interaction.</t>
      <t>Secure Payment Confirmation (<xref target="SPC"/>) is a Web Platform API implemented in Web browsers which allows a website to invoke <xref target="WebAuthn"/> to both authenticate the end user and confirm the details of the payment during a payment transaction.</t>
      <t>A method for detecting this capability in the client software is provided in <xref target="detect-spc"/>.</t>
      <section anchor="conventions-and-definitions">
        <name>Conventions and Definitions</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      </section>
    </section>
    <section anchor="secure-payment-confirmation-interaction">
      <name>Secure Payment Confirmation Interaction</name>
      <t>When using SPC in <xref target="GNAP"/>, the end user is prompted to authenticate during the interaction phase of the protocol, when the grant is in the <em>pending</em> state.</t>
      <t>The overall flow of the protocol is shown here:</t>
      <artset>
        <artwork type="svg"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="432" width="440" viewBox="0 0 440 432" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px">
            <path d="M 8,32 L 8,416" fill="none" stroke="black"/>
            <path d="M 80,32 L 80,416" fill="none" stroke="black"/>
            <path d="M 168,176 L 168,240" fill="none" stroke="black"/>
            <path d="M 224,176 L 224,240" fill="none" stroke="black"/>
            <path d="M 360,32 L 360,416" fill="none" stroke="black"/>
            <path d="M 432,32 L 432,416" fill="none" stroke="black"/>
            <path d="M 8,32 L 80,32" fill="none" stroke="black"/>
            <path d="M 360,32 L 432,32" fill="none" stroke="black"/>
            <path d="M 80,96 L 104,96" fill="none" stroke="black"/>
            <path d="M 120,96 L 144,96" fill="none" stroke="black"/>
            <path d="M 280,96 L 352,96" fill="none" stroke="black"/>
            <path d="M 88,128 L 104,128" fill="none" stroke="black"/>
            <path d="M 120,128 L 136,128" fill="none" stroke="black"/>
            <path d="M 304,128 L 360,128" fill="none" stroke="black"/>
            <path d="M 184,160 L 208,160" fill="none" stroke="black"/>
            <path d="M 88,206 L 112,206" fill="none" stroke="black"/>
            <path d="M 88,210 L 112,210" fill="none" stroke="black"/>
            <path d="M 128,206 L 160,206" fill="none" stroke="black"/>
            <path d="M 128,210 L 160,210" fill="none" stroke="black"/>
            <path d="M 176,208 L 224,208" fill="none" stroke="black"/>
            <path d="M 184,256 L 208,256" fill="none" stroke="black"/>
            <path d="M 80,288 L 104,288" fill="none" stroke="black"/>
            <path d="M 120,288 L 144,288" fill="none" stroke="black"/>
            <path d="M 296,288 L 352,288" fill="none" stroke="black"/>
            <path d="M 336,320 L 360,320" fill="none" stroke="black"/>
            <path d="M 336,352 L 352,352" fill="none" stroke="black"/>
            <path d="M 88,384 L 104,384" fill="none" stroke="black"/>
            <path d="M 120,384 L 160,384" fill="none" stroke="black"/>
            <path d="M 280,384 L 360,384" fill="none" stroke="black"/>
            <path d="M 8,416 L 80,416" fill="none" stroke="black"/>
            <path d="M 360,416 L 432,416" fill="none" stroke="black"/>
            <path d="M 184,160 C 175.16936,160 168,167.16936 168,176" fill="none" stroke="black"/>
            <path d="M 208,160 C 216.83064,160 224,167.16936 224,176" fill="none" stroke="black"/>
            <path d="M 184,256 C 175.16936,256 168,248.83064 168,240" fill="none" stroke="black"/>
            <path d="M 208,256 C 216.83064,256 224,248.83064 224,240" fill="none" stroke="black"/>
            <path d="M 336,320 C 327.16936,320 320,327.16936 320,336" fill="none" stroke="black"/>
            <path d="M 336,352 C 327.16936,352 320,344.83064 320,336" fill="none" stroke="black"/>
            <polygon class="arrowhead" points="360,352 348,346.4 348,357.6" fill="black" transform="rotate(0,352,352)"/>
            <polygon class="arrowhead" points="360,288 348,282.4 348,293.6" fill="black" transform="rotate(0,352,288)"/>
            <polygon class="arrowhead" points="360,96 348,90.4 348,101.6" fill="black" transform="rotate(0,352,96)"/>
            <polygon class="arrowhead" points="168,208 156,202.4 156,213.6" fill="black" transform="rotate(0,160,208)"/>
            <polygon class="arrowhead" points="96,384 84,378.4 84,389.6" fill="black" transform="rotate(180,88,384)"/>
            <polygon class="arrowhead" points="96,208 84,202.4 84,213.6" fill="black" transform="rotate(180,88,208)"/>
            <polygon class="arrowhead" points="96,128 84,122.4 84,133.6" fill="black" transform="rotate(180,88,128)"/>
            <g class="text">
              <text x="44" y="52">Client</text>
              <text x="396" y="52">AS</text>
              <text x="44" y="68">Instance</text>
              <text x="112" y="100">1</text>
              <text x="184" y="100">Request</text>
              <text x="244" y="100">Access</text>
              <text x="112" y="132">2</text>
              <text x="192" y="132">Interaction</text>
              <text x="268" y="132">Needed</text>
              <text x="192" y="180">End</text>
              <text x="196" y="196">User</text>
              <text x="120" y="212">3</text>
              <text x="120" y="228">SPC</text>
              <text x="196" y="228">RO</text>
              <text x="112" y="292">4</text>
              <text x="188" y="292">Continue</text>
              <text x="256" y="292">Request</text>
              <text x="296" y="340">(5)</text>
              <text x="296" y="356">SPC</text>
              <text x="112" y="388">6</text>
              <text x="192" y="388">Grant</text>
              <text x="244" y="388">Access</text>
            </g>
          </svg>
        </artwork>
        <artwork type="ascii-art"><![CDATA[
+--------+                                  +--------+
| Client |                                  |   AS   |
|Instance|                                  |        |
|        |                                  |        |
|        +--(1)--- Request Access --------->|        |
|        |                                  |        |
|        |<-(2)-- Interaction Needed -------+        |
|        |                                  |        |
|        |           .----.                 |        |
|        |          | End  |                |        |
|        |          | User |                |        |
|        |<==(3)===>|------+                |        |
|        |   SPC    |  RO  |                |        |
|        |          |      |                |        |
|        |           `----`                 |        |
|        |                                  |        |
|        +--(4)--- Continue Request ------->|        |
|        |                                  |        |
|        |                              ,---+        |
|        |                         (5) |    |        |
|        |                         SPC  `-->|        |
|        |                                  |        |
|        |<-(6)----- Grant Access ----------+        |
|        |                                  |        |
+--------+                                  +--------+
]]></artwork>
      </artset>
      <ol spacing="normal" type="1"><li>The client instance makes a grant request to the AS, indicating that it can support SPC as an interaction start method. The client instance includes an identifier for the intended end user in the request. The client instance does not include an interaction finish method, since the interaction will happen outside of the AS and the client software will not need to be signaled by the AS to continue the grant request. (<xref target="request-credentials"/>)</li>
        <li>The AS creates a new grant request in the <em>pending</em> state and responds to the grant request with a challenge to be signed by a set of candidate credentials that are known to have been provisioned for the end user identified by the client. (<xref target="serve-credentials"/>)</li>
        <li>The client instance engages the SPC protocol to sign the challenge. (<xref target="authenticate-user"/>)</li>
        <li>The client instance continues the grant request, including the results of the SPC challenge response from (3) in the grant continuation request. (<xref target="complete-interaction"/>)</li>
        <li>The AS validates the signature, completing the SPC process and placing the grant in the <em>approved</em> state. (<xref target="verifying-authentication"/>)</li>
        <li>The AS returns an access token in a standard GNAP grant response.</li>
      </ol>
      <t>The end user provides confirmation using their credential, which the client instance presents back to the AS in a continuation response. The AS then verifies this confirmation in order to process the grant request and grant access to the client instance.</t>
      <section anchor="request-credentials">
        <name>Requesting Credentials</name>
        <t>A client instance that is able to use SPC for user interaction can request a grant from an authorization server with SPC as an interaction start method.</t>
        <t>The SPC interaction start method is defined as a string type with value <tt>spc</tt>. If the <tt>spc</tt> interaction start method is accepted, the corresponding response is returned as discussed in <xref target="serve-credentials"/>.</t>
        <t>When requesting the SPC interaction method the client <bcp14>MUST</bcp14> identify the end user using the <tt>user</tt> property in the grant request object to allow the AS to find the registered credentials for the user. If the <tt>user</tt> property is not included in the request, the AS <bcp14>MUST NOT</bcp14> enable this interaction mode for this request.</t>
        <t>A non-normative example of a grant request that uses SPC as its interaction start method is below.</t>
        <sourcecode type="json"><![CDATA[
"access_token": {
  "access": ["make-payment"]
},
"client": "xyz-client-1234a",
"interact": {
  "start": [
    "spc"
  ]
},
"user": {
  "sub_ids": [{
    "subject_type": "email",
    "email": "user@example.com"
  }]
}
]]></sourcecode>
      </section>
      <section anchor="serve-credentials">
        <name>Providing a Credential Challenge</name>
        <t>In response to a client instance's grant request, if the AS determines that it has one or more registered SPC credentials of the end user, the AS responds with an <tt>spc</tt> field in the <tt>interact</tt> object.</t>
        <t>The AS determines the end user using the <tt>user</tt> property from the grant request. The <tt>user</tt> property should have the required information such as email addresses, usernames, etc. for determining the end user, see <xref section="2.4" sectionFormat="of" target="GNAP"/>. If the <tt>user</tt> property is not included in the request, it is not possible for the AS to determine the credentials for the end user.</t>
        <dl>
          <dt><tt>spc</tt> (object):</dt>
          <dd>
            <t>An object containing parameters required for performing secure payment confirmation on the end user's device. <bcp14>REQUIRED</bcp14> if the AS is allowing SPC interaction for this request.</t>
          </dd>
        </dl>
        <t>This object contains the following properties:</t>
        <dl>
          <dt><tt>credential_ids</tt> (array of strings):</dt>
          <dd>
            <t>A list of identifiers of credentials that could potentially be used to respond to this interaction mode. Each credential identifier <bcp14>MUST</bcp14> be base64url encoded with no padding. <bcp14>REQUIRED</bcp14>.</t>
          </dd>
          <dt><tt>challenge</tt> (string):</dt>
          <dd>
            <t>A random challenge that the relying party (the AS) generates on the server side to prevent replay attacks. The challenge <bcp14>MUST</bcp14> be base64url encoded with no padding. <bcp14>REQUIRED</bcp14>.</t>
          </dd>
          <dt><tt>payment_instrument</tt> (object):</dt>
          <dd>
            <t>An object describing the payment instrument which will be used to execute the payment. <bcp14>REQUIRED</bcp14>.</t>
          </dd>
        </dl>
        <t>The payment instrument object has the following properties:</t>
        <dl>
          <dt><tt>display_name</tt> (string):</dt>
          <dd>
            <t>A display name to use in the SPC user interface. <bcp14>REQUIRED</bcp14>.</t>
          </dd>
          <dt><tt>icon</tt> (string):</dt>
          <dd>
            <t>The URL of an icon to display in the SCP user interface. The URL may either identify an image on an internet-accessible server (e.g., https://bank.com/card.png), or directly encode the icon data via a Data URL <xref target="rfc2397"/>. Between the two types of URLs, Data URLs offer several benefits to the Relying Party. They can improve reliability (e.g., in the case that the icon hosting server may be unavailable). They can also enhance validation because the Relying Party has cryptographic evidence of what the browser displayed to the user: the icon URL is signed as part of the authentication ceremony.<bcp14>REQUIRED</bcp14>.</t>
          </dd>
          <dt><tt>icon_must_be_shown</tt> (boolean):</dt>
          <dd>
            <t>Indicates whether the specified icon must be successfully fetched and shown for the request to succeed. Defaults to TRUE if not provided. <bcp14>OPTIONAL</bcp14>.</t>
          </dd>
        </dl>
        <t>A non-normative example of a grant request continue response that uses SPC as its interaction method is below.</t>
        <sourcecode type="json"><![CDATA[
{
  "interact": {
    "spc": {
      "credential_ids": ["MTIzMjMxMzIyMz..."],
      "challenge": "dGhpcyBpcyBh...",
      "payment_instrument" : {
        "display_name": "Card ending in 4242",
        "icon": "https://wallet.example/card-art.png",
        "icon_must_be_shown": true
      }
    }
  },
  "continue": {
    "access_token": {
      "value": "80UPRY5NM33OMUKMKSKU"
    },
    "uri": "http://wallet.example/continue/5e69f364-b14d-4fdf-8b6b-3b6ffb52c339"
  }
}
]]></sourcecode>
      </section>
      <section anchor="authenticate-user">
        <name>Authenticating User</name>
        <t>When the client instance receives an <tt>spc</tt> interaction response from the AS, the client instance <bcp14>SHOULD</bcp14> initiate the authentication ceremony following Section 4 of <xref target="SPC"/>.</t>
        <t>When performing this ceremony, the client instance decodes the <tt>challenge</tt> and each credential from <tt>credential_ids</tt> using base64url and converts them to a buffer for input into the browser API.</t>
        <t>The <tt>challenge</tt> value is used as the <tt>challenge</tt> input parameter and the <tt>credential_ids</tt> value is used as the <tt>credentialIds</tt> input parameter in the <tt>SecurePaymentConfirmationRequest</tt> dictionary passed to the browser API. The <tt>instrument</tt> input parameter is constructed by copying the <tt>display_name</tt>, <tt>icon</tt>, and <tt>icon_must_be_shown</tt> properties from the <tt>payment_instrument</tt> object into a new <tt>PaymentCredentialInstrument</tt>.</t>
        <t>When the client initates the authentication ceremony, the browser API checks if the device has at least one of the credential ids and continues to the authentication ceremony only if the device has one of the credentials. In this phase, the credential that the end user chooses as the authentication method is going to be used for signing the cryptogram.</t>
        <t>When the authentication ceremony is complete, the client instance will have access to the response data from the ceremony to be returned to the AS.</t>
      </section>
      <section anchor="complete-interaction">
        <name>Completing Interaction</name>
        <t>Once the authentication ceremony is complete, the client instance continues the grant request by calling the grant continuation URI. The client instance includes a body in the grant continuation request including a field named <tt>public_key_cred</tt>:</t>
        <dl>
          <dt><tt>public_key_cred</tt> (object):</dt>
          <dd>
            <t>The results of the SPC authentication ceremony in response to the AS, to be used by the AS to authorize the request.</t>
          </dd>
        </dl>
        <t>The <tt>public_key_cred</tt> object contains the following fields as defined by the Web Authentication Assertion object <xref target="WebAuthn"/>:</t>
        <dl>
          <dt><tt>client_data_json</tt> (string):</dt>
          <dd>
            <t><tt>clientDataJSON</tt> property from Web Authentication Assertion object. This <strong><bcp14>MUST</bcp14></strong> be encoded using base64url. <strong><bcp14>REQUIRED</bcp14></strong>.</t>
          </dd>
          <dt><tt>authenticator_data</tt> (string):</dt>
          <dd>
            <t><tt>authenticatorData</tt> property from Web Authentication Assertion object. This <strong><bcp14>MUST</bcp14></strong> be encoded using base64url. <strong><bcp14>REQUIRED</bcp14></strong>.</t>
          </dd>
          <dt><tt>signature</tt> (string):</dt>
          <dd>
            <t><tt>signature</tt> property from Web Authentication Assertion object. This <strong><bcp14>MUST</bcp14></strong> be encoded using base64url. <strong><bcp14>REQUIRED</bcp14></strong>.</t>
          </dd>
          <dt><tt>user_handle</tt> (string):</dt>
          <dd>
            <t><tt>userHandle</tt> property from Web Authentication Assertion object. This <strong><bcp14>MUST</bcp14></strong> be encoded using base64url. <strong><bcp14>REQUIRED</bcp14></strong>.</t>
          </dd>
        </dl>
        <t>A non-normative example of an interaction completion response body is below.</t>
        <sourcecode type="json"><![CDATA[
{
  "public_key_cred": {
    "client_data_json": "ZXhhbXBsZSBjbGllbnRkYXR...",
    "authenticator_data": "YXV0aGVudGljYXRvckRhdGEg...",
    "signature": "c2lnbmF0dXJlIGV4YW...",
    "user_handle": "dXNlckhhbmRsZSBleG..."
  }
}
]]></sourcecode>
        <t>Since the signature is in response to a challenge provided by the AS, the client instance <bcp14>MUST NOT</bcp14> send this parameter to a new grant request. The grant request <bcp14>MUST</bcp14> be in the <em>pending</em> state when this parameter is sent to the AS.</t>
      </section>
    </section>
    <section anchor="verifying-authentication">
      <name>Verifying Authentication Assertion</name>
      <t>When the AS receives the <tt>public_key_cred</tt> value in a grant continuation request, the AS <bcp14>MUST</bcp14> perform the steps specified in Section 8.1 of <xref target="SPC"/>. Each property of a public key credential returned following successful invocation of the SPC handler <tt>client_data_json</tt>, <tt>authenticator_data</tt>, <tt>signature</tt> and <tt>user_handle</tt> <bcp14>MUST</bcp14> be present as expected for starting verification. The AS <bcp14>MUST</bcp14> decode each property of the public key credential in the response using base64url before performing the verification.</t>
      <t>The grant request <bcp14>MUST</bcp14> be in the <em>pending</em> state when this parameter is received in order for it to be processed. If the grant request is in any other state, the AS <bcp14>MUST</bcp14> return an error.</t>
      <t>The AS <bcp14>MUST</bcp14> ensure that the transaction details encoded in the public key credential match the details of the transaction that the client instance is requesting a grant to perform.</t>
      <t>If the AS determines that the authorization is sufficient, the AS grants access tokens and releases subject information to the client instance.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TODO Security</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA is requested to register the following values into the named registries.</t>
      <section anchor="interaction-start-modes">
        <name>Interaction Start Modes</name>
        <t>IANA is requested to register the following modes into the Interaction Start Modes registry defined by <xref target="GNAP"/>.</t>
        <table>
          <thead>
            <tr>
              <th align="left">Mode</th>
              <th align="left">Type</th>
              <th align="left">Specification document(s)</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">spc</td>
              <td align="left">string</td>
              <td align="left">
                <xref target="request-credentials"/> of RFC nnnn</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="interaction-mode-responses">
        <name>Interaction Mode Responses</name>
        <t>IANA is requested to register the following methods into the Interaction Mode Responses registry defined by <xref target="GNAP"/>.</t>
        <table>
          <thead>
            <tr>
              <th align="left">Name</th>
              <th align="left">Specification document(s)</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">spc</td>
              <td align="left">
                <xref target="serve-credentials"/> of RFC nnnn</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="grant-request-parameters">
        <name>Grant Request Parameters</name>
        <t>IANA is requested to register the following parameters into the Grant Request Parameters registry defined by <xref target="GNAP"/>.</t>
        <table>
          <thead>
            <tr>
              <th align="left">Name</th>
              <th align="left">Type</th>
              <th align="left">Specification document(s)</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">public_key_cred</td>
              <td align="left">object</td>
              <td align="left">
                <xref target="complete-interaction"/> of RFC nnnn</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="GNAP">
          <front>
            <title>Grant Negotiation and Authorization Protocol</title>
            <author fullname="Justin Richer" initials="J." surname="Richer">
              <organization>Bespoke Engineering</organization>
            </author>
            <author fullname="Fabien Imbault" initials="F." surname="Imbault">
              <organization>acert.io</organization>
            </author>
            <date day="27" month="February" year="2023"/>
            <abstract>
              <t>   GNAP defines a mechanism for delegating authorization to a piece of
   software, and conveying the results and artifacts of that delegation
   to the software.  This delegation can include access to a set of APIs
   as well as subject information passed directly to the software.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-gnap-core-protocol-13"/>
        </reference>
        <reference anchor="SPC" target="https://www.w3.org/TR/secure-payment-confirmation/">
          <front>
            <title>Secure Payment Confirmation</title>
            <author/>
          </front>
          <seriesInfo name="W3C WD" value="secure-payment-confirmation"/>
          <seriesInfo name="W3C" value="secure-payment-confirmation"/>
        </reference>
        <reference anchor="WebAuthn" target="https://www.w3.org/TR/webauthn-3/">
          <front>
            <title>Web Authentication: An API for accessing Public Key Credentials - Level 3</title>
            <author/>
          </front>
          <seriesInfo name="W3C WD" value="webauthn-3"/>
          <seriesInfo name="W3C" value="webauthn-3"/>
        </reference>
        <reference anchor="rfc2397">
          <front>
            <title>The "data" URL scheme</title>
            <author fullname="L. Masinter" initials="L." surname="Masinter">
              <organization/>
            </author>
            <date month="August" year="1998"/>
            <abstract>
              <t>A new URL scheme, "data", is defined. It allows inclusion of small data items as "immediate" data, as if it had been included externally. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="2397"/>
          <seriesInfo name="DOI" value="10.17487/RFC2397"/>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner">
              <organization/>
            </author>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba">
              <organization/>
            </author>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <reference anchor="PaymentRequest" target="https://www.w3.org/TR/payment-request-1.1/">
          <front>
            <title>Payment Request API 1.1</title>
            <author/>
          </front>
          <seriesInfo name="W3C WD" value="payment-request-1.1"/>
          <seriesInfo name="W3C" value="payment-request-1 1"/>
        </reference>
      </references>
    </references>
    <section anchor="detect-spc">
      <name>Checking Feature Support</name>
      <t>This extension only works if the end user's user agent supports the Payment Request API <xref target="PaymentRequest"/> and SPC. To detect whether SPC is supported on the browser, the client instance can send a fake call to <tt>canMakePayment()</tt>.</t>
      <t>The following code provides a feature detect function for the Payment Request API and SPC that could be executed on a merchant's website.</t>
      <sourcecode type="javascript"><![CDATA[
const isSecurePaymentConfirmationSupported = async () => {
  if (!'PaymentRequest' in window) {
    return [false, 'Payment Request API is not supported'];
  }

  try {
    // The data below is the minimum required to create the request and
    // check if a payment can be made.
    const supportedInstruments = [
      {
        supportedMethods: "secure-payment-confirmation",
        data: {
          // RP's hostname as its ID
          rpId: 'rp.example',
          // A dummy credential ID
          credentialIds: [new Uint8Array(1)],
          // A dummy challenge
          challenge: new Uint8Array(1),
          instrument: {
            // Non-empty display name string
            displayName: ' ',
            // Transparent-black pixel.
            icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg==',
          },
          // A dummy merchant origin
          payeeOrigin: 'https://non-existent.example',
        }
      }
    ];

    const details = {
      // Dummy shopping details
      total: {label: 'Total', amount: {currency: 'USD', value: '0'}},
    };

    const request = new PaymentRequest(supportedInstruments, details);
    const canMakePayment = await request.canMakePayment();
    return [canMakePayment, canMakePayment ? '' : 'SPC is not available'];
  } catch (error) {
    console.error(error);
    return [false, error.message];
  }
};
]]></sourcecode>
    </section>
  </back>
  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