WebAPI/WebPayment: Difference between revisions

mNo edit summary
Line 409: Line 409:
= Current implementation =
= Current implementation =
[[File:MozPayFlow.jpg|600px|thumb|center|Current implementation]]
[[File:MozPayFlow.jpg|600px|thumb|center|Current implementation]]
== Modules ==
The basic parts of the current mozPay implementation are:
* DOM part in Gecko, which contains the common code that exposes the mozPay function to the DOM and that is supposed to be shared by all the platforms (B2G, Fennec, Firefox).
* B2G Glue part in Gecko, which contains the specific B2G code that triggers the trusted UI creation to embed the payment flow iframe and that injects the required <code>paymentSuccess()</code> and <code>paymentFailed()</code> functions within the payment flow content.
* Gaia part, which contains the require code to create, open and close the trusted UI and the payment confirmation screen.
== Communication ==
The communication between Gecko and Gaia is done via <code>mozChromeEvent</code> and <code>mozContentEvent</code>, which is a communication mechanism between chrome and the Gaia system app. <code>mozChromeEvent</code> are sent from chrome to content and <code>mozContentEvent</code> are sent from content to crhome. Where "sent" is used loosely here, since "broascast" is probably a better term. This communication is required to control the creation and closure of the trusted UI and to inject the required functions to notify the success or failure of the payment flow within the payment provider content.
= See also =
= See also =
* [[WebAPI/WebPaymentProvider|WebPaymentProvider]]
* [[WebAPI/WebPaymentProvider|WebPaymentProvider]]
Confirmed users
483

edits