WebAPI/WebPayment: Difference between revisions

Jump to navigation Jump to search
Line 311: Line 311:


== Payment Provider callbacks ==
== Payment Provider callbacks ==
The native implementation injects two callbacks within the payment provider flow so the application can be notified via DOMRequest events about the successfull or failed payment flow. These functions should be called by the payment provider once the payment flow finishes.
The native implementation injects two callbacks as global functions within the payment provider flow.
 
<code>
<code>
  function paymentSuccess(aResult);
  function paymentSuccess(aResult);
Line 321: Line 320:
where <code>aResult</code> and <code>aErrorMsg</code> are simple strings.
where <code>aResult</code> and <code>aErrorMsg</code> are simple strings.


These functions should be called by the payment provider to finish the payment flow. Both functions would close the payment flow window and trigger the <code>onsuccess</code> or <code>onerror</code> events over the <code>DOMRequest</code> returned with the <code>navigator.mozPay</code> call. The <code>aResult</code> and <code>aErrorMsg</code> strings passed by the payment provider would be available for the application as <code>DOMRequest.result</code> and <code>DOMRequest.error</code> values.


== Online payments from other networks ==
== Online payments from other networks ==
Confirmed users
483

edits

Navigation menu