Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for phone and email #174

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions specs/paymentrequest.html
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,8 @@ <h2>PaymentDetails dictionary</h2>
<h2>PaymentOptions dictionary</h2>
<pre class="idl">
dictionary PaymentOptions {
boolean requestPayerEmail = false;
boolean requestPayerPhone = false;
boolean requestShipping = false;
};
</pre>
Expand All @@ -700,14 +702,24 @@ <h2>PaymentOptions dictionary</h2>
The following fields MAY be passed to the <a><code>PaymentRequest</code></a> constructor:
</p>
<dl>
<dt><code><dfn>requestPayerEmail</dfn></code></dt>
<dd>
This <em>boolean</em> value indicates whether the <a>user agent</a> should collect and return
the payer's email address as part of the payment request. For example, this would be set to
<code>true</code> to allow a merchant to email a receipt.
</dd>
<dt><code><dfn>requestPayerPhone</dfn></code></dt>
<dd>
This <em>boolean</em> value indicates whether the <a>user agent</a> should collect and return
the payer's phone number as part of the payment request. For example, this would be set to
<code>true</code> to allow a merchant to phone a customer with a billing enquiry.
</dd>
<dt><code><dfn>requestShipping</dfn></code></dt>
<dd>
This <em>boolean</em> value indicates whether the <a>user agent</a> should collect and return
a shipping address as part of the payment request. For example, this would be set to
<code>true</code> when physical goods need to be shipped by the merchant to the user.
This would be set to <code>false</code> for an online-only electronic purchase transaction.
If this value is not supplied then the <a><code>PaymentRequest</code></a> behaves as
if a value of <code>false</code> had been supplied.
</dd>
</dl>
</section>
Expand Down Expand Up @@ -760,6 +772,7 @@ <h2>ShippingAddress interface</h2>
readonly attribute DOMString languageCode;
readonly attribute DOMString organization;
readonly attribute DOMString recipient;
readonly attribute DOMString phone;
};
</pre>
<dl>
Expand Down Expand Up @@ -788,6 +801,8 @@ <h2>ShippingAddress interface</h2>
<dd>This is the organization, firm, company, or institution at this address.</dd>
<dt><code>recipient</code></dt>
<dd>This is the name of the recipient or contact person.</dd>
<dt><code>phone</code></dt>
<dd>This is the phone number of the recipient or contact person.</dd>
</dl>
<p>
If the <a>requestShipping</a> flag was set to <code>true</code> in the <a>PaymentOptions</a>
Expand Down Expand Up @@ -842,6 +857,8 @@ <h2>PaymentResponse interface</h2>
readonly attribute DOMString methodName;
readonly attribute object details;
readonly attribute ShippingAddress? shippingAddress;
readonly attribute DOMString? payerEmail;
readonly attribute DOMString? payerPhone;

Promise&lt;void&gt; complete(optional PaymentComplete result = "");
};
Expand Down Expand Up @@ -869,6 +886,18 @@ <h2>PaymentResponse interface</h2>
passed to the <a>PaymentRequest</a> constructor, then <a><code>shippingAddress</code></a> will
be the full and final shipping address chosen by the user.
</dd>
<dt><code><dfn>payerEmail</dfn></code></dt>
<dd>
If the <a>requestPayerEmail</a> flag was set to <code>true</code> in the <a>PaymentOptions</a>
passed to the <a>PaymentRequest</a> constructor, then <a><code>payerEmail</code></a> will
be the email address chosen by the user.
</dd>
<dt><code><dfn>payerPhone</dfn></code></dt>
<dd>
If the <a>requestPayerPhone</a> flag was set to <code>true</code> in the <a>PaymentOptions</a>
passed to the <a>PaymentRequest</a> constructor, then <a><code>payerPhone</code></a> will
be the phone number chosen by the user.
</dd>
</dl>

<section>
Expand Down Expand Up @@ -1230,6 +1259,21 @@ <h2>User accepts the payment request algorithm</h2>
the transaction. The format of this response will be defined by a <a>Payment Transaction
Message Specification</a>.
</li>
<li>
If the <code>requestShipping</code> value of <em>request</em>@[[\options]]
is <code>true</code>, then copy the <code>shippingAddress</code> attribute of
<em>request</em> to the <code>shippingAddress</code> attribute of <em>response</em>.
</li>
<li>
If the <code>requestPayerEmail</code> value of <em>request</em>@[[\options]]
is <code>true</code>, then set the <code>payerEmail</code> attribute of
<em>response</em> to the payer's email address selected by the user.
</li>
<li>
If the <code>requestPayerPhone</code> value of <em>request</em>@[[\options]]
is <code>true</code>, then set the <code>payerPhone</code> attribute of
<em>response</em> to the payer's phone number selected by the user.
</li>
<li>
Set <em>response</em>@[[\completeCalled]] to <em>false</em>.
</li>
Expand Down