WebAPI/WebPayment/Multi-SIM: Difference between revisions

Line 50: Line 50:
the proposal is the following:
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 serviceId associated with the SIM selected for payments via '''mozPaymentProvider.paymentServiceId'''. 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.
* 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. We will remove the '''.iccIds''', '''.mcc''' and '''.mnc''' properties and will introduce a new '''.iccInfo''' property of this form:
** This means that '''mozPaymentProvider.iccId''' will return an object like:
** {'serviceId1': { iccId: '1234', mcc: '222', mnc: '333', dataPrimary: false }, 'serviceIdN': { iccId: '5678', mcc: '222', mnc: '333', dataPrimary: true }}
*** {'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 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].
* 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'''.
** Once the payment provider selects the appropriate SIM it will set the serviceId associated with this SIM via '''mozPaymentProvider.paymentServiceId'''.
** 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.observeAuthMessage(number)'''.
** 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.observeAuthMessage(number)'''.


Confirmed users
483

edits