#sean-tcrepo_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ 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/1509187127043428513
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! Do you have a request ID for creating the token so I can inspect the error? Also, can you clarify what you mean by "built-in Store payment mechanisms"?
Lemme see if I can generate the 1st.
For the 2nd... maybe it was a miscommunication with the other Developer... I posted in the Avalonia Telegram that I was suprised that I got the "don't send raw credit card data" error when running Stripe.TokenService.Create() becausen I assumed it would create the token locally. Part of his response was "I doubt you're going to strip away the app store's payment processing and their cut with Stripe, so you should probably forget about that. That's a good way to get banned.".
I'm new to mobile app development and store integration and so I'm still learning what is required/allowed... His comment made it seem like if I built a Stripe interface in my application that I would "bypass" payment systems controlled by Android/Apple and "get in trouble" for doing so... but maybe that's nonsense...
This might help you find the request ID ๐ https://support.stripe.com/questions/finding-the-id-for-an-api-request
You're welcome! Let me take a look...
The guide you linked is a great starting point for accepting payments with Stripe on mobile! It doesn't mention token creation so I'm curious what use case you ran into that required tokens?
I thought Stripe.TokenService.Create() would run 100% locally
I wanted to create a flow that was entirely in C# in my App... I don't think your guides actually mention C# and so I was working with what I could. That is not the guide I followed when I originally developed (but is what I was looking at recently to try to learn more)...
My current flow sends a token to an AWS Lambda which in turn sends it to Stripe... Having tested with "tok_visa" everything worked but trying to use "real" (fake test) data it's failing this way. Making me think my whole approach isn't ideal...
I'm thinking I might want to flex to an embedded Stripe webpage type solution?
I suppose I'm looking for advice on either
- How to create a token locally in C#
- Best Practices for using stripe with a mobile app written in C#
Looking at the failed request, I see you're trying to send Stripe raw card data which requires approval for a special API. You can read more about this here:
- https://docs.stripe.com/api/tokens
- https://docs.stripe.com/api/tokens/create_card
- https://support.stripe.com/questions/enabling-access-to-raw-card-data-apis
However, this is not needed in most cases! I'd recommend starting here: https://docs.stripe.com/payments/accept-a-payment?payment-ui=mobile&platform=react-native&lang=dotnet
This walks you through how to use Stripe's Payment Sheet to securely collect payment method details and create a Payment Intent to represent the charge. You can choose iOS, Android, or React Native and select .NET which is a C# framework when viewing server-side code snippets in our guides.
Thanks. I found that page but perhaps should read it more thoroughly. The thing is my CLIENT is written in C# and so I'm not sure a guide like that actually does the trick (the Guide, optionally, uses .NET on the Server Side). In effect I use Avalonia (C#) in place of React Native to write Client Code. React Native is a whole different language than my Client App is written in...
Thank you for clarifying! Stripe doesn't have a client-side SDK for C# so your options are...
- Redirect to a Stripe-hosted Checkout page in the browser: https://docs.stripe.com/payments/accept-a-payment?payment-ui=checkout&ui=stripe-hosted&lang=dotnet (be careful not to use a WebView if you want to support redirects for 3DS, Apple Pay, etc.)
- Request access to our raw card data APIs which makes you responsible for PCI compliance
Ok thanks. Thanks for pointing out that WebView doesn't support Apple Pay, etc. That's good to know going in.
Would both "Checkout" and "Elements" work in this cse or just "Checkout"?
I'll also review PCI compliance requirements.
You're welcome! If you're redirecting to a web browser, you can use either Checkout or Elements depending on how custom you want the integration:
- A Stripe-hosted Checkout page involves no client-side code
- An embedded Checkout page allows you to use Stripe Checkout within your own website
- Elements gives you full control but involves the most code
Ok thanks. Sounds like redirecting to an external (not WebView) web browser is the way to go and, as you say, a Stripe-hosted Checkout is the least amount of work.
I agree ๐ and if you decide you're PCI compliant, then you can request sccess to our raw card data API by reaching out to support: https://support.stripe.com/contact
Ok thanks for your time!