#Shubz-gpay-test
1 messages ยท Page 1 of 1 (latest)
Hello!
Is this happening because it is a test Environment?
Yes we replace the card data in test mode with the4242token. Google Pay requires a real card (even in test mode), so we just swap that out
When I compare the behaviour with Apple Pay, there is only one payment method per card even though we purchased multiple subscription. Is the difference in behaviour intentional or am I doing something wrong in configuring the
It depends on how you're creating your Subscription or confirming the initial PI/SI
Will you be able to elaborate a bit. As far as I am aware, we are doing the same thing in both Apple and Google. We are creating a Payment method and then passing it to our backend to confirm the payment.
Can you share an example ID or some code?
Yup sure, Shall I send you the customer_id link?
That will give you a complete picture?
It'll help!
The code to generate the PaymentMethod is as follows
Configuration:
googlePayLauncher = GooglePayPaymentMethodLauncher( activity = activity, config = GooglePayPaymentMethodLauncher.Config( environment = GooglePayEnvironment.Test, merchantCountryCode = "GB", merchantName = "Cuvva", billingAddressConfig = BillingAddressConfig( isRequired = true, format = BillingAddressConfig.Format.Full, ) ), readyCallback = { isReady -> Log.i("GOOGLE_PAY", "onCreate Google pay is ready? $isReady") isGooglePayReady = isReady readyCallback.run(isGooglePayReady) }, resultCallback = ::onGooglePlayResult, )
Payment Method generation
googlePayLauncher.present( currencyCode = "GBP", amount = totalPayable.amount.fractionalUnits, transactionId = payableId.value )
And you're calling that each time you create a Subscription?
Yes
Then yes, that's expected
Would the behaviour be same for Apple Pay too?
I'd imagine so, yes. Assuming you also call the corresponding code to create the Apple Pay PM
If you want to re-use a Payment Method you'd fetch an existing pm_xxx ID and pass that when creating the Subscription
Or build a UI to allow the user to select a saved PM
We are doing that for the normal cards we save using the Stripe SDK. We wanted to introduce Google Pay so that the set up is quicker. This works fine for our on-session payments because the payment methods are not stored in strip and we dont attach them either like we do when we add a card using stripe sdk
But for subscriptions, Stripe automatically attaches them to the customer
to support off-session payments
I am wondering what the optimal user experience would be for subscriptions. Do we present the google pay option or just list all the payment methods that are attached to Stripe? Is there a recommended Stripe way for this?
It's important to note than you can have multiple Payment Method objects for the same underlying card, which is likely the issue here
So in reality what you probably need to do is surface the existing Payment Methods for a customer in a UI, allowing them to select one or add another (via GPay, etc)
Ya, I think that makes sense. So for the first time, we show the Gpay option and let them pay and the second time onwards we fetch a list of payment methods and then let the user to either choose GPay or show the existing payment methods to choose from. The only problem is if the user ends up choosing Gpay for the same underlying card we get multiple payment methods. Is there anyway to know it is the same backing payment card behind the multiple payment methods?
Yep, the fingerprint will likely be the same: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-fingerprint
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Although not 100% reliable with wallet payment methods
Ouch. You gave me hope and then took it away ๐
Maybe a combination of the fingerprint and the card details could solve the issue ๐ค
You can also check to see if it was a wallet: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-wallet
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh! cool. Let me see if I can understand some more from all of this. ๐๐ฝ Thank you so much for all the information. It has been super helpful. I might bother you again if I have some doubts in the future around this.
Of course, np!