After fetching the customerId, ephemeralKey and clientSecret, I initialize the PaymentSheet with a Configuration object (which includes the app name, customerConfiguration(customerId, ephemeralKey and GooglePayConfiguration.
I then call presentWithPaymentIntent(clientSecrent, customerConfiguration)
, where the customerConfiguration is the object created at the first step.
The documentation says that if you pass the customer configuration and the user checks the "Save for future payments" checkbox, on the next payment the PaymentSheet will show the saved card, but for some reason, for me it doesn't.
I've checked and the customerId it's always the same for the current customer, only the ephemeralKey changes for new payments, which seems right.
Any idea what I might be doing wrong? The iOS client works as expected, so server side is configured ok.
Thanks!
Code sample:
PaymentSheet.GooglePayConfiguration googlePayConfiguration = new PaymentSheet.GooglePayConfiguration(getGooglePayEnvironment(), countryCode);
PaymentSheet.CustomerConfiguration customerConfiguration = new PaymentSheet.CustomerConfiguration(mViewModel.getCustomerId(), mViewModel.getEphemeralKey());
PaymentSheet.Configuration configuration = new PaymentSheet.Configuration(getString(R.string.app_name),
customerConfiguration,
googlePayConfiguration,
null,
null);
mPaymentSheet.presentWithPaymentIntent(mViewModel.getClientSecret(), configuration);