From eb62aec2cc6b0be931ffde43c289cb6ed7dcaa35 Mon Sep 17 00:00:00 2001 From: Ade Bateman Date: Thu, 28 Apr 2016 11:25:07 -0700 Subject: [PATCH] Updated examples to reflect changes in recent PRs PRs #158, #160, and #161 made changes that affect the examples. These weren't reflected in original PRs to keep those changes simple and to avoid merge conflicts from changing the same lines in the spec. This changes updates the examples. Also updating the syntax to be consistent and use JavaScript (rather than JSON). Fixes #164. --- specs/paymentrequest.html | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/specs/paymentrequest.html b/specs/paymentrequest.html index 4f405f52..73f5400d 100644 --- a/specs/paymentrequest.html +++ b/specs/paymentrequest.html @@ -264,7 +264,7 @@

PaymentRequest interface

// Process paymentResponse // paymentResponse.methodName contains the selected payment method // paymentResponse.details contains a payment method specific response - paymentResponse.complete(true); + paymentResponse.complete("success"); }).catch(function(err) { console.error("Uh oh, something bad happened", err.message); }); @@ -297,8 +297,8 @@

PaymentRequest constructor

{ supportedMethods: ["bobpay.com"], data: { - "merchantIdentifier": "XXXX", - "bobPaySpecificField": true + merchantIdentifier: "XXXX", + bobPaySpecificField: true } ] @@ -307,23 +307,20 @@

PaymentRequest constructor

user is being asked to complete such as the line items in an order.

             {
-              "items": [
+              displayItems: [
                 {
-                  "id": "basket",
-                  "label": "Sub-total",
-                  "amount": { "currency": "USD", "value" : "55.00" }, // US$55.00
+                  label: "Sub-total",
+                  amount: { currency: "USD", value : "55.00" }, // US$55.00
                 },
                 {
-                  "id": "tax",
-                  "label": "Sales Tax",
-                  "amount": { "currency": "USD", "value" : "5.00" }, // US$5.00
-                },
-                {
-                  "id": "total",
-                  "label": "Total due",
-                  "amount": { "currency": "USD", "value" : "60.00" }, // US$60.00
+                  label: "Sales Tax",
+                  amount: { currency: "USD", value : "5.00" }, // US$5.00
                 }
-              ]
+              ],
+              total:  {
+                label: "Total due",
+                amount: { currency: "USD", value : "60.00" }, // US$60.00
+              }
             }
           
@@ -332,7 +329,7 @@

PaymentRequest constructor

             {
-              "requestShipping": true
+              requestShipping: true
             }