Step by step algorithm
Write the specification for implementers
The PaymentRequest(methodData, details, options) constructor MUST act as follows:
- If the current settings object's responsible document is not allowed to use the "payment" feature, then throw a "SecurityError" DOMException.
- Establish the request's id:
- If details.id is missing, add an id member to details and set its value to a UUID [RFC4122].
- Let serializedMethodData be an empty list.
- Process payment methods:
- If the length of the methodData sequence is zero, then throw a TypeError, optionally informing the developer that at least one payment method is required.