This
specification
standardizes
an
API
to
allow
merchants
(i.e.
web
sites
selling
physical
or
digital
goods)
to
utilize
one
or
more
payment
methods
with
minimal
integration.
User
agents
(e.g.,
browsers)
facilitate
the
payment
flow
between
merchant
and
user.
Status
of
This
Document
This
is
a
preview
Do
not
attempt
to
implement
this
version
of
the
specification.
Do
not
reference
this
version
as
authoritative
in
any
way.
Instead,
see
https://w3c.github.io/payment-request/
for
the
Editor's
draft.
This
section
describes
the
status
of
this
document
at
the
time
of
its
publication.
A
list
of
current
W3C
publications
and
the
latest
revision
of
this
technical
report
can
be
found
in
the
W3C
technical
reports
index
at
https://www.w3.org/TR/.
The
W3C
published
Payment
Request
API
1.0
as
a
Proposed
Recommendation
in
September
2021.
Since
then,
W3C
has
been
working
to
resolve
two
Formal
Objections
from
W3C
Members;
see
the
Team
Report
for
details.
At
this
time,
a
Council
is
evaluating
the
Formal
Objections
to
determine
whether
Payment
Request
API
1.0
should
advance
to
Recommendation
or
be
returned
to
the
Working
Group
for
changes.
In
the
meantime,
the
Editors
have
continued
to
update
this
specification
with
new
features
(see
change
log
below).
To
provide
devellopers
and
implementers
with
more
confidence
about
these
features,
the
working
group
has
decided
to
formally
publish
the
a
new
W3C
Working
Draft.
This
will
also
provide
the
group
with
a
foundation
for
potential
discussion
at
TPAC
about
the
future
of
Payment
Request.
It
is
not
uncommon
for
a
Working
Group
to
work
on
different
revisions
of
a
specification
simultaneously
(e.g.,
see
the
CSS
WG).
With
that
in
mind,
and
because
our
current
charter
anticipates
enhancements
to
Payment
Request
1.0,
we've
publish
this
1.1
draft.
The
working
group
will
demonstrate
implementation
experience
by
producing
an
implementation
report
.
The
report
will
show
two
or
more
independent
implementations
passing
each
mandatory
test
in
the
test
suite
(i.e.,
each
test
corresponds
to
a
MUST
requirement
of
the
specification).
There
has
been
no
change
in
dependencies
on
other
workings
groups
during
the
development
of
this
specification.
Publication
as
an
Editor's
Draft
does
not
imply
endorsement
by
W3C
and
its
Members.
This
is
a
draft
document
and
may
be
updated,
replaced
or
obsoleted
by
other
documents
at
any
time.
It
is
inappropriate
to
cite
this
document
as
other
than
work
in
progress.
Future
updates
to
this
specification
may
incorporate
new
features
.
This
version
of
the
specification
removes
data
features
from
the
API,
essentially
pushing
data
details
to
payment
method
descriptions.
The
complete
list
of
changes,
including
all
editorial
changes,
is
viewable
in
the
commit
history
.
Key
set
of
changes
are
viewable
in
the
Changelog
.
1.
Introduction
This
section
is
non-normative.
This
specification
describes
an
API
that
allows
user
agents
(e.g.,
browsers)
to
act
as
an
intermediary
between
three
parties
in
a
transaction:
The
payee:
the
merchant
that
runs
an
online
store,
or
other
party
that
requests
to
be
paid.
The
payer:
the
party
that
makes
a
purchase
at
that
online
store,
and
who
authenticates
and
authorizes
payment
as
required.
The
payment
method
:
the
means
that
the
payer
uses
to
pay
the
payee
(e.g.,
a
card
payment
or
credit
transfer).
The
payment
method
provider
establishes
the
ecosystem
to
support
that
payment
method.
A
payment
method
defines:
An
optional
additional
data
type
Optionally,
an
IDL
type
that
the
payment
method
expects
to
receive
as
the
PaymentMethodData
's
data
member.
If
not
specified
for
a
given
payment
method,
no
conversion
to
IDL
is
done
and
the
payment
method
will
receive
data
as
JSON.
The
details
of
how
to
fulfill
a
payment
request
for
a
given
payment
method
is
an
implementation
detail
of
a
payment
handler
,
which
is
an
application
or
service
that
handles
requests
for
payment.
Concretely,
a
payment
handler
defines:
Steps
to
check
if
a
payment
can
be
made
:
How
a
payment
handler
determines
whether
it,
or
the
user,
can
potentially
"make
a
payment"
is
also
an
implementation
detail
of
a
payment
handler.
Steps
to
respond
to
a
payment
request
:
Steps
that
return
an
object
or
dictionary
that
a
merchant
uses
to
process
or
validate
the
transaction.
The
structure
of
this
object
is
specific
to
each
payment
method
.
Steps
for
when
a
user
changes
payment
method
(optional)
Steps
that
describe
how
to
handle
the
user
changing
payment
method
or
monetary
instrument
(e.g.,
from
a
debit
card
to
a
credit
card)
that
results
in
a
dictionary
or
object
or
null.
This
API
also
enables
web
sites
to
take
advantage
of
more
secure
payment
schemes
(e.g.,
tokenization
and
system-level
authentication)
that
are
not
possible
with
standard
JavaScript
libraries.
This
has
the
potential
to
reduce
liability
for
the
merchant
and
helps
protect
sensitive
user
information.
Enable
user
agents
to
streamline
the
user's
payment
experience
by
taking
into
account
user
preferences,
merchant
information,
security
considerations,
and
other
factors.
Standardize
(to
the
extent
that
it
makes
sense)
the
communication
flow
between
a
merchant,
user
agent,
and
payment
method
provider
.
In
order
to
use
the
API,
the
developer
needs
to
provide
and
keep
track
of
a
number
of
key
pieces
of
information.
These
bits
of
information
are
passed
to
the
PaymentRequest
constructor
as
arguments,
and
subsequently
used
to
update
the
payment
request
being
displayed
to
the
user.
Namely,
these
bits
of
information
are:
The
methodData
:
A
sequence
of
PaymentMethodData
s
that
represents
the
payment
methods
that
the
site
supports
(e.g.,
"we
support
card-based
payments,
but
only
Visa
and
MasterCard
credit
cards.").
The
details
:
The
details
of
the
transaction,
as
a
PaymentDetailsInit
dictionary.
This
includes
total
cost,
and
optionally
a
list
of
goods
or
services
being
purchased.
Additionally,
it
can
optionally
include
"modifiers"
to
how
payments
are
made.
For
example,
"if
you
pay
with
a
card
belonging
to
network
X,
it
incurs
a
US$3.00
processing
fee".
Once
a
PaymentRequest
is
constructed,
it's
presented
to
the
end
user
via
the
show
()
method.
The
show
()
returns
a
promise
that,
once
the
user
confirms
request
for
payment,
results
in
a
PaymentResponse
.
2.1
Declaring
multiple
ways
of
paying
When
constructing
a
new
PaymentRequest
,
a
merchant
uses
the
first
argument
(
methodData
)
to
list
the
different
ways
a
user
can
pay
for
things
(e.g.,
credit
cards,
Apple
Pay,
Google
Pay,
etc.).
More
specifically,
the
methodData
sequence
contains
PaymentMethodData
dictionaries
containing
the
payment
method
identifiers
for
the
payment
methods
that
the
merchant
accepts
and
any
associated
payment
method
specific
data
(e.g.,
which
credit
card
networks
are
supported).
When
constructing
a
new
PaymentRequest
,
a
merchant
uses
the
second
argument
of
the
constructor
(
details
)
to
provide
the
details
of
the
transaction
that
the
user
is
being
asked
to
complete.
This
includes
the
total
of
the
order
and,
optionally,
some
line
items
that
can
provide
a
detailed
breakdown
of
what
is
being
paid
for.
asyncfunctiondoPaymentRequest() {
try {
const request = new PaymentRequest(methodData, details, options);
const response = await request.show();
await validateResponse(response);
} catch (err) {
// AbortError, SecurityErrorconsole.error(err);
}
}
asyncfunctionvalidateResponse(response) {
try {
const errors = await checkAllValuesAreGood(response);
if (errors.length) {
await response.retry(errors);
return validateResponse(response);
}
await response.complete("success");
} catch (err) {
// Something went wrong...await response.complete("fail");
}
}
// Must be called as a result of a click// or some explicit user action.
doPaymentRequest();
2.5
POSTing
payment
response
back
to
a
server
It's
expected
that
data
in
a
PaymentResponse
will
be
POSTed
back
to
a
server
for
processing.
To
make
this
as
easy
as
possible,
PaymentResponse
can
use
the
default
toJSON
steps
(i.e.,
.toJSON()
)
to
serializes
the
object
directly
into
JSON.
This
makes
it
trivial
to
POST
the
resulting
JSON
back
to
a
server
using
the
Fetch
Standard
:
To
indicate
that
a
cross-origin
iframe
is
allowed
to
invoke
the
payment
request
API,
the
allow
attribute
along
with
the
"payment"
keyword
can
be
specified
on
the
iframe
element.
Example
6
:
Using
Payment
Request
API
with
cross-origin
iframes
If
the
iframe
will
be
navigated
across
multiple
origins
that
support
the
Payment
Request
API,
then
one
can
set
allow
to
"payment
*"
.
The
Permissions
Policy
specification
provides
further
details
and
examples.
A
developer
creates
a
PaymentRequest
to
make
a
payment
request.
This
is
typically
associated
with
the
user
initiating
a
payment
process
(e.g.,
by
activating
a
"Buy,"
"Purchase,"
or
"Checkout"
button
on
a
web
site,
selecting
a
"Power
Up"
in
an
interactive
game,
or
paying
at
a
kiosk
in
a
parking
structure).
The
PaymentRequest
allows
developers
to
exchange
information
with
the
user
agent
while
the
user
is
providing
input
(up
to
the
point
of
user
approval
or
denial
of
the
payment
request).
The
payment
request
is
showing
boolean
simply
prevents
more
than
one
payment
UI
being
shown
in
a
single
browser
tab.
However,
a
payment
handler
can
restrict
the
user
agent
to
showing
only
one
payment
UI
across
all
browser
windows
and
tabs.
Other
payment
handlers
might
allow
showing
a
payment
UI
across
disparate
browser
tabs.
If
details
.
id
is
missing,
add
an
id
member
to
details
and
set
its
value
to
a
UUID
[
RFC4122
].
Let
serializedMethodData
be
an
empty
list.
Process
payment
methods:
If
the
length
of
the
methodData
sequence
is
zero,
then
throw
a
TypeError
,
optionally
informing
the
developer
that
at
least
one
payment
method
is
required.
If
the
data
member
of
paymentMethod
is
missing,
let
serializedData
be
null.
Otherwise,
let
serializedData
be
the
result
of
serialize
paymentMethod
.
data
into
a
JSON
string.
Rethrow
any
exceptions.
If
the
data
member
of
modifier
is
missing,
let
serializedData
be
null.
Otherwise,
let
serializedData
be
the
result
of
serialize
modifier
.
data
into
a
JSON
string.
Rethrow
any
exceptions.
Add
the
tuple
(
modifier
.
supportedMethods
,
serializedData
)
to
serializedModifierData
.
Remove
the
data
member
of
modifier
,
if
it
is
present.
For
auditing
and
reconciliation
purposes,
a
merchant
can
associate
a
unique
identifier
for
each
transaction
with
the
id
attribute.
3.3
show()
method
Note
The
show
()
method
is
called
when
a
developer
wants
to
begin
user
interaction
for
the
payment
request.
The
show
()
method
returns
a
Promise
that
will
be
resolved
when
the
user
accepts
the
payment
request
.
Some
kind
of
user
interface
will
be
presented
to
the
user
to
facilitate
the
payment
request
after
the
show
()
method
returns.
Each
payment
handler
controls
what
happens
when
multiple
browsing
context
simultaneously
call
the
show
()
method.
For
instance,
some
payment
handlers
will
allow
multiple
payment
UIs
to
be
shown
in
different
browser
tabs/windows.
Other
payment
handlers
might
only
allow
a
single
payment
UI
to
be
shown
for
the
entire
user
agent.
The
show(optional
detailsPromise
)
method
MUST
act
as
follows:
This
allows
the
user
agent
to
not
require
user
activation,
for
example
to
support
redirect
flows
where
a
user
activation
may
not
be
present
upon
redirect.
See
15.9
User
activation
requirement
for
security
considerations.
This
allows
the
user
agent
to
act
as
if
the
user
had
immediately
aborted
the
payment
request
,
at
its
discretion.
For
example,
in
"private
browsing"
modes
or
similar,
user
agents
might
take
advantage
of
this
step.
Present
a
user
interface
that
will
allow
the
user
to
interact
with
the
handlers
.
The
user
agent
SHOULD
prioritize
the
user's
preference
when
presenting
payment
methods.
The
user
interface
SHOULD
be
presented
using
the
language
and
locale-based
formatting
that
matches
the
document
's
document
element's
language
,
if
any,
or
an
appropriate
fallback
if
that
is
not
available.
Note
:
Localization
of
the
payments
user
interface
Based
on
how
the
detailsPromise
settles,
the
update
a
PaymentRequest
's
details
algorithm
determines
how
the
payment
UI
behaves.
That
is,
upon
rejection
of
the
detailsPromise
,
the
payment
request
aborts.
Otherwise,
upon
fulfillment
detailsPromise
,
the
user
agent
re-enables
the
payment
request
UI
and
the
payment
flow
can
continue.
If
the
first
element
of
tuple
(a
PMI
)
matches
the
payment
method
identifier
of
request
.
[[handler]]
,
then
append
the
second
element
of
tuple
(the
serialized
method
data)
to
modifiers
.
Pass
the
converted
second
element
in
the
paymentMethod
tuple
and
modifiers
.
Optionally,
the
user
agent
SHOULD
send
the
appropriate
data
from
request
to
the
user-selected
payment
handler
in
order
to
guide
the
user
through
the
payment
process.
This
includes
the
various
attributes
and
other
internal
slots
of
request
(some
MAY
be
excluded
for
privacy
reasons
where
appropriate).
Handling
of
multiple
applicable
modifiers
in
the
[[serializedModifierData]]
internal
slot
is
payment
handler
specific
and
beyond
the
scope
of
this
specification.
Nevertheless,
it
is
RECOMMENDED
that
payment
handlers
use
a
"last
one
wins"
approach
with
items
in
the
[[serializedModifierData]]
list:
that
is
to
say,
an
item
at
the
end
of
the
list
always
takes
precedence
over
any
item
at
the
beginning
of
the
list
(see
example
below).
The
abort
()
method
is
called
if
a
developer
wishes
to
tell
the
user
agent
to
abort
the
payment
request
and
to
tear
down
any
user
interface
that
might
be
shown.
The
abort
()
can
only
be
called
after
the
show
()
method
has
been
called
(see
states
)
and
before
this
instance's
[[acceptPromise]]
has
been
resolved.
For
example,
developers
might
choose
to
do
this
if
the
goods
they
are
selling
are
only
available
for
a
limited
amount
of
time.
If
the
user
does
not
accept
the
payment
request
within
the
allowed
time
period,
then
the
request
will
be
aborted.
A
user
agent
might
not
always
be
able
to
abort
a
request.
For
example,
if
the
user
agent
has
delegated
responsibility
for
the
request
to
another
app.
In
this
situation,
abort
()
will
reject
the
returned
Promise
.
The
methodData
supplied
to
the
constructor,
but
represented
as
tuples
containing
supported
methods
and
a
string
or
null
for
data
(instead
of
the
original
object
form).
[[serializedModifierData]]
A
list
containing
the
serialized
string
form
of
each
data
member
for
each
corresponding
item
in
the
sequence
[[details]]
.
modifier
,
or
null
if
no
such
member
was
present.
An
object
that
provides
optional
information
that
might
be
needed
by
the
supported
payment
methods.
If
supplied,
it
will
be
serialized
.
Note
The
value
of
supportedMethods
was
changed
from
array
to
string,
but
the
name
was
left
as
a
plural
to
maintain
compatibility
with
existing
content
on
the
Web.
An
[
ISO4217
]
well-formed
3-letter
alphabetic
code
(i.e.,
the
numeric
codes
are
not
supported).
Their
canonical
form
is
upper
case.
However,
the
set
of
combinations
of
currency
code
for
which
localized
currency
symbols
are
available
is
implementation
dependent.
When
displaying
a
monetary
value,
it
is
RECOMMENDED
that
user
agents
display
the
currency
code,
but
it's
OPTIONAL
for
user
agents
to
display
a
currency
symbol.
This
is
because
currency
symbols
can
be
ambiguous
due
to
use
across
a
number
of
different
currencies
(e.g.,
"$"
could
mean
any
of
USD,
AUD,
NZD,
CAD,
and
so
on.).
User
agents
MAY
format
the
display
of
the
currency
member
to
adhere
to
OS
conventions
(e.g.,
for
localization
purposes).
Note
:
Digital
currencies
and
ISO
4217
currency
codes
Current
implementations
will
therefore
allow
the
use
of
well-formed
currency
codes
that
are
not
part
of
the
official
[
ISO4217
]
list
(e.g.,
XBT,
XRP,
etc.).
If
the
provided
code
is
a
currency
that
the
browser
knows
how
to
display,
then
an
implementation
will
generally
display
the
appropriate
currency
symbol
in
the
user
interface
(e.g.,
"USD"
is
shown
as
U+0024
Dollar
Sign
($),
"GBP"
is
shown
as
U+00A3
Pound
Sign
(£),
"PLN"
is
shown
as
U+007A
U+0142
Złoty
(zł),
and
the
non-standard
"XBT"
could
be
shown
as
U+0243
Latin
Capital
Letter
B
with
Stroke
(Ƀ)).
Efforts
are
underway
at
ISO
to
account
for
digital
currencies,
which
may
result
in
an
update
to
the
[
ISO4217
]
registry
or
an
entirely
new
registry.
The
community
expects
this
will
resolve
ambiguities
that
have
crept
in
through
the
use
of
non-standard
3-letter
codes;
for
example,
does
"BTC"
refer
to
Bitcoin
or
to
a
future
Bhutan
currency?
At
the
time
of
publication,
it
remains
unclear
what
form
this
evolution
will
take,
or
even
the
time
frame
in
which
the
work
will
be
completed.
The
W3C
Web
Payments
Working
Group
is
liaising
with
ISO
so
that,
in
the
future,
revisions
to
this
specification
remain
compatible
with
relevant
ISO
registries.
If
the
first
code
point
of
amount
.
value
is
U+002D
(-),
then
throw
a
TypeError
optionally
informing
the
developer
that
a
total's
value
can't
be
a
negative
number.
A
sequence
of
PaymentItem
dictionaries
contains
line
items
for
the
payment
request
that
the
user
agent
MAY
display.
Note
modifiers
member
A
sequence
of
PaymentDetailsModifier
dictionaries
that
contains
modifiers
for
particular
payment
method
identifiers.
For
example,
it
allows
you
to
adjust
the
total
amount
based
on
payment
method.
A
sequence
of
one
or
more
PaymentItem
dictionaries
is
included
in
the
PaymentDetailsBase
dictionary
to
indicate
what
the
payment
request
is
for
and
the
value
asked
for.
label
member
A
human-readable
description
of
the
item.
The
user
agent
may
display
this
to
the
user.
A
boolean.
When
set
to
true
it
means
that
the
amount
member
is
not
final.
This
is
commonly
used
to
show
items
such
as
shipping
or
tax
amounts
that
depend
upon
selection
of
shipping
address
or
shipping
option.
User
agents
MAY
indicate
pending
fields
in
the
user
interface
for
the
payment
request.
The
PaymentCompleteDetails
dictionary
provides
additional
information
from
the
merchant
website
to
the
payment
handler
when
the
payment
request
completes.
By
matching
the
members
of
errorFields
to
input
fields
in
the
user
agent's
UI,
indicate
to
the
end
user
that
something
is
wrong
with
the
data
of
the
payment
response.
For
example,
a
user
agent
might
draw
the
user's
attention
to
the
erroneous
errorFields
in
the
browser's
UI
and
display
the
value
of
each
field
in
a
manner
that
helps
the
user
fix
each
error.
Similarly,
if
the
error
member
is
passed,
present
the
error
in
the
user
agent's
UI.
In
the
case
where
the
value
of
a
member
is
the
empty
string,
the
user
agent
MAY
substitute
a
value
with
a
suitable
error
message.
Otherwise,
if
errorFields
was
not
passed,
signal
to
the
end
user
to
attempt
to
retry
the
payment.
Re-enable
any
UI
element
that
affords
the
end
user
the
ability
to
retry
accepting
the
payment
request.
If
document
stops
being
fully
active
while
the
user
interface
is
being
shown,
or
no
longer
is
by
the
time
this
step
is
reached,
then:
A
general
description
of
an
error
with
the
payment
from
which
the
user
can
attempt
to
recover.
For
example,
the
user
may
recover
by
retrying
the
payment.
A
developer
can
optionally
pass
the
error
member
on
its
own
to
give
a
general
overview
of
validation
issues,
or
it
can
be
passed
in
combination
with
other
members
of
the
PaymentValidationErrors
dictionary.
The
corresponding
payment
request
id
that
spawned
this
payment
response.
11.5
complete()
method
Note
The
complete
()
method
is
called
after
the
user
has
accepted
the
payment
request
and
the
[[acceptPromise]]
has
been
resolved.
Calling
the
complete
()
method
tells
the
user
agent
that
the
payment
interaction
is
over
(and
SHOULD
cause
any
remaining
user
interface
to
be
closed).
After
the
payment
request
has
been
accepted
and
the
PaymentResponse
returned
to
the
caller,
but
before
the
caller
calls
complete
()
,
the
payment
request
user
interface
remains
in
a
pending
state.
At
this
point
the
user
interface
SHOULD
NOT
offer
a
cancel
command
because
acceptance
of
the
payment
request
has
been
returned.
However,
if
something
goes
wrong
and
the
developer
never
calls
complete
()
then
the
user
interface
is
blocked.
For
this
reason,
implementations
MAY
impose
a
timeout
for
developers
to
call
complete
()
.
If
the
timeout
expires
then
the
implementation
will
behave
as
if
complete
()
was
called
with
no
arguments.
Is
true
if
the
request
for
payment
has
completed
(i.e.,
complete
()
was
called,
or
there
was
a
fatal
error
that
made
the
response
not
longer
usable),
or
false
otherwise.
This
allows
user
agents
to
apply
heuristics
to
detect
and
prevent
abuse
of
the
calling
method
for
fingerprinting
purposes,
such
as
creating
PaymentRequest
objects
with
a
variety
of
supported
payment
methods
and
triggering
the
can
make
payment
algorithm
on
them
one
after
the
other.
For
example,
a
user
agent
may
restrict
the
number
of
successful
calls
that
can
be
made
based
on
the
top-level
browsing
context
or
the
time
period
in
which
those
calls
were
made.
Let
identifier
be
the
first
element
in
the
paymentMethod
tuple.
If
the
user
agent
has
a
payment
handler
that
supports
handling
payment
requests
for
identifier
,
resolve
hasHandlerPromise
with
true
and
terminate
this
algorithm.
The
PaymentRequest
updated
algorithm
is
run
by
other
algorithms
above
to
fire
an
event
to
indicate
that
a
user
has
made
a
change
to
a
PaymentRequest
called
request
with
an
event
name
of
name
:
The
user
accepts
the
payment
request
algorithm
runs
when
the
user
accepts
the
payment
request
and
confirms
that
they
want
to
pay.
It
MUST
queue
a
task
on
the
user
interaction
task
source
to
perform
the
following
steps:
Let
request
be
the
PaymentRequest
object
that
the
user
is
interacting
with.
If
the
request
.
[[updating]]
is
true,
then
terminate
this
algorithm
and
take
no
further
action.
The
user
agent
user
interface
SHOULD
ensure
that
this
never
occurs.
If
request
.
[[state]]
is
not
"
interactive
",
then
terminate
this
algorithm
and
take
no
further
action.
The
user
agent
user
interface
SHOULD
ensure
that
this
never
occurs.
Let
isRetry
be
true
if
request
.
[[response]]
is
not
null,
false
otherwise.
The
user
aborts
the
payment
request
algorithm
runs
when
the
user
aborts
the
payment
request
through
the
currently
interactive
user
interface.
It
MUST
queue
a
task
on
the
user
interaction
task
source
to
perform
the
following
steps:
Let
request
be
the
PaymentRequest
object
that
the
user
is
interacting
with.
If
request
.
[[state]]
is
not
"
interactive
",
then
terminate
this
algorithm
and
take
no
further
action.
The
user
agent
user
interface
SHOULD
ensure
that
this
never
occurs.
Abort
the
current
user
interaction
and
close
down
any
remaining
user
interface.
14.6
Update
a
PaymentRequest
's
details
algorithm
The
update
a
PaymentRequest
's
details
algorithm
takes
a
PaymentDetailsUpdate
detailsPromise
,
a
PaymentRequest
request
,
and
pmi
that
is
either
a
DOMString
or
null
(a
payment
method
identifier
).
The
steps
are
conditional
on
the
detailsPromise
settling.
If
detailsPromise
never
settles
then
the
payment
request
is
blocked.
The
user
agent
SHOULD
provide
the
user
with
a
means
to
abort
a
payment
request.
Implementations
MAY
choose
to
implement
a
timeout
for
pending
updates
if
detailsPromise
doesn't
settle
in
a
reasonable
amount
of
time.
In
parallel
,
disable
the
user
interface
that
allows
the
user
to
accept
the
payment
request.
This
is
to
ensure
that
the
payment
is
not
accepted
until
the
user
interface
is
updated
with
any
new
details.
If
the
data
member
of
modifier
is
missing,
let
serializedData
be
null.
Otherwise,
let
serializedData
be
the
result
of
serialize
modifier
.
data
into
a
JSON
string.
If
it
throws
an
exception,
then
abort
the
update
with
request
and
that
exception.
Add
serializedData
to
serializedModifierData
.
Remove
the
data
member
of
modifier
,
if
it
is
present.
Abort
the
update
runs
when
there
is
a
fatal
error
updating
the
payment
request,
such
as
the
supplied
detailsPromise
rejecting,
or
its
fulfillment
value
containing
invalid
data.
This
would
potentially
leave
the
payment
request
in
an
inconsistent
state
since
the
developer
hasn't
successfully
handled
the
change
event.
To
help
ensure
that
users
do
not
inadvertently
share
sensitive
credentials
with
an
origin,
this
API
requires
that
PaymentRequest's
show
()
method
be
invoked
while
the
relevant
Window
has
transient
activation
(e.g.,
via
a
click
or
press).
To
avoid
a
confusing
user
experience,
this
specification
limits
the
user
agent
to
displaying
one
at
a
time
via
the
show
()
method.
In
addition,
the
user
agent
can
limit
the
rate
at
which
a
page
can
call
show
()
.
15.2
Secure
contexts
This
section
is
non-normative.
The
API
defined
in
this
specification
is
only
exposed
in
a
secure
context
-
see
also
the
Secure
Contexts
specification
for
more
details.
In
practice,
this
means
that
this
API
is
only
available
over
HTTPS.
This
is
to
limit
the
possibility
of
payment
method
data
(e.g.,
credit
card
numbers)
being
sent
in
the
clear.
15.3
Cross-origin
payment
requests
This
section
is
non-normative.
It
is
common
for
merchants
and
other
payees
to
delegate
checkout
and
other
e-commerce
activities
to
payment
service
providers
through
an
iframe
.
This
API
supports
payee-authorized
cross-origin
iframes
through
[
HTML
]'s
allow
attribute.
The
PaymentRequest
API
does
not
directly
support
encryption
of
data
fields.
Individual
payment
methods
may
choose
to
include
support
for
encrypted
data
but
it
is
not
mandatory
that
all
payment
methods
support
this.
Payment
method
owners
establish
the
privacy
policies
for
how
user
data
collected
for
the
payment
method
may
be
used.
Payment
Request
API
sets
a
clear
expectation
that
data
will
be
used
for
the
purposes
of
completing
a
transaction,
and
user
experiences
associated
with
this
API
convey
that
intention.
It
is
the
responsibility
of
the
payee
to
ensure
that
any
data
usage
conforms
to
payment
method
policies.
For
any
permitted
usage
beyond
completion
of
the
transaction,
the
payee
should
clearly
communicate
that
usage
to
the
user.
15.7
Exposing
user
information
The
user
agent
MUST
NOT
share
information
about
the
user
with
a
developer
without
user
consent.
In
particular,
the
PaymentMethodData
's
data
and
PaymentResponse
's
details
members
allow
for
the
arbitrary
exchange
of
data.
In
light
of
the
wide
range
of
data
models
used
by
existing
payment
methods,
prescribing
data
specifics
in
this
API
would
limit
its
usefulness.
The
details
member
carries
data
from
the
payment
handler,
whether
Web-based
(as
defined
by
the
Payment
Handler
API
)
or
proprietary.
The
user
agent
MUST
NOT
support
payment
handlers
unless
they
include
adequate
user
consent
mechanisms
(such
as
awareness
of
parties
to
the
transaction
and
mechanisms
for
demonstrating
the
intention
to
share
data).
The
PaymentMethodChangeEvent
enables
the
payee
to
update
the
displayed
total
based
on
information
specific
to
a
selected
payment
method
.
For
example,
the
billing
address
associated
with
a
selected
payment
method
might
affect
the
tax
computation
(e.g.,
VAT),
and
it
is
desirable
that
the
user
interface
accurately
display
the
total
before
the
payer
completes
the
transaction.
At
the
same
time,
it
is
desirable
to
share
as
little
information
as
possible
prior
to
completion
of
the
payment.
Therefore,
when
a
payment
method
defines
the
steps
for
when
a
user
changes
payment
method
,
it
is
important
to
minimize
the
data
shared
via
the
PaymentMethodChangeEvent
's
methodDetails
attribute.
Requirements
and
approaches
for
minimizing
shared
data
are
likely
to
vary
by
payment
method
.
Where
sharing
of
privacy-sensitive
information
might
not
be
obvious
to
users
(e.g.,
when
changing
payment
methods
),
it
is
RECOMMENDED
that
user
agents
inform
the
user
of
exactly
what
information
is
being
shared
with
a
merchant.
15.8
canMakePayment()
protections
The
canMakePayment
()
method
provides
feature
detection
for
different
payment
methods.
It
may
become
a
fingerprinting
vector
if
in
the
future,
a
large
number
of
payment
methods
are
available.
purposes.
User
agents
are
expected
to
protect
the
user
from
abuse
of
the
method.
For
example,
user
agents
can
reduce
user
fingerprinting
by:
Rate-limiting
the
frequency
of
calls
with
different
parameters.
For
rate-limiting
the
user
agent
might
look
at
repeated
calls
from:
These
rate-limiting
techniques
intend
to
increase
the
cost
associated
with
repeated
calls,
whether
it
is
the
cost
of
managing
multiple
registrable
domains
or
the
user
experience
friction
of
opening
multiple
windows
(tabs
or
pop-ups).
15.9
User
activation
requirement
If
the
user
agent
does
not
require
user
activation
as
part
of
the
show
()
method,
some
additional
security
mitigations
should
be
considered.
Not
requiring
user
activation
increases
the
risk
of
spam
and
click-jacking
attacks,
by
allowing
a
Payment
Request
UI
to
be
initiated
without
the
user
interacting
with
the
page
immediately
beforehand.
In
order
to
mitigate
spam,
the
user
agent
may
decide
to
enforce
a
user
activation
requirement
after
some
threshold,
for
example
after
the
user
has
already
been
shown
a
Payment
Request
UI
without
a
user
activation
on
the
current
page.
In
order
to
mitigate
click-jacking
attacks,
the
user
agent
may
implement
a
time
threshold
in
which
clicks
are
ignored
immediately
after
a
dialog
is
shown.
Another
relevant
mitigation
exists
in
step
6
of
show
()
,
where
the
document
must
be
visible
in
order
to
initiate
the
user
interaction.
16.
Accessibility
Considerations
This
section
is
non-normative.
For
the
user-facing
aspects
of
Payment
Request
API,
implementations
integrate
with
platform
accessibility
APIs
via
form
controls
and
other
input
modalities.
17.
Dependencies
This
specification
relies
on
several
other
underlying
specifications.
As
well
as
sections
marked
as
non-normative,
all
authoring
guidelines,
diagrams,
examples,
and
notes
in
this
specification
are
non-normative.
Everything
else
in
this
specification
is
normative.
The
key
words
MAY
,
MUST
,
MUST
NOT
,
OPTIONAL
,
RECOMMENDED
,
SHOULD
,
and
SHOULD
NOT
in
this
document
are
to
be
interpreted
as
described
in
BCP
14
[
RFC2119
]
[
RFC8174
]
when,
and
only
when,
they
appear
in
all
capitals,
as
shown
here.
There
is
only
one
class
of
product
that
can
claim
conformance
to
this
specification:
a
user
agent
.
Note
Although
this
specification
is
primarily
targeted
at
web
browsers,
it
is
feasible
that
other
software
could
also
implement
this
specification
in
a
conforming
manner.
User
agents
MAY
implement
algorithms
given
in
this
specification
in
any
way
desired,
so
long
as
the
end
result
is
indistinguishable
from
the
result
that
would
be
obtained
by
the
specification's
algorithms.
User
agents
MAY
impose
implementation-specific
limits
on
otherwise
unconstrained
inputs,
e.g.,
to
prevent
denial
of
service
attacks,
to
guard
against
running
out
of
memory,
or
to
work
around
platform-specific
limitations.
When
an
input
exceeds
implementation-specific
limit,
the
user
agent
MUST
throw,
or,
in
the
context
of
a
promise,
reject
with,
a
TypeError
optionally
informing
the
developer
of
how
a
particular
input
exceeded
an
implementation-specific
limit.
You are visitor 01402622 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.