Confirmed users
483
edits
m (→Silent SMS) |
(Completion) |
||
Line 14: | Line 14: | ||
== API == | == API == | ||
The <code>navigator.mozPay()</code> implementation injects a global <code>mozPaymentProvider</code> object within the payment provider's web page context. | |||
interface mozPaymentProvider | interface mozPaymentProvider | ||
Line 85: | Line 87: | ||
== Completion == | == Completion == | ||
In order to allow the payment provider to control the behavior of the payment window, the mozPaymentProvider API exposes paymentSuccess and paymentFailed. 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 [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest.onsuccess onsuccess] or [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest.onerror onerror] events over the [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest DOMRequest] returned by 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 [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest.result DOMRequest.result] and [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest.error DOMRequest.error] values respectively. | |||
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 [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest.onsuccess onsuccess] or [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest.onerror onerror] events over the [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest DOMRequest] returned by 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 [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest.result DOMRequest.result] and [https://developer.mozilla.org/en-US/docs/DOM/DOMRequest.error DOMRequest.error] values respectively. | |||
* The success callback in the app is to say “the payment is done processing.” It does not guarantee a positive or negative outcome. | * The success callback in the app is to say “the payment is done processing.” It does not guarantee a positive or negative outcome. |