While working on supporting a save credit prompt, I noticed that only the credit card number (not the guid, expiry dates) manages to be passed into GeckoView. My primary investigation happened on desktop: 1. Navigate to https://checkout.stripe.dev/preview and fill out a credit card information and perform a form submit. 2. In the debugger, observe what the `creditCard` object looks like before calling `FormAutofillPrompter.promptToSaveCreditCard`. See screenshot. 3. Notice that the parameters for the `creditCard` does that line up when translated in https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/android/FormAutofillPrompter.jsm#46 to `newCreditCard` and `CreditCard.fromGecko(newCreditCard.record)`. It seemed interesting to me that that the `creditCard.record` parameters no longer matches the parameter that is expected when it's being translated to GeckoView prior to calling `GeckoViewAutocomplete.onCreditCardSave`. In https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/android/FormAutofillPrompter.jsm#53-58, we are expecting to have `record.expMonth` and `record.expYear`, but I am not quite sure if we even have those parameters anymore. From the screenshot, you can see we have `cc-exp`, `cc-name`, and `cc-number` in `creditCard.record`. Similarly, in https://searchfox.org/mozilla-central/source/mobile/android/modules/geckoview/GeckoViewAutocomplete.jsm#256 called from https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/android/FormAutofillPrompter.jsm#64 is calling. We are also expecting a different set of parameters inside of the `creditCard.record` object that is passed to `fromGecko`.
Bug 1747898 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
While working on supporting a save credit prompt, I noticed that only the credit card number (not the guid, expiry dates) manages to be passed into GeckoView. My primary investigation happened on desktop: 1. Navigate to https://checkout.stripe.dev/preview and fill out a credit card information and perform a form submit. 2. In the debugger, observe what the `creditCard` object looks like before calling `FormAutofillPrompter.promptToSaveCreditCard`. See screenshot. 3. Notice that the parameters for the `creditCard` does that line up when translated in https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/android/FormAutofillPrompter.jsm#46 to `newCreditCard` and `CreditCard.fromGecko(newCreditCard.record)`. It seemed interesting to me that that the `creditCard.record` parameters no longer matches the parameter that is expected when it's being translated to GeckoView prior to calling `GeckoViewAutocomplete.onCreditCardSave`. In https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/android/FormAutofillPrompter.jsm#53-58, we are expecting to have `record.expMonth` and `record.expYear`, but I am not quite sure if we even have those parameters anymore. From the screenshot, you can see we have `cc-exp`, `cc-name`, and `cc-number` in `creditCard.record`. Similarly, in https://searchfox.org/mozilla-central/source/mobile/android/modules/geckoview/GeckoViewAutocomplete.jsm#256 called from https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/android/FormAutofillPrompter.jsm#64 is calling. We are also expecting a different set of parameters inside of the `creditCard.record` object that is passed to `fromGecko`. Expected outcome is that we should be able to get the credit card name, guid, expiry date in the credit card object passed to GeckoView. It would be highly desirable to ensure we validate that none of the parameters are null by calling [isValid()](https://searchfox.org/mozilla-central/source/mobile/android/modules/geckoview/GeckoViewAutocomplete.jsm#247) prior to calling [`GeckoViewAutocomplete.onCreditCardSave(selectedCreditCard)`](https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/android/FormAutofillPrompter.jsm#72). In Fenix, we are expecting to save a credit card with a number and expiry date since we do not expect these values to be nullable.