From 990d2420afbc2fbb41e2dbe20782175ce12a00a6 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 10 Jan 2017 14:30:57 -0500 Subject: [PATCH] Say how we integrate with PaymentRequest This follows https://github.com/w3c/browser-payment-api/pull/382 so that instead of simply defining the dictionaries in this spec, we say how they are used, and how invalid incoming data is processed. (See #20.) --- index.html | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index b792ddd..8dff9fe 100644 --- a/index.html +++ b/index.html @@ -108,7 +108,7 @@ links below). All comments are welcome.

- +

Introduction

@@ -118,14 +118,15 @@

Introduction

The Web Payments Working Group is also investigating payment methods that offer greater security (e.g., through tokenization).

-
-

Dependencies

-

- This specification relies on several other underlying specifications. -

-
+
+

Dependencies

+

+ This specification relies on several other underlying specifications. +

+
Payment Request API
-
The terms PaymentRequest constructor, and PaymentAddress +
The terms PaymentRequest constructor, PaymentAddress, user + accepts the payment request algorithm, and the paymentRequest.show() method are defined by the PaymentRequest API specification [[!PAYMENT-REQUEST-API]].
Payment Method Identifiers
The term Payment @@ -133,6 +134,10 @@

Dependencies

[[!METHOD-IDENTIFIERS]].
Web IDL
The IDL in this specification is defined by Web IDL [[!WEBIDL]].
+
ECMAScript
+
+ The JSON.parse function is defined by [[!ECMA-262]]. +
@@ -180,6 +185,22 @@

BasicCardRequest

+ +
+

Processing incoming payment method data

+ +

When the PaymentRequest API is to pass data to a payment app supporting basic-card as part + of the paymentRequest.show() algorithm, the payment app must process any non-null + incoming data by deserializing it using an algorithm equivalent to that performed by + JSON.parse, and then converting the resulting object to a BasicCardRequest + dictionary.

+ +

If these steps fail, the payment app must report that it does not support the incoming + payment request.

+ +

Otherwise, the payment app may use the fields of the resulting dictionary to determine + whether it supports the payment request, and to carry out the payment process.

+
@@ -195,8 +216,8 @@

BasicCardResponse

required DOMString cardNumber; DOMString expiryMonth; DOMString expiryYear; - DOMString cardSecurityCode; - + DOMString cardSecurityCode; + PaymentAddress? billingAddress; }; @@ -222,6 +243,14 @@

BasicCardResponse

+ +
+

Providing outgoing payment responses

+ +

When the user accepts the payment request algorithm runs in the context of a + payment app supporting basic-card, the payment app must provide back the relevant data in a + BasicCardResponse dictionary.

+