From 94a439659b53d5a96cf7eb14f9b6972424b6e5e0 Mon Sep 17 00:00:00 2001 From: Roy McElmurry Date: Wed, 22 Feb 2017 11:58:02 -0800 Subject: [PATCH 01/14] put request id in details dictionary --- index.html | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index d7a4e77d..24f8fa25 100644 --- a/index.html +++ b/index.html @@ -202,7 +202,6 @@

Promise<void> abort(); Promise<boolean> canMakePayment(); - readonly attribute DOMString? paymentRequestId; readonly attribute PaymentAddress? shippingAddress; readonly attribute DOMString? shippingOption; readonly attribute PaymentShippingType? shippingType; @@ -299,6 +298,7 @@

             const details = {
+              paymentRequestID: "1234567890123",
               displayItems: [
                 {
                   label: "Sub-total",
@@ -455,6 +455,9 @@ 

  • Let serializedModifierData be an empty list. +
  • If details.paymentRequestID was not provided during + construction, populate the field with an [[RFC4122]] UUID. +
  • Process payment details modifiers: @@ -1036,6 +1039,8 @@

             dictionary PaymentDetailsBase {
    +          DOMString paymentRequestID;
    +          PaymentItem total;
               sequence<PaymentItem> displayItems;
               sequence<PaymentShippingOption> shippingOptions;
               sequence<PaymentDetailsModifier> modifiers;
    @@ -1046,6 +1051,29 @@ 

    dictionary:

    +
    + paymentRequestID +
    +
    + paymentRequestID is a freeform identifier for this + payment request. This field is intended to hold a unique + identifier for the purposes of recovering from failures and/or as a + foreign key into other systems. If a paymentRequestID + is not provided by the client then a UUID will be generated and stored + instead. +
    +
    + total +
    +
    + This PaymentItem contains the total amount of the payment + request. +

    + total MUST be a non-negative value. This means that + the total.amount.value field MUST NOT begin with a + U+002D HYPHEN-MINUS character. +

    +
    displayItems
    @@ -1615,7 +1643,6 @@

    interface PaymentResponse { serializer = { attribute }; - readonly attribute DOMString paymentRequestId; readonly attribute DOMString methodName; readonly attribute object details; readonly attribute PaymentAddress? shippingAddress; @@ -1640,13 +1667,6 @@

    "WEBIDL-LS#dfn-convert-to-serialized-value">converted to serialized values as per [[!WEBIDL-LS]]. -
    - paymentRequestId -
    -
    - The same paymentRequestId present in the original - PaymentRequest. -
    methodName
    From 9095b7f3cbecbfb9def6bf9d445c276263247acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 23 Feb 2017 12:23:15 +1100 Subject: [PATCH 02/14] Lowercase d in Id, as per platform conventions --- index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 24f8fa25..5580c4e1 100644 --- a/index.html +++ b/index.html @@ -298,7 +298,7 @@

                 const details = {
    -              paymentRequestID: "1234567890123",
    +              paymentRequestId: "1234567890123",
                   displayItems: [
                     {
                       label: "Sub-total",
    @@ -455,7 +455,7 @@ 

  • Let serializedModifierData be an empty list. -
  • If details.paymentRequestID was not provided during +
  • If details.paymentRequestId was not provided during construction, populate the field with an [[RFC4122]] UUID.
  • @@ -1038,8 +1038,8 @@

    PaymentDetailsBase dictionary

    -        dictionary PaymentDetailsBase {
    -          DOMString paymentRequestID;
    +        dictionary PaymentDetails {
    +          DOMString paymentRequestId;
               PaymentItem total;
               sequence<PaymentItem> displayItems;
               sequence<PaymentShippingOption> shippingOptions;
    @@ -1052,13 +1052,13 @@ 

    - paymentRequestID + paymentRequestId
    - paymentRequestID is a freeform identifier for this + paymentRequestId is a freeform identifier for this payment request. This field is intended to hold a unique identifier for the purposes of recovering from failures and/or as a - foreign key into other systems. If a paymentRequestID + foreign key into other systems. If a paymentRequestId is not provided by the client then a UUID will be generated and stored instead.
    From 32b698f590e7d15e18b24e62f762511b94ba236c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 23 Feb 2017 14:49:02 +1100 Subject: [PATCH 03/14] Add paymentRequestId back in as "id" --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 5580c4e1..927d5235 100644 --- a/index.html +++ b/index.html @@ -202,6 +202,7 @@

    Promise<void> abort(); Promise<boolean> canMakePayment(); + readonly attribute DOMString? id; readonly attribute PaymentAddress? shippingAddress; readonly attribute DOMString? shippingOption; readonly attribute PaymentShippingType? shippingType; From 0b8352e774004fc83b8e8938ec44f68f59979a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 23 Feb 2017 15:10:35 +1100 Subject: [PATCH 04/14] Feat: Add PaymentResponse.requestId --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 927d5235..b5250566 100644 --- a/index.html +++ b/index.html @@ -1644,6 +1644,7 @@

    interface PaymentResponse { serializer = { attribute }; + readonly attribute DOMString requestId; readonly attribute DOMString methodName; readonly attribute object details; readonly attribute PaymentAddress? shippingAddress; From 3efc14e3c4e8c1a66cb70f86e9e50d3dabc5b443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 23 Feb 2017 15:12:44 +1100 Subject: [PATCH 05/14] fix: id is not nullable The payment request Id is either provided by the developer or automagically generated by the UA - hence not nullable right now. --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index b5250566..3447b37c 100644 --- a/index.html +++ b/index.html @@ -202,7 +202,7 @@

    Promise<void> abort(); Promise<boolean> canMakePayment(); - readonly attribute DOMString? id; + readonly attribute DOMString id; readonly attribute PaymentAddress? shippingAddress; readonly attribute DOMString? shippingOption; readonly attribute PaymentShippingType? shippingType; From 6456c619333315b2a11aa941e7846856af2385cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 23 Feb 2017 15:14:11 +1100 Subject: [PATCH 06/14] rename paymentRequestId to just id --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 3447b37c..0c614def 100644 --- a/index.html +++ b/index.html @@ -1040,7 +1040,7 @@

             dictionary PaymentDetails {
    -          DOMString paymentRequestId;
    +          DOMString id;
               PaymentItem total;
               sequence<PaymentItem> displayItems;
               sequence<PaymentShippingOption> shippingOptions;
    
    From a475df5c5028b26b8eec64641cca12a29d495f42 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= 
    Date: Thu, 23 Feb 2017 15:15:56 +1100
    Subject: [PATCH 07/14] fix: use id instead of paymentRequestId
    
    ---
     index.html | 10 +++++-----
     1 file changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/index.html b/index.html
    index 0c614def..c6b5dcc0 100644
    --- a/index.html
    +++ b/index.html
    @@ -299,7 +299,7 @@ 

                 const details = {
    -              paymentRequestId: "1234567890123",
    +              id: "1234567890123",
                   displayItems: [
                     {
                       label: "Sub-total",
    @@ -456,7 +456,7 @@ 

  • Let serializedModifierData be an empty list. -
  • If details.paymentRequestId was not provided during +
  • If details.id was not provided during construction, populate the field with an [[RFC4122]] UUID.
  • @@ -1053,13 +1053,13 @@

    - paymentRequestId + id
    - paymentRequestId is a freeform identifier for this + id is a freeform identifier for this payment request. This field is intended to hold a unique identifier for the purposes of recovering from failures and/or as a - foreign key into other systems. If a paymentRequestId + foreign key into other systems. If a id is not provided by the client then a UUID will be generated and stored instead.
    From 9d3e59f7b9a48c3c82106336937f1e80822f0f58 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Thu, 23 Feb 2017 15:42:48 +1100 Subject: [PATCH 08/14] update text to match discussion --- index.html | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index c6b5dcc0..d6aee709 100644 --- a/index.html +++ b/index.html @@ -344,6 +344,19 @@

  • Let serializedMethodData be an empty list.
  • +
  • Establish the request's id: +
      +
    1. Let requestId be the empty string. +
    2. +
    3. If details.id is present, set requestId + to the value of details.id. Otherwise, set requestId + to a string that uniquely identifies this payment request. It is + RECOMMENDED that the string be a UUID [[!RFC4122]]. +
    4. +
    +
  • Process payment methods:
    1. If the length of the methodData sequence is zero, @@ -456,9 +469,6 @@

  • Let serializedModifierData be an empty list. -
  • If details.id was not provided during - construction, populate the field with an [[RFC4122]] UUID. -
  • Process payment details modifiers: @@ -538,6 +548,8 @@

  • Let request be a new PaymentRequest.
  • +
  • Set request.id to requestId. +
  • Set request.[[\options]] to options.
  • Set request.[[\state]] to "created". @@ -1056,12 +1068,12 @@

    id
    - id is a freeform identifier for this - payment request. This field is intended to hold a unique - identifier for the purposes of recovering from failures and/or as a - foreign key into other systems. If a id - is not provided by the client then a UUID will be generated and stored - instead. + id is a free-form identifier for this payment request. +

    + If a id member is not present, then the UA will generate a + unique identifier for the payment request during construction. +

    total @@ -1740,6 +1752,13 @@

    "PaymentResponse.payerPhone">payerPhone will be the phone number chosen by the user. +
    + requestId +
    +
    + The corresponding payment request id that spawned this payment response. +

  • From d46f8f75fa9372f67fcc017be25f16e462a9943b Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Thu, 23 Feb 2017 15:52:55 +1100 Subject: [PATCH 09/14] Set the response id attribute --- index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.html b/index.html index d6aee709..384a0008 100644 --- a/index.html +++ b/index.html @@ -2368,6 +2368,10 @@

  • Let response be a new PaymentResponse.
  • +
  • Set the requestId + attribute value of response to the value of + request.id. +
  • Set the methodName attribute value of response to the payment method identifier for the payment method that the user selected From 009f63a5ec1c2ff75006090576ef732a96c6621e Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Thu, 23 Feb 2017 17:04:31 +1100 Subject: [PATCH 10/14] use [[requestId]] internal slot instead --- index.html | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index 384a0008..738a3ebd 100644 --- a/index.html +++ b/index.html @@ -346,14 +346,12 @@

  • Establish the request's id:
      -
    1. Let requestId be the empty string. -
    2. -
    3. If details.id is present, set requestId - to the value of details.id. Otherwise, set requestId - to a string that uniquely identifies this payment request. It is - RECOMMENDED that the string be a UUID [[!RFC4122]]. +
    4. If details.id + is missing, set the value of details.id to a string that uniquely identifies + this payment request. It is RECOMMENDED that the string be a + UUID + [[!RFC4122]].
  • @@ -548,8 +546,6 @@

  • Let request be a new PaymentRequest.
  • -
  • Set request.id to requestId. -
  • Set request.[[\options]] to options.
  • Set request.[[\state]] to "created". @@ -597,6 +593,16 @@

  • +
    +

    + id attribute +

    +

    + When getting, the id attribute returns this + PaymentRequest [[\details]].id. +

    +

    show() method @@ -1070,9 +1076,9 @@

    id is a free-form identifier for this payment request.

    - If a id member is not present, then the UA will generate a - unique identifier for the payment request during construction. + If an id member is not present, then the user agent + will generate a unique identifier for the payment request during + construction.

    @@ -2370,7 +2376,8 @@

  • Set the requestId attribute value of response to the value of - request.id. + request.[[\details]].id.
  • Set the methodName attribute value of response to the payment method From aacea2d178dd5c4b41aeb7406f9df514627701a2 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Tue, 28 Feb 2017 12:03:50 +1100 Subject: [PATCH 11/14] Editorial: improve custom details.id usage example --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 738a3ebd..265ee231 100644 --- a/index.html +++ b/index.html @@ -299,7 +299,7 @@

                 const details = {
    -              id: "1234567890123",
    +              id: "super-store-order-123-12312",
                   displayItems: [
                     {
                       label: "Sub-total",
    
    From ef429cb7dd413314084790ddc156aa8c21c76de1 Mon Sep 17 00:00:00 2001
    From: Marcos Caceres 
    Date: Tue, 28 Feb 2017 12:07:58 +1100
    Subject: [PATCH 12/14] editorial: make it clear we are adding an .id member
    
    ---
     index.html | 10 +++++-----
     1 file changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/index.html b/index.html
    index 265ee231..70328cbc 100644
    --- a/index.html
    +++ b/index.html
    @@ -347,11 +347,11 @@ 

  • Establish the request's id:
    1. If details.id - is missing, set the value of details.id to a string that uniquely identifies - this payment request. It is RECOMMENDED that the string be a - UUID - [[!RFC4122]]. + is missing, add an id member + to details and set its value to string that uniquely + identifies this payment request. It is RECOMMENDED that the + string be a UUID [[!RFC4122]].
  • From 8d79319ff501fe842e262f53c2c3e6e592d5cf78 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Tue, 7 Mar 2017 08:32:33 +1100 Subject: [PATCH 13/14] fix rebase issue --- index.html | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 70328cbc..5848df9d 100644 --- a/index.html +++ b/index.html @@ -599,7 +599,7 @@

    When getting, the id attribute returns this - PaymentRequest [[\details]].PaymentRequest's [[\details]].id.

  • @@ -1057,9 +1057,8 @@

    PaymentDetailsBase dictionary

    -        dictionary PaymentDetails {
    +        dictionary PaymentDetailsBase {
               DOMString id;
    -          PaymentItem total;
               sequence<PaymentItem> displayItems;
               sequence<PaymentShippingOption> shippingOptions;
               sequence<PaymentDetailsModifier> modifiers;
    @@ -1081,18 +1080,6 @@ 

    construction.

    -
    - total -
    -
    - This PaymentItem contains the total amount of the payment - request. -

    - total MUST be a non-negative value. This means that - the total.amount.value field MUST NOT begin with a - U+002D HYPHEN-MINUS character. -

    -
    displayItems
    From 113fb6091f52ff6d08a0aeb4f402efe2cd516d46 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Tue, 7 Mar 2017 08:40:03 +1100 Subject: [PATCH 14/14] transplant id to PaymentDetailsInit --- index.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index 5848df9d..106a8eb9 100644 --- a/index.html +++ b/index.html @@ -346,8 +346,8 @@

  • Establish the request's id:
      -
    1. If details.id - is missing, add an id member +
    2. If details.id + is missing, add an id member to details and set its value to string that uniquely identifies this payment request. It is RECOMMENDED that the string be a

      When getting, the id attribute returns this PaymentRequest's [[\details]].id. + "PaymentDetailsInit.id">id.

      @@ -1058,7 +1058,6 @@

               dictionary PaymentDetailsBase {
      -          DOMString id;
                 sequence<PaymentItem> displayItems;
                 sequence<PaymentShippingOption> shippingOptions;
                 sequence<PaymentDetailsModifier> modifiers;
      @@ -1069,17 +1068,6 @@ 

      dictionary:

      -
      - id -
      -
      - id is a free-form identifier for this payment request. -

      - If an id member is not present, then the user agent - will generate a unique identifier for the payment request during - construction. -

      -
      displayItems
      @@ -1151,6 +1139,7 @@

               dictionary PaymentDetailsInit : PaymentDetailsBase {
      +          DOMString id;
                 required PaymentItem total;
               };
             
      @@ -1164,6 +1153,17 @@

      PaymentDetailsInit dictionary:

      +
      + id +
      +
      + id is a free-form identifier for this payment request. +

      + If an id member is not present, then the user agent + will generate a unique identifier for the payment request during + construction. +

      +
      total
      @@ -2364,7 +2364,7 @@

    3. Set the requestId attribute value of response to the value of request.[[\details]].id. + "PaymentDetailsInit.id">id.
    4. Set the methodName attribute value of response to the payment method