Skip to content

Commit

Permalink
Bug 1435155 - Redact the shipping address as it is visible before the…
Browse files Browse the repository at this point in the history
… promise from PaymentRequest.show() resolves successfully. r=baku

Spec PR: w3c/payment-request#654

MozReview-Commit-ID: 2AiKI7htRhk

UltraBlame original commit: 8a29a154e88dc58d0ffde543a2159d70638ce53c
  • Loading branch information
marco-c committed Oct 2, 2019
1 parent 9b620c3 commit 6c539be
Show file tree
Hide file tree
Showing 4 changed files with 657 additions and 12 deletions.
88 changes: 87 additions & 1 deletion dom/payments/PaymentRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4735,6 +4735,59 @@ aRv
return
;
}
/
/
When
the
user
agent
has
opted
to
redact
the
shipping
address
/
/
in
earlier
steps
the
spec
doesn
'
t
update
the
request
with
/
/
the
unredacted
address
at
this
point
.
Maybe
to
reduce
the
/
/
number
of
footguns
it
should
(
without
an
event
)
.
RefPtr
<
PaymentResponse
Expand All @@ -4751,7 +4804,7 @@ mInternalId
mId
aMethodName
mShippingOption
mShippingAddress
mFullShippingAddress
aDetails
aPayerName
aPayerEmail
Expand Down Expand Up @@ -5663,6 +5716,12 @@ nsAString
aPhone
)
{
nsTArray
<
nsString
>
emptyArray
;
mShippingAddress
=
new
Expand All @@ -5672,6 +5731,33 @@ GetOwner
(
)
aCountry
emptyArray
aRegion
aCity
aDependentLocality
aPostalCode
aSortingCode
aLanguageCode
EmptyString
(
)
EmptyString
(
)
EmptyString
(
)
)
;
mFullShippingAddress
=
new
PaymentAddress
(
GetOwner
(
)
aCountry
aAddressLine
aRegion
aCity
Expand Down
31 changes: 23 additions & 8 deletions dom/payments/PaymentRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -861,14 +861,8 @@ mResponse
;
/
/
It
is
populated
when
the
user
provides
a
The
redacted
shipping
address
.
Expand All @@ -880,6 +874,27 @@ mShippingAddress
;
/
/
The
full
shipping
address
to
be
used
in
the
response
upon
payment
.
RefPtr
<
PaymentAddress
>
mFullShippingAddress
;
/
/
It
is
populated
Expand Down
4 changes: 4 additions & 0 deletions dom/payments/test/ShowPaymentChromeScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ Bruno
/
city
"
Test
locality
"
/
/
Expand Down Expand Up @@ -278,6 +280,8 @@ en
language
code
"
Testing
Org
"
/
/
Expand Down
Loading

0 comments on commit 6c539be

Please sign in to comment.