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

an event to providing standards for push payment methods #223

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
51 changes: 50 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 @@ -1405,4 +1454,4 @@ <h2>Exposing user information</h2>
</div>

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