Changeset 228195 in webkit


Ignore:
Timestamp:
Feb 6, 2018 2:49:53 PM (6 years ago)
Author:
aestes@apple.com
Message:

[Payment Request] show() should take an optional PaymentDetailsUpdate promise
https://bugs.webkit.org/show_bug.cgi?id=182538
<rdar://problem/36754552>

Reviewed by Tim Horton.

Source/WebCore:

Taught show() to take an optional promise for a PaymentDetailsUpdate.

Added test cases to http/tests/paymentrequest/payment-request-show-method.https.html.

  • Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:

(WebCore::ApplePayPaymentHandler::detailsUpdated):

Changed to take a PaymentRequest::UpdateReason instead of a eventType string.

(WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
(WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
(WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
(WebCore::ApplePayPaymentHandler::didAuthorizePayment):
(WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
(WebCore::ApplePayPaymentHandler::didSelectShippingContact):
(WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):

Asserted that only one of the PaymentSession delegates is executing at a time.

  • Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
  • Modules/paymentrequest/PaymentHandler.h:

Changed detailsUpdated to take a PaymentRequest::UpdateReason instead of a eventType string.

  • Modules/paymentrequest/PaymentRequest.cpp:

(WebCore::PaymentRequest::show):

If there is a details promise, call updateWith() with UpdateReason::ShowDetailsResolved.

(WebCore::PaymentRequest::shippingAddressChanged):
(WebCore::PaymentRequest::shippingOptionChanged):
(WebCore::PaymentRequest::paymentMethodChanged):

Used whenDetailsSettled() to ensure that update events do not start before the show()
details promise settles.

(WebCore::PaymentRequest::updateWith):
(WebCore::PaymentRequest::settleDetailsPromise):

Changed to use a PaymentRequest::UpdateReason instead of a eventType string.

(WebCore::PaymentRequest::whenDetailsSettled):

If there is a details promise, wait for it to settle before executing the callback.

  • Modules/paymentrequest/PaymentRequest.h:

Defined enum class UpdateReason.

  • Modules/paymentrequest/PaymentRequest.idl:

Updated show() to take an optional Promise<PaymentDetailsUpdate>.

  • Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:

(WebCore::PaymentRequestUpdateEvent::updateWith):

Map the event type to a PaymentRequest::UpdateReason.

LayoutTests:

  • http/tests/paymentrequest/payment-request-show-method.https-expected.txt:
  • http/tests/paymentrequest/payment-request-show-method.https.html:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r228187 r228195  
     12018-02-06  Andy Estes  <aestes@apple.com>
     2
     3        [Payment Request] show() should take an optional PaymentDetailsUpdate promise
     4        https://bugs.webkit.org/show_bug.cgi?id=182538
     5        <rdar://problem/36754552>
     6
     7        Reviewed by Tim Horton.
     8
     9        * http/tests/paymentrequest/payment-request-show-method.https-expected.txt:
     10        * http/tests/paymentrequest/payment-request-show-method.https.html:
     11
    1122018-02-06  Daniel Bates  <dabates@apple.com>
    213
  • trunk/LayoutTests/http/tests/paymentrequest/payment-request-show-method.https-expected.txt

    r223962 r228195  
    55PASS If payment method consultation produces no supported method of payment, then return a promise rejected with a "NotSupportedError" DOMException.
    66PASS If the user aborts the payment request algorithm, then return a promise rejected with an "AbortError" DOMException.
     7PASS A request is updated when show()'s detail promise resolves.
     8PASS Change events do not occur until show()'s detail promise resolves.
    79
  • trunk/LayoutTests/http/tests/paymentrequest/payment-request-show-method.https.html

    r224402 r228195  
    7676  await promise_rejects(t, "AbortError", acceptPromise);
    7777}, `If the user aborts the payment request algorithm, then return a promise rejected with an "AbortError" DOMException.`);
     78
     79user_activation_test(async t => {
     80  const request = new PaymentRequest(defaultMethods, defaultDetails);
     81  const expectedLabel = "Updated Total";
     82  const expectedAmount = "2.00";
     83  const details = {
     84      total: {
     85          label: expectedLabel,
     86          amount: {
     87              currency: "USD",
     88              value: expectedAmount,
     89          },
     90      },
     91  };
     92  const acceptPromise = request.show(details);
     93  internals.mockPaymentCoordinator.changePaymentMethod({ type: 'credit' });
     94  internals.mockPaymentCoordinator.acceptPayment();
     95  const result = await acceptPromise;
     96  assert_equals(internals.mockPaymentCoordinator.total.label, expectedLabel);
     97  assert_equals(internals.mockPaymentCoordinator.total.amount, expectedAmount);
     98  result.complete("success");
     99}, `A request is updated when show()'s detail promise resolves.`);
     100
     101user_activation_test(async t => {
     102  const request = new PaymentRequest(defaultMethods, defaultDetails);
     103  const expectedLabel = "Updated Total";
     104  const expectedAmount = "2.00";
     105
     106  var shippingAddressChanged = false;
     107  const shippingAddressChangedPromise = new Promise((resolve) => {
     108    request.onshippingaddresschange = () => {
     109      shippingAddressChanged = true;
     110      resolve();
     111    };
     112  });
     113
     114  const detailsPromise = new Promise((resolve) => {
     115    const details = {
     116      total: {
     117        label: expectedLabel,
     118        amount: {
     119          currency: "USD",
     120          value: expectedAmount,
     121        },
     122      },
     123    };
     124
     125    request.onmerchantvalidation = (event) => {
     126      const sessionPromise = new Promise((resolve) => resolve({ }));
     127      event.complete(sessionPromise);
     128      sessionPromise.then(() => window.setTimeout(() => {
     129        assert_equals(shippingAddressChanged, false, "shippingaddresschange does not fire before the details promise resolves.");
     130        resolve(details);
     131      }));
     132    };
     133  });
     134
     135  request.show(detailsPromise).catch(() => {});
     136  await shippingAddressChangedPromise;
     137}, `Change events do not occur until show()'s detail promise resolves.`);
    78138</script>
  • trunk/Source/WebCore/ChangeLog

    r228191 r228195  
     12018-02-06  Andy Estes  <aestes@apple.com>
     2
     3        [Payment Request] show() should take an optional PaymentDetailsUpdate promise
     4        https://bugs.webkit.org/show_bug.cgi?id=182538
     5        <rdar://problem/36754552>
     6
     7        Reviewed by Tim Horton.
     8
     9        Taught show() to take an optional promise for a PaymentDetailsUpdate.
     10
     11        Added test cases to http/tests/paymentrequest/payment-request-show-method.https.html.
     12
     13        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
     14        (WebCore::ApplePayPaymentHandler::detailsUpdated):
     15
     16        Changed to take a PaymentRequest::UpdateReason instead of a eventType string.
     17
     18        (WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
     19        (WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
     20        (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
     21        (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
     22        (WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
     23        (WebCore::ApplePayPaymentHandler::didSelectShippingContact):
     24        (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
     25
     26        Asserted that only one of the PaymentSession delegates is executing at a time.
     27
     28        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
     29        * Modules/paymentrequest/PaymentHandler.h:
     30
     31        Changed detailsUpdated to take a PaymentRequest::UpdateReason instead of a eventType string.
     32
     33        * Modules/paymentrequest/PaymentRequest.cpp:
     34        (WebCore::PaymentRequest::show):
     35
     36        If there is a details promise, call updateWith() with UpdateReason::ShowDetailsResolved.
     37
     38        (WebCore::PaymentRequest::shippingAddressChanged):
     39        (WebCore::PaymentRequest::shippingOptionChanged):
     40        (WebCore::PaymentRequest::paymentMethodChanged):
     41
     42        Used whenDetailsSettled() to ensure that update events do not start before the show()
     43        details promise settles.
     44
     45        (WebCore::PaymentRequest::updateWith):
     46        (WebCore::PaymentRequest::settleDetailsPromise):
     47
     48        Changed to use a PaymentRequest::UpdateReason instead of a eventType string.
     49
     50        (WebCore::PaymentRequest::whenDetailsSettled):
     51
     52        If there is a details promise, wait for it to settle before executing the callback.
     53
     54        * Modules/paymentrequest/PaymentRequest.h:
     55
     56        Defined enum class UpdateReason.
     57
     58        * Modules/paymentrequest/PaymentRequest.idl:
     59
     60        Updated show() to take an optional Promise<PaymentDetailsUpdate>.
     61
     62        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
     63        (WebCore::PaymentRequestUpdateEvent::updateWith):
     64
     65        Map the event type to a PaymentRequest::UpdateReason.
     66
    1672018-02-06  Dean Jackson  <dino@apple.com>
    268
  • trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp

    r226766 r228195  
    11/*
    2  * Copyright (C) 2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    308308}
    309309
    310 ExceptionOr<void> ApplePayPaymentHandler::detailsUpdated(const AtomicString& eventType, const String& error)
    311 {
    312     if (eventType == eventNames().shippingaddresschangeEvent)
     310ExceptionOr<void> ApplePayPaymentHandler::detailsUpdated(PaymentRequest::UpdateReason reason, const String& error)
     311{
     312    using Reason = PaymentRequest::UpdateReason;
     313    switch (reason) {
     314    case Reason::ShowDetailsResolved:
     315        return { };
     316    case Reason::ShippingAddressChanged:
    313317        return shippingAddressUpdated(error);
    314 
    315     if (eventType == eventNames().shippingoptionchangeEvent)
     318    case Reason::ShippingOptionChanged:
    316319        return shippingOptionUpdated();
     320    case Reason::PaymentMethodChanged:
     321        return paymentMethodUpdated();
     322    }
    317323
    318324    ASSERT_NOT_REACHED();
     
    339345ExceptionOr<void> ApplePayPaymentHandler::shippingAddressUpdated(const String& error)
    340346{
     347    ASSERT(m_isUpdating);
     348    m_isUpdating = false;
     349
    341350    ShippingContactUpdate update;
    342351
     
    359368ExceptionOr<void> ApplePayPaymentHandler::shippingOptionUpdated()
    360369{
     370    ASSERT(m_isUpdating);
     371    m_isUpdating = false;
     372
    361373    ShippingMethodUpdate update;
    362374
     
    372384ExceptionOr<void> ApplePayPaymentHandler::paymentMethodUpdated()
    373385{
     386    ASSERT(m_isUpdating);
     387    m_isUpdating = false;
     388
    374389    PaymentMethodUpdate update;
    375390
     
    428443void ApplePayPaymentHandler::didAuthorizePayment(const Payment& payment)
    429444{
     445    ASSERT(!m_isUpdating);
     446
    430447    auto applePayPayment = payment.toApplePayPayment(version());
    431448    auto& execState = *document().execState();
     
    438455void ApplePayPaymentHandler::didSelectShippingMethod(const ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod)
    439456{
     457    ASSERT(!m_isUpdating);
     458    m_isUpdating = true;
     459
    440460    m_paymentRequest->shippingOptionChanged(shippingMethod.identifier);
    441461}
     
    443463void ApplePayPaymentHandler::didSelectShippingContact(const PaymentContact& shippingContact)
    444464{
     465    ASSERT(!m_isUpdating);
     466    m_isUpdating = true;
     467
    445468    m_paymentRequest->shippingAddressChanged(convert(shippingContact.toApplePayPaymentContact(version())));
    446469}
     
    448471void ApplePayPaymentHandler::didSelectPaymentMethod(const PaymentMethod& paymentMethod)
    449472{
     473    ASSERT(!m_isUpdating);
     474    m_isUpdating = true;
     475
    450476    m_selectedPaymentMethodType = paymentMethod.toApplePayPaymentMethod().type;
    451     paymentMethodUpdated();
     477    m_paymentRequest->paymentMethodChanged();
    452478}
    453479
  • trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h

    r226766 r228195  
    11/*
    2  * Copyright (C) 2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6464    void hide() final;
    6565    void canMakePayment(WTF::Function<void(bool)>&& completionHandler) final;
    66     ExceptionOr<void> detailsUpdated(const AtomicString& eventType, const String& error) final;
     66    ExceptionOr<void> detailsUpdated(PaymentRequest::UpdateReason, const String& error) final;
    6767    ExceptionOr<void> merchantValidationCompleted(JSC::JSValue&&) final;
    6868    void complete(std::optional<PaymentComplete>&&) final;
     
    8181    std::optional<ApplePayRequest> m_applePayRequest;
    8282    std::optional<ApplePayPaymentMethodType> m_selectedPaymentMethodType;
     83    bool m_isUpdating { false };
    8384};
    8485
  • trunk/Source/WebCore/Modules/paymentrequest/PaymentHandler.h

    r226766 r228195  
    11/*
    2  * Copyright (C) 2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5050    virtual void hide() = 0;
    5151    virtual void canMakePayment(WTF::Function<void(bool)>&& completionHandler) = 0;
    52     virtual ExceptionOr<void> detailsUpdated(const AtomicString& eventType, const String& error) = 0;
     52    virtual ExceptionOr<void> detailsUpdated(PaymentRequest::UpdateReason, const String& error) = 0;
    5353    virtual ExceptionOr<void> merchantValidationCompleted(JSC::JSValue&&) = 0;
    5454    virtual void complete(std::optional<PaymentComplete>&&) = 0;
  • trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp

    r227277 r228195  
    11/*
    2  * Copyright (C) 2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    381381
    382382// https://www.w3.org/TR/payment-request/#show()-method
    383 void PaymentRequest::show(Document& document, ShowPromise&& promise)
     383void PaymentRequest::show(Document& document, RefPtr<DOMPromise>&& detailsPromise, ShowPromise&& promise)
    384384{
    385385    if (!document.frame()) {
     
    443443    m_activePaymentHandler = WTFMove(selectedPaymentHandler);
    444444    setPendingActivity(this); // unsetPendingActivity() is called below in stop()
     445
     446    if (!detailsPromise)
     447        return;
     448
     449    exception = updateWith(UpdateReason::ShowDetailsResolved, detailsPromise.releaseNonNull());
     450    ASSERT(!exception.hasException());
    445451}
    446452
     
    532538void PaymentRequest::shippingAddressChanged(Ref<PaymentAddress>&& shippingAddress)
    533539{
    534     ASSERT(m_state == State::Interactive);
    535     m_shippingAddress = WTFMove(shippingAddress);
    536     if (m_isUpdating)
    537         return;
    538     dispatchEvent(PaymentRequestUpdateEvent::create(eventNames().shippingaddresschangeEvent, *this));
     540    whenDetailsSettled([this, protectedThis = makeRefPtr(this), shippingAddress = makeRefPtr(shippingAddress.get())]() mutable {
     541        m_shippingAddress = WTFMove(shippingAddress);
     542        dispatchEvent(PaymentRequestUpdateEvent::create(eventNames().shippingaddresschangeEvent, *this));
     543    });
    539544}
    540545
    541546void PaymentRequest::shippingOptionChanged(const String& shippingOption)
    542547{
    543     ASSERT(m_state == State::Interactive);
    544     m_shippingOption = shippingOption;
    545     if (m_isUpdating)
    546         return;
    547     dispatchEvent(PaymentRequestUpdateEvent::create(eventNames().shippingoptionchangeEvent, *this));
    548 }
    549 
    550 ExceptionOr<void> PaymentRequest::updateWith(Event& event, Ref<DOMPromise>&& promise)
     548    whenDetailsSettled([this, protectedThis = makeRefPtr(this), shippingOption]() mutable {
     549        m_shippingOption = shippingOption;
     550        dispatchEvent(PaymentRequestUpdateEvent::create(eventNames().shippingoptionchangeEvent, *this));
     551    });
     552}
     553
     554void PaymentRequest::paymentMethodChanged()
     555{
     556    whenDetailsSettled([this, protectedThis = makeRefPtr(this)] {
     557        m_activePaymentHandler->detailsUpdated(UpdateReason::PaymentMethodChanged, { });
     558    });
     559}
     560
     561ExceptionOr<void> PaymentRequest::updateWith(UpdateReason reason, Ref<DOMPromise>&& promise)
    551562{
    552563    if (m_state != State::Interactive)
     
    556567        return Exception { InvalidStateError };
    557568
    558     event.stopPropagation();
    559     event.stopImmediatePropagation();
    560569    m_isUpdating = true;
    561570
     571    ASSERT(!m_detailsPromise);
    562572    m_detailsPromise = WTFMove(promise);
    563     m_detailsPromise->whenSettled([this, protectedThis = makeRefPtr(this), type = event.type()]() {
    564         settleDetailsPromise(type);
     573    m_detailsPromise->whenSettled([this, protectedThis = makeRefPtr(this), reason]() {
     574        settleDetailsPromise(reason);
    565575    });
    566576
     
    596606}
    597607
    598 void PaymentRequest::settleDetailsPromise(const AtomicString& type)
     608void PaymentRequest::settleDetailsPromise(UpdateReason reason)
    599609{
    600610    auto scopeExit = makeScopeExit([&] {
    601611        m_isUpdating = false;
     612        m_detailsPromise = nullptr;
    602613    });
    603614
     
    642653    m_serializedModifierData = WTFMove(std::get<1>(shippingOptionAndModifierData));
    643654
    644     auto result = m_activePaymentHandler->detailsUpdated(type, paymentDetailsUpdate.error);
     655    auto result = m_activePaymentHandler->detailsUpdated(reason, paymentDetailsUpdate.error);
    645656    if (result.hasException()) {
    646657        abortWithException(result.releaseException());
    647658        return;
    648659    }
     660}
     661
     662void PaymentRequest::whenDetailsSettled(std::function<void()>&& callback)
     663{
     664    if (!m_detailsPromise) {
     665        ASSERT(m_state == State::Interactive);
     666        ASSERT(!m_isUpdating);
     667        callback();
     668        return;
     669    }
     670
     671    m_detailsPromise->whenSettled([this, protectedThis = makeRefPtr(this), callback = WTFMove(callback)] {
     672        if (m_state != State::Interactive)
     673            return;
     674
     675        ASSERT(!m_isUpdating);
     676        callback();
     677    });
    649678}
    650679
  • trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.h

    r226766 r228195  
    11/*
    2  * Copyright (C) 2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4646enum class PaymentComplete;
    4747enum class PaymentShippingType;
     48struct PaymentDetailsUpdate;
    4849struct PaymentMethodData;
    4950
    5051class PaymentRequest final : public RefCounted<PaymentRequest>, public ActiveDOMObject, public EventTargetWithInlineData {
    5152public:
    52     using ShowPromise = DOMPromiseDeferred<IDLInterface<PaymentResponse>>;
    5353    using AbortPromise = DOMPromiseDeferred<void>;
    5454    using CanMakePaymentPromise = DOMPromiseDeferred<IDLBoolean>;
     55    using ShowPromise = DOMPromiseDeferred<IDLInterface<PaymentResponse>>;
    5556
    5657    static ExceptionOr<Ref<PaymentRequest>> create(Document&, Vector<PaymentMethodData>&&, PaymentDetailsInit&&, PaymentOptions&&);
    5758    ~PaymentRequest();
    5859
    59     void show(Document&, ShowPromise&&);
     60    void show(Document&, RefPtr<DOMPromise>&& detailsPromise, ShowPromise&&);
    6061    ExceptionOr<void> abort(AbortPromise&&);
    6162    void canMakePayment(Document&, CanMakePaymentPromise&&);
     
    7273    };
    7374
     75    enum class UpdateReason {
     76        ShowDetailsResolved,
     77        ShippingAddressChanged,
     78        ShippingOptionChanged,
     79        PaymentMethodChanged,
     80    };
     81
    7482    State state() const { return m_state; }
    7583
     
    8088    void shippingAddressChanged(Ref<PaymentAddress>&&);
    8189    void shippingOptionChanged(const String& shippingOption);
    82     ExceptionOr<void> updateWith(Event&, Ref<DOMPromise>&&);
     90    void paymentMethodChanged();
     91    ExceptionOr<void> updateWith(UpdateReason, Ref<DOMPromise>&&);
    8392    ExceptionOr<void> completeMerchantValidation(Event&, Ref<DOMPromise>&&);
    8493    void accept(const String& methodName, JSC::Strong<JSC::JSObject>&& details, Ref<PaymentAddress>&& shippingAddress, const String& payerName, const String& payerEmail, const String& payerPhone);
     
    98107    PaymentRequest(Document&, PaymentOptions&&, PaymentDetailsInit&&, Vector<String>&& serializedModifierData, Vector<Method>&& serializedMethodData, String&& selectedShippingOption);
    99108
    100     void settleDetailsPromise(const AtomicString& type);
     109    void settleDetailsPromise(UpdateReason);
     110    void whenDetailsSettled(std::function<void()>&&);
    101111    void abortWithException(Exception&&);
    102112
  • trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl

    r226766 r228195  
    11/*
    2  * Copyright (C) 2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131    ConstructorMayThrowException,
    3232    EnabledBySetting=PaymentRequest,
    33     SecureContext
     33    SecureContext,
    3434] interface PaymentRequest : EventTarget {
    35     [CallWith=Document] Promise<PaymentResponse> show();
     35    [CallWith=Document] Promise<PaymentResponse> show(optional Promise<PaymentDetailsUpdate> detailsPromise);
    3636    [MayThrowException] Promise<void> abort();
    3737    [CallWith=Document] Promise<boolean> canMakePayment();
  • trunk/Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEvent.cpp

    r223945 r228195  
    11/*
    2  * Copyright (C) 2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5454        return Exception { InvalidStateError };
    5555
    56     auto exception = m_paymentRequest->updateWith(*this, WTFMove(detailsPromise));
     56    stopPropagation();
     57    stopImmediatePropagation();
     58
     59    PaymentRequest::UpdateReason reason;
     60    if (type() == eventNames().shippingaddresschangeEvent)
     61        reason = PaymentRequest::UpdateReason::ShippingAddressChanged;
     62    else if (type() == eventNames().shippingoptionchangeEvent)
     63        reason = PaymentRequest::UpdateReason::ShippingOptionChanged;
     64    else {
     65        ASSERT_NOT_REACHED();
     66        return Exception { TypeError };
     67    }
     68
     69    auto exception = m_paymentRequest->updateWith(reason, WTFMove(detailsPromise));
    5770    if (exception.hasException())
    5871        return exception.releaseException();
Note: See TracChangeset for help on using the changeset viewer.