WebAPI/WebPayment/Multi-SIM: Difference between revisions

Line 41: Line 41:


== Firefox OS v1.4 ==
== Firefox OS v1.4 ==
For v1.4 we would like to:
 
* Allow the user to select the primary SIM for carrier billing, which should also also the primary SIM for data connections.
In order to have a full support for multi-SIM payments where:
* Expose to the payment provider the whole list of mcc/mnc for all the SIMs in the device, indicating which one is the primary one for carrier billing. This way, if the selected SIM is not valid, the payment provider will be able to check if the other SIM is valid, and in that case, suggest the user to change her selection (no need to change slots). If none of the SIMs are valid, we can even disable the setting to select the primary SIM for payments until the SIMs are changed.
 
* The user is always aware about which one of her SIMs is used for payments. Even if this SIM is not in the device!
* We always authenticate the correct SIM that is used for payments.
* We know when to remove the payment session to trigger a new authentication flow.
 
the proposal is the following:
 
* We will expose to the payment provider the serviceId associated with the SIM selected for payments via '''mozPaymentProvider.getPaymentServiceId'''. It can be the primary SIM for data by default, it doesn't really matter.
 
* We will expose to the payment provider the whole list of ICCID/MCC/MNC for all the SIMs in the device indexed by serviceId, indicating which one is the primary one for data.
** This means that '''mozPaymentProvider.iccId''' will return an object like:
*** {'serviceId1': { id: '1234' }, 'serviceIdN': { id: '5678', dataPrimary: true }}
** The same for '''mozPaymentProvider.mcc''':
*** {'serviceId1': { mcc: '213' }, 'serviceIdN': { mcc: '214', dataPrimary: true }}
** And '''mozPaymentProvider.mnc''':
*** {'serviceId1': { mnc: '2' }, 'serviceIdN': { mnc: '2', dataPrimary: true }}
 
* If there is a record of a previous payment (I guess, a payment cookie), the payment provider will need to check that nothing changed wrt to the SIM selected for payments. Otherwise, a new authentication flow needs to be triggered.
 
* If there is no record of a previous payment, a new authentication flow needs to be triggered. The payment provider will need to process the list containing the services information in order to set the correct SIM for payments. The decision algorithm could be something like [http://www.gliffy.com/go/publish/image/5175268/L.png this].
 
* Once the payment provider selects the appropriate SIM it will set the serviceId associated with this SIM via '''mozPaymentProvider.setPaymentServiceId'''.
 
* Note that in case that the (not silent) SMS flow is required, we will need to ask the user for her MSISDN and this could be an MSISDN from an external SIM. In this case, the payment provider will set the service ID to null. We might be able to do it better and listen for incoming auth SMS. If the SMS is received in the device, we can set the serviceId of the receiving SIM as the one selected for payments. To do this, we will need the payment provider to specify the number from where the auth SMS is sent via '''mozPaymentProvider.observerAuthMessage(number)'''.
 
* If there is a record of a previous payment and the payment serviceId is null, it means that the payment was done with an external SIM and so we need to allow the user to remove the payment session to retrigger the authentication flow with another SIM.


[https://bugzilla.mozilla.org/show_bug.cgi?id=938993 Bug 938993] will track the client side changes required for this and [https://bugzilla.mozilla.org/show_bug.cgi?id=942361 Bug 942361] the payment provider changes.
[https://bugzilla.mozilla.org/show_bug.cgi?id=938993 Bug 938993] will track the client side changes required for this and [https://bugzilla.mozilla.org/show_bug.cgi?id=942361 Bug 942361] the payment provider changes.
Confirmed users
483

edits