WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
189938
[Apple Pay] Support granular errors in PaymentDetailsUpdate
https://bugs.webkit.org/show_bug.cgi?id=189938
Summary
[Apple Pay] Support granular errors in PaymentDetailsUpdate
Andy Estes
Reported
2018-09-24 17:12:04 PDT
[Apple Pay] Support granular errors in PaymentDetailsUpdate
Attachments
Patch
(42.91 KB, patch)
2018-09-24 17:13 PDT
,
Andy Estes
no flags
Details
Formatted Diff
Diff
Patch
(68.68 KB, patch)
2018-09-26 13:55 PDT
,
Andy Estes
no flags
Details
Formatted Diff
Diff
Patch
(68.73 KB, patch)
2018-09-26 14:39 PDT
,
Andy Estes
no flags
Details
Formatted Diff
Diff
Patch
(68.39 KB, patch)
2018-09-27 09:26 PDT
,
Andy Estes
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Andy Estes
Comment 1
2018-09-24 17:13:12 PDT
Comment hidden (obsolete)
Created
attachment 350717
[details]
Patch
Andy Estes
Comment 2
2018-09-26 13:55:56 PDT
Comment hidden (obsolete)
Created
attachment 350899
[details]
Patch
Andy Estes
Comment 3
2018-09-26 14:39:41 PDT
Created
attachment 350903
[details]
Patch
youenn fablet
Comment 4
2018-09-27 09:01:21 PDT
Comment on
attachment 350903
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=350903&action=review
> Source/WebCore/Modules/applepay/ApplePayErrorCode.h:2 > + * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
2018?
> Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:315 > +static inline void appendShippingContactInvalidError(String&& message, std::optional<PaymentError::ContactField>&& contactField, Vector<PaymentError>& errors)
If ContactField is an enum, I believe we go with std::optional<> without &&.
> Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:321 > +Vector<PaymentError> ApplePayPaymentHandler::computeErrors(String&& error, AddressErrors&& addressErrors, PayerErrorFields&& payerErrors, JSC::Strong<JSC::JSObject>&& paymentMethodErrors) const
Does paymentMethodErrors need to be a JSC::Strong, can we make it a JSC::JSObject& instead?
> Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:357 > + errors.append({ applePayError->code(), applePayError->message(), applePayError->contactField() });
We can probably move applePayError->message()
Andy Estes
Comment 5
2018-09-27 09:15:19 PDT
(In reply to youenn fablet from
comment #4
)
> Comment on
attachment 350903
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=350903&action=review
> > > Source/WebCore/Modules/applepay/ApplePayErrorCode.h:2 > > + * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > > 2018?
Yeah I'll remove this.
> > > Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:315 > > +static inline void appendShippingContactInvalidError(String&& message, std::optional<PaymentError::ContactField>&& contactField, Vector<PaymentError>& errors) > > If ContactField is an enum, I believe we go with std::optional<> without &&.
Ok.
> > > Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:321 > > +Vector<PaymentError> ApplePayPaymentHandler::computeErrors(String&& error, AddressErrors&& addressErrors, PayerErrorFields&& payerErrors, JSC::Strong<JSC::JSObject>&& paymentMethodErrors) const > > Does paymentMethodErrors need to be a JSC::Strong, can we make it a > JSC::JSObject& instead?
We can make it a JSC::JSObject*. It might be null.
> > > Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:357 > > + errors.append({ applePayError->code(), applePayError->message(), applePayError->contactField() }); > > We can probably move applePayError->message()
Yes. Thanks for reviewing!
Andy Estes
Comment 6
2018-09-27 09:23:07 PDT
(In reply to Andy Estes from
comment #5
)
> (In reply to youenn fablet from
comment #4
) > > Comment on
attachment 350903
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=350903&action=review
> > > > > Source/WebCore/Modules/applepay/ApplePayErrorCode.h:2 > > > + * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > > > > 2018? > > Yeah I'll remove this. > > > > > > Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:315 > > > +static inline void appendShippingContactInvalidError(String&& message, std::optional<PaymentError::ContactField>&& contactField, Vector<PaymentError>& errors) > > > > If ContactField is an enum, I believe we go with std::optional<> without &&. > > Ok. > > > > > > Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:321 > > > +Vector<PaymentError> ApplePayPaymentHandler::computeErrors(String&& error, AddressErrors&& addressErrors, PayerErrorFields&& payerErrors, JSC::Strong<JSC::JSObject>&& paymentMethodErrors) const > > > > Does paymentMethodErrors need to be a JSC::Strong, can we make it a > > JSC::JSObject& instead? > > We can make it a JSC::JSObject*. It might be null. > > > > > > Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:357 > > > + errors.append({ applePayError->code(), applePayError->message(), applePayError->contactField() }); > > > > We can probably move applePayError->message() > > Yes.
Actually we don't need to move, because since message() returns a temporary the compiler will elide the copy.
Andy Estes
Comment 7
2018-09-27 09:26:26 PDT
Created
attachment 350969
[details]
Patch
WebKit Commit Bot
Comment 8
2018-09-27 09:44:56 PDT
Comment on
attachment 350969
[details]
Patch Clearing flags on attachment: 350969 Committed
r236552
: <
https://trac.webkit.org/changeset/236552
>
WebKit Commit Bot
Comment 9
2018-09-27 09:44:58 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10
2018-09-27 09:45:25 PDT
<
rdar://problem/44833449
>
Truitt Savell
Comment 11
2018-10-08 08:39:54 PDT
The new test: http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html added in:
https://trac.webkit.org/changeset/236552/webkit
is flakey failure. History:
https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2Fssl%2Fapplepay%2FApplePayShippingAddressChangeEventErrorsV3.https.html
Diff: --- /Volumes/Data/slave/highsierra-debug-tests-wk2/build/layout-test-results/http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https-expected.txt +++ /Volumes/Data/slave/highsierra-debug-tests-wk2/build/layout-test-results/http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https-actual.txt @@ -1,3 +1,4 @@ +CONSOLE MESSAGE: Unhandled Promise Rejection: InvalidStateError: The object is in an invalid state. Test specifying Apple Pay errors in response to the shippingaddresschange event. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Andy Estes
Comment 12
2018-10-18 11:06:17 PDT
(In reply to Truitt Savell from
comment #11
)
> The new test: > http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html > > added in: >
https://trac.webkit.org/changeset/236552/webkit
> > is flakey failure. > > History: >
https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard
. > html#showAllRuns=true&tests=http%2Ftests%2Fssl%2Fapplepay%2FApplePayShippingA > ddressChangeEventErrorsV3.https.html > > Diff: > --- > /Volumes/Data/slave/highsierra-debug-tests-wk2/build/layout-test-results/ > http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https- > expected.txt > +++ > /Volumes/Data/slave/highsierra-debug-tests-wk2/build/layout-test-results/ > http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https- > actual.txt > @@ -1,3 +1,4 @@ > +CONSOLE MESSAGE: Unhandled Promise Rejection: InvalidStateError: The object > is in an invalid state. > Test specifying Apple Pay errors in response to the shippingaddresschange > event. > > On success, you will see a series of "PASS" messages, followed by "TEST > COMPLETE".
Tracked by
bug #190650
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug