#roopxx_android-payment-sheet

1 messages ยท Page 1 of 1 (latest)

quasi epochBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1372635942032248903

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

odd silo
#

Hi ๐Ÿ‘‹

The Android Payment Sheet does not support using Checkout Sessions currently. You must use the Payment Intent API and the Payment Intent client_secret property to use the Payment Sheet to collect funds.

sterile musk
#

Yes, I read docs thats why came here to ask you guys (more exp). Would I still be able to use stripe inbuild checkout pages if I create a paymentIntent in my django code to collect payments. Will it be too much code changes as my PR is already merged and live in prod with my code creating a checkout session ?

odd silo
#

Checkout Sessions and payment Intents are entirely different things

#

I would recommend setting up a separate API endpoint to generate a Payment Intent for your mobile integration while leaving your Checkout Session integration alone

sterile musk
#

Oh.. okay I am new to this. But how would I bring the order details to the new API endpoint, previously we had the order created in API itself as soon asbuy now gets clicked and then based on payment gateway selected by our client (set by a single person in their institute setting as default) (we have PayU, razorPay, now stripe). we use have the gateway name in API to use one of the payment gateway backend code to create respective gateway payment page and then redirect the user to page.

odd silo
#

Okay so you are wanting to route these payments through different gateways? It's not clear to me why that would require you to change your checkout session function.

#
  • You cannot use Checkout Sessions with mobile payment sheet
  • You must use Payment Intents to process payments with the Android payment sheet
  • If you want to store additional data on the Payment Intent, similar to the data on the Checkout Session, I recommend using the metadata property.
sterile musk
# odd silo * You cannot use Checkout Sessions with mobile payment sheet * You must use Paym...

This cleared some things to me. So can we create Payment intent based on the API v3 response received in my app from backend and use it to crreate a paymentIntent and then use the client secret in Android payment sheet ? Can all this be done in my Kotlin android-sdk code itself ?

Sorry If I sound dumb.. but I dont really understand the kotlin and android dev code ๐Ÿ˜… . I just got the webview working by looking at similar code.

Example response in my sample apk run on my android stude when order is created:
CreateModelMixin.create() - Returning response with data: {'id': 261, 'order_items': [OrderedDict([('id', 260), ('product', 'neet-full'), ('quantity', 1), ('expires_at', None), ('price_before_discounts', '3999.00'), ('price', '3999.00')])], 'order_id': 'DEMO261', 'status': 'Processing', 'email': '', 'name': '', 'phone': '9999999999', 'amount': '4103.77', 'mobile_sdk_hash': '', 'apikey': '', 'product_info': 'NEET FULL', 'date': '2025-05-15T19:28:05.124219+05:30', 'plan_detail': None}
odd silo
#

I just got the webview working by looking at similar code.
You should never use WebViews with Stripe elements. We strongly advise against that and much of the functionality won't work as expected

#

If you are not very familiar with Kotlin, I recommend writing the Payment Intent creation code in your Django back-end and sending the client_secret to the Android application.

sterile musk
#

Thanks @odd silo very much. I got an idea on how to handle this.

I'll come back to this chat If I faced any issues after setting up the paymentintent code.

quasi epochBOT