webapprt/test/chrome/mozpay.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/webapprt/test/chrome/mozpay.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +  <head>
     1.7 +    <meta charset="utf-8">
     1.8 +  </head>
     1.9 +  <body>
    1.10 +    <script>
    1.11 +    // Payload
    1.12 +    //  {
    1.13 +    //    "aud": "mockpayprovider.phpfogapp.com",
    1.14 +    //    "iss": "Enter you app key here!",
    1.15 +    //    "request": {
    1.16 +    //      "name": "Piece of Cake",
    1.17 +    //      "price": "10.50",
    1.18 +    //      "priceTier": 1,
    1.19 +    //      "productdata": "transaction_id=86",
    1.20 +    //      "currencyCode": "USD",
    1.21 +    //      "description": "Virtual chocolate cake to fill your virtual tummy"
    1.22 +    //    },
    1.23 +    //    "exp": 1352232792,
    1.24 +    //    "iat": 1352229192,
    1.25 +    //    "typ": "mock/payments/inapp/v1"
    1.26 +    //  }
    1.27 +    var jwt = "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJhdWQiOiAibW9j" +
    1.28 +              "a3BheXByb3ZpZGVyLnBocGZvZ2FwcC5jb20iLCAiaXNzIjogIkVudGVyI" +
    1.29 +              "HlvdSBhcHAga2V5IGhlcmUhIiwgInJlcXVlc3QiOiB7Im5hbWUiOiAiUG" +
    1.30 +              "llY2Ugb2YgQ2FrZSIsICJwcmljZSI6ICIxMC41MCIsICJwcmljZVRpZXI" +
    1.31 +              "iOiAxLCAicHJvZHVjdGRhdGEiOiAidHJhbnNhY3Rpb25faWQ9ODYiLCAi" +
    1.32 +              "Y3VycmVuY3lDb2RlIjogIlVTRCIsICJkZXNjcmlwdGlvbiI6ICJWaXJ0d" +
    1.33 +              "WFsIGNob2NvbGF0ZSBjYWtlIHRvIGZpbGwgeW91ciB2aXJ0dWFsIHR1bW" +
    1.34 +              "15In0sICJleHAiOiAxMzUyMjMyNzkyLCAiaWF0IjogMTM1MjIyOTE5Miw" +
    1.35 +              "gInR5cCI6ICJtb2NrL3BheW1lbnRzL2luYXBwL3YxIn0.QZxc62USCy4U" +
    1.36 +              "IyKIC1TKelVhNklvk-Ou1l_daKntaFI";
    1.37 +
    1.38 +    var request = navigator.mozPay(jwt);
    1.39 +    request.onsuccess = function onsuccess() {
    1.40 +      document.getElementById("msg").textContent = "Success.";
    1.41 +    };
    1.42 +    request.onerror = function onerror() {
    1.43 +      document.getElementById("msg").textContent = request.error.name;
    1.44 +    };
    1.45 +    </script>
    1.46 +    <p id="msg">Webapp waiting to be paid...</p>
    1.47 +  </body>
    1.48 +</html>

mercurial