ApplePaySession.idl [plain text]
[
ActiveDOMObject,
Conditional=APPLE_PAY,
Constructor(unsigned long version, Dictionary paymentRequest),
ConstructorCallWith=Document,
ConstructorRaisesException,
EnabledBySetting=ApplePay,
] interface ApplePaySession : EventTarget {
const unsigned short STATUS_SUCCESS = 0;
const unsigned short STATUS_FAILURE = 1;
const unsigned short STATUS_INVALID_BILLING_POSTAL_ADDRESS = 2;
const unsigned short STATUS_INVALID_SHIPPING_POSTAL_ADDRESS = 3;
const unsigned short STATUS_INVALID_SHIPPING_CONTACT = 4;
const unsigned short STATUS_PIN_REQUIRED = 5;
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, RaisesException] static Promise 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);
attribute EventHandler onvalidatemerchant;
attribute EventHandler onpaymentmethodselected;
attribute EventHandler onpaymentauthorized;
attribute EventHandler onshippingmethodselected;
attribute EventHandler onshippingcontactselected;
attribute EventHandler oncancel;
};