Skip to content

Commit

Permalink
add an additional event in the hopes of providing standars for push p…
Browse files Browse the repository at this point in the history
…ayment
  • Loading branch information
rvm4 committed Jul 8, 2016
1 parent 8328830 commit 41771b3
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ <h2>PaymentRequest interface</h2>
// Process shipping address change
});

payment.addEventListener("processingpayment", function (processingEvent) {
// Use processingEvent.app, processingEvent.requestId in such a way
// that recovery from incomplete payments is possible.
});

payment.show().then(function(paymentResponse) {
// Process paymentResponse
// paymentResponse.methodName contains the selected payment method
Expand Down Expand Up @@ -1085,6 +1090,11 @@ <h2>Summary</h2>
<td><a>PaymentRequestUpdateEvent</a></td>
<td>The user chooses a new shipping option.</td>
</tr>
<tr>
<td><code>processingpayment</code></td>
<td>PaymentProcessingEvent</td>
<td>A payment app has been selected that will cause an exchange of currency.</td>
</tr>
</table>
</section>

Expand Down Expand Up @@ -1212,6 +1222,29 @@ <h2>updateWith()</h2>
</ol>
</section>
</section>
<section>
<h2>PaymentProcessingEvent</h2>
<pre class="idl">
[Constructor(DOMString type, optional PaymentProcessingEventInit eventInitDict)]
interface PaymentProcessingEvent : Event {
};

dictionary PaymentProcessingEvent : EventInit {
readonly attribute DOMString appName;
readonly attribute DOMString requestId;
};
</pre>
<p class="issue" title="Specification on means to query PaymentApp for payment status">
The appName and requestId provided in PaymentProcessingEvent are in anticipation of
Payment Apps that process payment exposing funnctionality that allows for
querying on the completion status of a payment.</p>
<p>The <code>PaymentProcessingEvent</code> enables the payee to store uniquely
identifying information such that it is possible to query the selected Payment App
about the status of an attempted payment.</p>
<p>It is recommended that the payee persistently store this information for use
in the event of an unexpected failure during payment processing.</p>
</section>

</section>

<p class="issue" data-number="53" title="Add section on internationalization">
Expand Down Expand Up @@ -1301,6 +1334,22 @@ <h2>User accepts the payment request algorithm</h2>
to pay. It MUST run the following steps:
</p>
<ol>
<li>
Let <em>processing event</em> be a new <a><code>PaymentProcessingEvent</code></a>.
</li>
<li>
Set the <code>appName</code> attribute value of <em>processing event</em> to the identifier
for the <a>payment app</a> that the user selected to accept the payment.
</li>
<li>
Set the <code>requestId</code> attribute value of <em>processing event</em> to the identifier
provided by the <a>payment app</a>.
</li>
<li>
Send the <code>PaymentProcessingEvent</code> event and wait for successful completion of this
message. This happens stictly before transfering control to the <em>Payment App</em>
for processing.
</li>
<li>
Let <em>request</em> be the <a><code>PaymentRequest</code></a> object that the user is
interacting with.
Expand Down Expand Up @@ -1329,6 +1378,10 @@ <h2>User accepts the payment request algorithm</h2>
Set the <code>methodName</code> attribute value of <em>response</em> to the <a>payment method identifier</a>
for the <a>payment method</a> that the user selected to accept the payment.
</li>
<li>
Set the <code>appName</code> attribute value of <em>response</em> to the <a>payment app identifier</a>
for the <a>payment app</a> that the user selected to accept the payment.
</li>
<li>
Set the <code>details</code> attribute value of <em>response</em> to a <a>JSON-serializable object</a>
containing the <a>payment method</a> specific message used by the merchant to process
Expand Down Expand Up @@ -1405,4 +1458,4 @@ <h2>Exposing user information</h2>
</div>

</body>
</html>
</html>

0 comments on commit 41771b3

Please sign in to comment.