⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 215588 in webkit


Ignore:
Timestamp:
Apr 20, 2017, 4:49:34 PM (9 years ago)
Author:
andersca@apple.com
Message:

Remove one use of toPaymentAuthorizationStatus
https://bugs.webkit.org/show_bug.cgi?id=171086

Reviewed by Tim Horton.

Just switch on the individual ApplePaySession::STATUS_ values.

  • Modules/applepay/ApplePaySession.cpp:

(WebCore::ApplePaySession::completeShippingMethodSelection):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r215585 r215588  
     12017-04-20  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove one use of toPaymentAuthorizationStatus
     4        https://bugs.webkit.org/show_bug.cgi?id=171086
     5
     6        Reviewed by Tim Horton.
     7
     8        Just switch on the individual ApplePaySession::STATUS_ values.
     9
     10        * Modules/applepay/ApplePaySession.cpp:
     11        (WebCore::ApplePaySession::completeShippingMethodSelection):
     12
    1132017-04-20  Fujii Hironori  <Hironori.Fujii@sony.com>
    214
  • trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp

    r215576 r215588  
    800800    ApplePayShippingMethodUpdate update;
    801801
    802     auto authorizationStatus = toPaymentAuthorizationStatus(status);
    803     if (!authorizationStatus)
    804         return Exception { INVALID_ACCESS_ERR };
    805 
    806     if (*authorizationStatus != PaymentAuthorizationStatus::Success) {
     802    switch (status) {
     803    case ApplePaySession::STATUS_SUCCESS:
     804        break;
     805    case ApplePaySession::STATUS_FAILURE:
     806    case ApplePaySession::STATUS_INVALID_BILLING_POSTAL_ADDRESS:
     807    case ApplePaySession::STATUS_INVALID_SHIPPING_POSTAL_ADDRESS:
     808    case ApplePaySession::STATUS_INVALID_SHIPPING_CONTACT:
     809    case ApplePaySession::STATUS_PIN_REQUIRED:
     810    case ApplePaySession::STATUS_PIN_INCORRECT:
     811    case ApplePaySession::STATUS_PIN_LOCKOUT:
    807812        // This is a fatal error. Cancel the request.
    808813        m_state = State::CancelRequested;
    809814        paymentCoordinator().cancelPaymentSession();
    810815        return { };
     816
     817    default:
     818        return Exception { INVALID_ACCESS_ERR };
    811819    }
    812820
Note: See TracChangeset for help on using the changeset viewer.