Changeset 223215 in webkit


Ignore:
Timestamp:
Oct 11, 2017 5:14:34 PM (7 years ago)
Author:
aestes@apple.com
Message:

[Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact
https://bugs.webkit.org/show_bug.cgi?id=178191
<rdar://problem/34906367>

Reviewed by Tim Horton.

Source/WebCore:

Added test cases to http/tests/ssl/applepay/ApplePaySession.html.

  • Modules/applepay/ApplePayPaymentContact.h:
  • Modules/applepay/ApplePayPaymentContact.idl:
  • Modules/applepay/cocoa/PaymentContactCocoa.mm:

(WebCore::convert):

LayoutTests:

  • http/tests/ssl/applepay/ApplePaySession-expected.txt:
  • http/tests/ssl/applepay/ApplePaySession.html:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r223213 r223215  
     12017-10-11  Andy Estes  <aestes@apple.com>
     2
     3        [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact
     4        https://bugs.webkit.org/show_bug.cgi?id=178191
     5        <rdar://problem/34906367>
     6
     7        Reviewed by Tim Horton.
     8
     9        * http/tests/ssl/applepay/ApplePaySession-expected.txt:
     10        * http/tests/ssl/applepay/ApplePaySession.html:
     11
    1122017-10-11  Youenn Fablet  <youenn@apple.com>
    213
  • trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt

    r220718 r223215  
    261261PASS new ApplePaySession(2, request) did not throw exception.
    262262
     263SETUP: request = validRequest(); request.billingContact = { subLocality: '', subAdministrativeArea: '' };
     264PASS new ApplePaySession(2, request) did not throw exception.
     265
    263266Testing PaymentRequest.requiredShippingContactFields
    264267
     
    322325PASS new ApplePaySession(2, request) did not throw exception.
    323326
     327SETUP: request = validRequest(); request.shippingContact = { subLocality: '', subAdministrativeArea: '' };
     328PASS new ApplePaySession(2, request) did not throw exception.
     329
    324330Testing PaymentRequest.shippingType
    325331
  • trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html

    r220718 r223215  
    149149    logAndShouldNotThrow("request = validRequest(); request.billingContact = undefined;", "new ApplePaySession(2, request)")
    150150    logAndShouldNotThrow("request = validRequest(); request.billingContact = { };", "new ApplePaySession(2, request)")
     151    logAndShouldNotThrow("request = validRequest(); request.billingContact = { subLocality: '', subAdministrativeArea: '' };", "new ApplePaySession(2, request)")
    151152   
    152153    debug("Testing PaymentRequest.requiredShippingContactFields")
     
    175176    logAndShouldNotThrow("request = validRequest(); request.shippingContact = undefined;", "new ApplePaySession(2, request)")
    176177    logAndShouldNotThrow("request = validRequest(); request.shippingContact = { };", "new ApplePaySession(2, request)")
     178    logAndShouldNotThrow("request = validRequest(); request.shippingContact = { subLocality: '', subAdministrativeArea: '' };", "new ApplePaySession(2, request)")
    177179   
    178180    debug("Testing PaymentRequest.shippingType")
  • trunk/Source/WebCore/ChangeLog

    r223213 r223215  
     12017-10-11  Andy Estes  <aestes@apple.com>
     2
     3        [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact
     4        https://bugs.webkit.org/show_bug.cgi?id=178191
     5        <rdar://problem/34906367>
     6
     7        Reviewed by Tim Horton.
     8
     9        Added test cases to http/tests/ssl/applepay/ApplePaySession.html.
     10
     11        * Modules/applepay/ApplePayPaymentContact.h:
     12        * Modules/applepay/ApplePayPaymentContact.idl:
     13        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
     14        (WebCore::convert):
     15
    1162017-10-11  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.h

    r220718 r223215  
    4242    String phoneticFamilyName;
    4343    std::optional<Vector<String>> addressLines;
     44    String subLocality;
    4445    String locality;
    4546    String postalCode;
     47    String subAdministrativeArea;
    4648    String administrativeArea;
    4749    String country;
  • trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.idl

    r220718 r223215  
    3535    [Conditional=APPLE_PAY_SESSION_V3] DOMString phoneticFamilyName;
    3636    sequence<DOMString> addressLines;
     37    DOMString subLocality;
    3738    DOMString locality;
    3839    DOMString postalCode;
     40    DOMString subAdministrativeArea;
    3941    DOMString administrativeArea;
    4042    DOMString country;
  • trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm

    r220718 r223215  
    101101        [address setStreet:builder.toString()];
    102102
     103        if (!contact.subLocality.isEmpty())
     104            [address setSubLocality:contact.subLocality];
    103105        if (!contact.locality.isEmpty())
    104106            [address setCity:contact.locality];
    105107        if (!contact.postalCode.isEmpty())
    106108            [address setPostalCode:contact.postalCode];
     109        if (!contact.subAdministrativeArea.isEmpty())
     110            [address setSubAdministrativeArea:contact.subAdministrativeArea];
    107111        if (!contact.administrativeArea.isEmpty())
    108112            [address setState:contact.administrativeArea];
     
    141145        result.addressLines = WTFMove(addressLines);
    142146    }
     147    result.subLocality = postalAddress.subLocality;
    143148    result.locality = postalAddress.city;
    144149    result.postalCode = postalAddress.postalCode;
     150    result.subAdministrativeArea = postalAddress.subAdministrativeArea;
    145151    result.administrativeArea = postalAddress.state;
    146152    result.country = postalAddress.country;
Note: See TracChangeset for help on using the changeset viewer.