browser/components/payments/res/paymentRequest.xhtml
author Jared Wein <jwein@mozilla.com>
Thu, 10 May 2018 15:12:01 -0400
changeset 419310 02cc06146058af4f5332d288fd169edd1f2c77a3
parent 418965 8cb17cd65c9c3a258cac7976ecd2a878c3608a04
child 419602 0c068d19e681686c618876063839555f78a5b1b4
permissions -rw-r--r--
Bug 1429180 - Option to use a new billing address when adding a new payment method. r=MattN MozReview-Commit-ID: 5LrpUw1LdT3

<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html [
  <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
  %globalDTD;

  <!ENTITY viewAllItems               "View All Items">
  <!ENTITY paymentSummaryTitle        "Your Payment">
  <!ENTITY shippingAddressLabel       "Shipping Address">
  <!ENTITY deliveryAddressLabel       "Delivery Address">
  <!ENTITY pickupAddressLabel         "Pickup Address">
  <!ENTITY shippingOptionsLabel       "Shipping Options">
  <!ENTITY paymentMethodsLabel        "Payment Method">
  <!ENTITY address.addLink.label      "Add">
  <!ENTITY address.editLink.label     "Edit">
  <!ENTITY basicCard.addLink.label    "Add">
  <!ENTITY basicCard.editLink.label   "Edit">
  <!ENTITY payer.addLink.label        "Add">
  <!ENTITY payer.editLink.label       "Edit">
  <!ENTITY shippingAddress.addPage.title  "Add Shipping Address">
  <!ENTITY shippingAddress.editPage.title "Edit Shipping Address">
  <!ENTITY deliveryAddress.addPage.title  "Add Delivery Address">
  <!ENTITY deliveryAddress.editPage.title "Edit Delivery Address">
  <!ENTITY pickupAddress.addPage.title    "Add Pickup Address">
  <!ENTITY pickupAddress.editPage.title   "Edit Pickup Address">
  <!ENTITY billingAddress.addPage.title   "Add Billing Address">
  <!ENTITY billingAddress.editPage.title  "Edit Billing Address">
  <!ENTITY basicCard.addPage.title    "Add Credit Card">
  <!ENTITY basicCard.editPage.title   "Edit Credit Card">
  <!ENTITY payer.addPage.title        "Add Payer Contact">
  <!ENTITY payer.editPage.title       "Edit Payer Contact">
  <!ENTITY payerLabel                 "Contact Information">
  <!ENTITY cancelPaymentButton.label   "Cancel">
  <!ENTITY approvePaymentButton.label  "Pay">
  <!ENTITY processingPaymentButton.label "Processing">
  <!ENTITY successPaymentButton.label    "Done">
  <!ENTITY failPaymentButton.label       "Fail">
  <!ENTITY unknownPaymentButton.label    "Unknown">
  <!ENTITY orderDetailsLabel          "Order Details">
  <!ENTITY orderTotalLabel            "Total">
  <!ENTITY basicCardPage.error.genericSave    "There was an error saving the payment card.">
  <!ENTITY basicCardPage.addressAddLink.label "Add">
  <!ENTITY basicCardPage.addressEditLink.label "Edit">
  <!ENTITY basicCardPage.backButton.label     "Back">
  <!ENTITY basicCardPage.saveButton.label     "Save">
  <!ENTITY basicCardPage.persistCheckbox.label     "Save credit card to Firefox (Security code will not be saved)">
  <!ENTITY addressPage.error.genericSave      "There was an error saving the address.">
  <!ENTITY addressPage.cancelButton.label     "Cancel">
  <!ENTITY addressPage.backButton.label       "Back">
  <!ENTITY addressPage.saveButton.label       "Save">
  <!ENTITY addressPage.persistCheckbox.label  "Save address to Firefox">
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>&paymentSummaryTitle;</title>

  <!-- chrome: is needed for global.dtd -->
  <meta http-equiv="Content-Security-Policy" content="default-src 'self' chrome:"/>

  <link rel="stylesheet" href="paymentRequest.css"/>
  <link rel="stylesheet" href="components/rich-select.css"/>
  <link rel="stylesheet" href="components/address-option.css"/>
  <link rel="stylesheet" href="components/basic-card-option.css"/>
  <link rel="stylesheet" href="components/shipping-option.css"/>
  <link rel="stylesheet" href="components/payment-details-item.css"/>
  <link rel="stylesheet" href="containers/address-form.css"/>
  <link rel="stylesheet" href="containers/order-details.css"/>

  <script src="unprivileged-fallbacks.js"></script>

  <script src="formautofill/autofillEditForms.js"></script>

  <script type="module" src="containers/payment-dialog.js"></script>
  <script type="module" src="paymentRequest.js"></script>

  <template id="payment-dialog-template">
    <header>
      <div id="total">
        <h2 class="label"></h2>
        <currency-amount></currency-amount>
        <div id="host-name"></div>
      </div>
      <div id="top-buttons" >
        <button id="view-all" class="closed">&viewAllItems;</button>
      </div>
    </header>

    <div id="main-container">
      <section id="payment-summary" class="page">
        <h1>&paymentSummaryTitle;</h1>

        <section>
          <div id="error-text"></div>

          <div class="shipping-related"
               id="shipping-type-label"
               data-shipping-address-label="&shippingAddressLabel;"
               data-delivery-address-label="&deliveryAddressLabel;"
               data-persist-checkbox-label="&addressPage.persistCheckbox.label;"
               data-pickup-address-label="&pickupAddressLabel;"><label></label></div>
          <address-picker class="shipping-related"
                          data-add-link-label="&address.addLink.label;"
                          data-edit-link-label="&address.editLink.label;"
                          selected-state-key="selectedShippingAddress"></address-picker>

          <div class="shipping-related"><label>&shippingOptionsLabel;</label></div>
          <shipping-option-picker class="shipping-related"></shipping-option-picker>

          <div><label>&paymentMethodsLabel;</label></div>
          <payment-method-picker selected-state-key="selectedPaymentCard"
                                 data-add-link-label="&basicCard.addLink.label;"
                                 data-edit-link-label="&basicCard.editLink.label;">
          </payment-method-picker>

          <div class="payer-related"><label>&payerLabel;</label></div>
          <address-picker class="payer-related"
                          data-add-link-label="&payer.addLink.label;"
                          data-edit-link-label="&payer.editLink.label;"
                          selected-state-key="selectedPayerAddress"></address-picker>
          <div id="error-text"></div>
        </section>

        <footer id="controls-container">
          <button id="cancel">&cancelPaymentButton.label;</button>
          <button id="pay"
                  data-initial-label="&approvePaymentButton.label;"
                  data-processing-label="&processingPaymentButton.label;"
                  data-fail-label="&failPaymentButton.label;"
                  data-unknown-label="&unknownPaymentButton.label;"
                  data-success-label="&successPaymentButton.label;"></button>
        </footer>
      </section>
      <section id="order-details-overlay" hidden="hidden">
        <h1>&orderDetailsLabel;</h1>
        <order-details></order-details>
      </section>

      <basic-card-form id="basic-card-page"
                       class="page"
                       data-add-basic-card-title="&basicCard.addPage.title;"
                       data-edit-basic-card-title="&basicCard.editPage.title;"
                       data-error-generic-save="&basicCardPage.error.genericSave;"
                       data-address-add-link-label="&basicCardPage.addressAddLink.label;"
                       data-address-edit-link-label="&basicCardPage.addressEditLink.label;"
                       data-billing-address-title-add="&billingAddress.addPage.title;"
                       data-billing-address-title-edit="&billingAddress.editPage.title;"
                       data-back-button-label="&basicCardPage.backButton.label;"
                       data-save-button-label="&basicCardPage.saveButton.label;"
                       data-cancel-button-label="&cancelPaymentButton.label;"
                       data-persist-checkbox-label="&basicCardPage.persistCheckbox.label;"
                       hidden="hidden"></basic-card-form>

      <address-form id="address-page"
                    class="page"
                    data-error-generic-save="&addressPage.error.genericSave;"
                    data-cancel-button-label="&addressPage.cancelButton.label;"
                    data-back-button-label="&addressPage.backButton.label;"
                    data-save-button-label="&addressPage.saveButton.label;"
                    data-persist-checkbox-label="&addressPage.persistCheckbox.label;"
                    hidden="hidden"></address-form>
    </div>

    <div id="disabled-overlay" hidden="hidden">
      <!-- overlay to prevent changes while waiting for a response from the merchant -->
    </div>
  </template>

  <template id="order-details-template">
    <ul class="main-list"></ul>
    <ul class="footer-items-list"></ul>

    <div class="details-total">
      <h2 class="label">&orderTotalLabel;</h2>
      <currency-amount></currency-amount>
    </div>
  </template>
</head>
<body dir="&locale.dir;">
  <iframe id="debugging-console"
          hidden="hidden"
          height="400"></iframe>
  <payment-dialog data-shipping-address-title-add="&shippingAddress.addPage.title;"
                  data-shipping-address-title-edit="&shippingAddress.editPage.title;"
                  data-delivery-address-title-add="&deliveryAddress.addPage.title;"
                  data-delivery-address-title-edit="&deliveryAddress.editPage.title;"
                  data-pickup-address-title-add="&pickupAddress.addPage.title;"
                  data-pickup-address-title-edit="&pickupAddress.editPage.title;"
                  data-payer-title-add="&payer.addPage.title;"
                  data-payer-title-edit="&payer.editPage.title;"></payment-dialog>
</body>
</html>