REGRESSION (r217078): window.ApplePaySession is undefined on macOS Sierra
[WebKit-https.git] / Source / WebCore / Modules / applepay / ApplePaySession.idl
index d96843d..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
@@ -26,9 +26,9 @@
 [
     ActiveDOMObject,
     Conditional=APPLE_PAY,
-    Constructor(unsigned long version, Dictionary paymentRequest),
+    Constructor(unsigned long version, ApplePayPaymentRequest paymentRequest),
     ConstructorCallWith=Document,
-    ConstructorRaisesException,
+    ConstructorMayThrowException,
     EnabledBySetting=ApplePay,
 ] interface ApplePaySession : EventTarget {
     const unsigned short STATUS_SUCCESS = 0;
     const unsigned short STATUS_PIN_INCORRECT = 6;
     const unsigned short STATUS_PIN_LOCKOUT = 7;
 
-    [CallWith=ScriptExecutionContext, RaisesException] static boolean supportsVersion(unsigned long version);
-    [CallWith=ScriptExecutionContext, RaisesException] static boolean canMakePayments();
-    [CallWith=ScriptExecutionContext, RaisesException] static Promise canMakePaymentsWithActiveCard(DOMString merchantIdentifier);
+    [CallWith=ScriptExecutionContext, MayThrowException] static boolean supportsVersion(unsigned long version);
+    [CallWith=ScriptExecutionContext, MayThrowException] static boolean canMakePayments();
+    [CallWith=ScriptExecutionContext, MayThrowException] static Promise<boolean> canMakePaymentsWithActiveCard(DOMString merchantIdentifier);
+    [CallWith=ScriptExecutionContext, MayThrowException] static Promise<boolean> openPaymentSetup(DOMString merchantIdentifier);
 
-    [RaisesException] void begin();
-    [RaisesException] void abort();
-    [RaisesException] void completeMerchantValidation(Dictionary merchantSession);
-    [Custom, RaisesException] void completeShippingMethodSelection(unsigned short status, Dictionary newTotal, sequence<Dictionary> newLineItems);
-    [Custom, RaisesException] void completeShippingContactSelection(unsigned short status, sequence<Dictionary> newShippingMethods, Dictionary newTotal, sequence<Dictionary> newLineItems);
-    [Custom, RaisesException] void completePaymentMethodSelection(Dictionary newTotal, sequence<Dictionary> newLineItems);
-    [RaisesException] void completePayment(unsigned short status);
+    [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);
+    [MayThrowException] void completePayment(unsigned short status);
 
     attribute EventHandler onvalidatemerchant;
     attribute EventHandler onpaymentmethodselected;