REGRESSION (r217078): window.ApplePaySession is undefined on macOS Sierra
[WebKit-https.git] / Source / WebCore / Modules / applepay / ApplePaySession.idl
index ca2fbf2..13fb5a9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,7 +27,7 @@
     ActiveDOMObject,
     Conditional=APPLE_PAY,
     Constructor(unsigned long version, ApplePayPaymentRequest paymentRequest),
-    ConstructorCallWith=ScriptState&Document,
+    ConstructorCallWith=Document,
     ConstructorMayThrowException,
     EnabledBySetting=ApplePay,
 ] interface ApplePaySession : EventTarget {
     [MayThrowException] void begin();
     [MayThrowException] void abort();
     [MayThrowException, CallWith=ScriptState] void completeMerchantValidation(any merchantSession);
+    [MayThrowException, Conditional=APPLE_PAY_DELEGATE] void completeShippingMethodSelection(ApplePayShippingMethodUpdate update);
+    [MayThrowException, Conditional=APPLE_PAY_DELEGATE] void completeShippingContactSelection(ApplePayShippingContactUpdate update);
+    [MayThrowException, Conditional=APPLE_PAY_DELEGATE] void completePaymentMethodSelection(ApplePayPaymentMethodUpdate update);
+    [MayThrowException, Conditional=APPLE_PAY_DELEGATE] void completePayment(ApplePayPaymentAuthorizationResult result);
+
     [MayThrowException] void completeShippingMethodSelection(unsigned short status, ApplePayLineItem newTotal, sequence<ApplePayLineItem> newLineItems);
     [MayThrowException] void completeShippingContactSelection(unsigned short status, sequence<ApplePayShippingMethod> newShippingMethods, ApplePayLineItem newTotal, sequence<ApplePayLineItem> newLineItems);
     [MayThrowException] void completePaymentMethodSelection(ApplePayLineItem newTotal, sequence<ApplePayLineItem> newLineItems);
     attribute EventHandler onshippingcontactselected;
     attribute EventHandler oncancel;
 };
-
-enum ApplePayMerchantCapability {
-    "supports3DS",
-    "supportsEMV",
-    "supportsCredit",
-    "supportsDebit"
-};
-
-enum ApplePayContactField {
-    "email",
-    "name",
-    "phone",
-    "postalAddress"
-};
-
-enum ApplePayShippingType {
-    "shipping",
-    "delivery",
-    "storePickup",
-    "servicePickup"
-};
-
-dictionary ApplePayShippingMethod {
-    required DOMString label;
-    required DOMString detail;
-    required DOMString amount;
-    required DOMString identifier;
-};
-
-enum ApplePayLineItemType {
-    "pending",
-    "final"
-};
-
-dictionary ApplePayLineItem {
-    ApplePayLineItemType type = "final";
-    DOMString label;
-    DOMString amount;
-};
-
-dictionary ApplePayPaymentRequest {
-    required ApplePayLineItem total;
-    sequence<ApplePayLineItem> lineItems;
-
-    required sequence<ApplePayMerchantCapability> merchantCapabilities;
-    required sequence<DOMString> supportedNetworks; // FIXME: Should this be an sequence of enums?
-    required DOMString countryCode;
-    required DOMString currencyCode;
-
-    sequence<ApplePayContactField> requiredBillingContactFields;
-    object billingContact;
-
-    sequence<ApplePayContactField> requiredShippingContactFields;
-    object shippingContact;
-
-    ApplePayShippingType shippingType = "shipping";
-    sequence<ApplePayShippingMethod> shippingMethods;
-
-    DOMString applicationData;
-};