#deondk-xamarin

1 messages ยท Page 1 of 1 (latest)

fluid summit
#

Hi, I don't have exp with xamarin, but I can try. What's your issue?

wary lion
#

well I need some tips on how to get started. I have integrated the stripe sdk with my xamarin apps but the sdk is outdated so it doesnt have 3DS support so I need to custom build it. I assume sending it to a webview.

#

so I need to somehow know whether the card needs 3DS then send to a webview to confirm 3DS then send back to app for success

fluid summit
#

Which SDK are you referring to?

#

Stripe SDK should know by itself whether to open a 3DS page. As long as you use its method, it's automatically done

wary lion
#

because stripe sdk is so outdated in xamarin I custom build all the dunctions of paying. so all is done via api in .net environment

#

getting a token from paymentintent and then using that to do payment

fluid summit
#

Which SDK is that? stripe.js?

wary lion
#

I can see in the status message of intent in api that it needs firther authorization

#

so I guess I can use that to know whether to send to 3DS

#

let me see if I can find the stripe version

#

I think the one I use in android is the stripe android sdk V 8.7

#

does this help at all?

fluid summit
#

Sorry. So it's the Android SDK

#

hmm

wary lion
#

yes kind of rebuild for xamarin.

#

but an old one

#

so I will have to custom build the 3DS via a webview I think

desert hill
#

maybe. We don't really know I'm afraid, we have no official support for Xamarin and we don't test anything there.

wary lion
#

Ok I think I get that url

#

but my question then is when I redirect from the webview how will I get feedback back to the app if it was success or not?

desert hill
#

you can set a return_url (see the docs linked above), and you'd have to use that. So for example, you might use shouldOverrideUrlLoading in the WebView to check the URLs being visited in the view, and when it's the return_url you specified, then you know to close the WebView and move on to the next step in your flow. I think that's what our SDK does.

wary lion
#

ok thanks for the help

#

going to play around with it and let you know if I need help

#

thanks a lot

desert hill
#

no worries! To be completely honest with you, this will be really hard and I would officially suggest that we just don't support Xamarin and you're going to have a lot of difficulty doing this.

#

I would either use native Android/iOS, or React Native, but beyond that if you have to use Xamarin, you might want to just do the payments on your website using stripe.js/Checkout and redirect out of your app for that part.

wary lion
#

ok thanks for the advice. will have a look

#

do you mean then doing the whole payment flow in a webview in app?

desert hill
#

I would personally do it outside of the app entirely just in the normal browser for maximum compatibility. For example Google Pay won't work in a WebView in Android

wary lion
#

yeah in our use case we need it to be inside app.

wary lion
#

I am using a 3ds card but for some reason my nextAction in paymentIntent is null

#

is there a way to manually make up the 3DS url if I have the paymentintent?

desert hill
#

which card are you using?

wary lion
#

4000000000003063

desert hill
#

if next_action is null then it just means 3D Secure wasn't required , you don't need to force it.

#

what's the pi_xxx ID of the PaymentIntent?

wary lion
#

pi_3KixRw2ZHju5IOtm0xQdbIhI

#

the status is requires_confirmation

desert hill
#

yeh you have to confirm it first, just creating the PaymentIntent doesn't attempt a payment

#

you should pass Confirm=true in the creation params

wary lion
#

ok then next_action is use_stripe_sdk

#

is there a card that forces 3DS?

desert hill
wary lion
#

ok that is a bit confusing as Im in app. so what would the return url be?

#

is that the return url after authentication is done?

wary lion
#

ok cool. can handle that

desert hill
wary lion
#

ok got the 3ds link

wary lion
#

when I get to the success page is there a way to know whether 3DS is successfull or not?

#

anything passed in url?

desert hill
#

I think there are some query parameters added to the URL, at least the PaymentIntent ID is there

desert hill
#

yep, so if you want to check the status you can take the PaymentIntent ID and retrieve it from the API to check the status field for example

wary lion
#

ok so this has thrown my logic up to now out the window. What Im doing currently without 3DS is creating paymentintent via api and then confirming the paymentintent on client side with clientsecret

desert hill
#

yep, and that is generally the correct approach

wary lion
#

but now trying to include 3DS I need to confirm the pi inside the api

#

in the backend?

desert hill
#

problem is you're using Xamarin I suppose. Does throwing a 3D Secure card into your existing flow just break entirely?

wary lion
#

well if I dont handle it it just goes thru as success

desert hill
#

that seems unlikely

wary lion
#

thats how I realized something was wrong it doesnt go thru as success on stripe backend

#

but doesnt throw an exception

#

just the status shows requires action

desert hill
#

yeah, requires_action is not a success.

wary lion
#

so how do I handle 3DS without confirming pi inside backend?

desert hill
#

you can confirm it on the client side instead, but that won't work for you since you're using Xamarin with an old version of our Android library that doesn't support it.

#

overall my advice is to switch to using a normal web based(Elements or Checkout) integration and open that in a web page outside the app, in-app payments are just going to be incredibly difficult to get running on this unsupported(by Stripe) platform.

wary lion
#

ok but I might be able to use stripe.net inside xamarin...

desert hill
wary lion
#

so after I get the requires action status, I can maybe send my secret key encrypted from api in backend

desert hill
#

just no, sorry

#

don't do any of that

#

I have to run I'm afraid, my colleague can take over. My advice is what I mentioned, you'd get a much better experience by redirecting out of the app instead of trying to get any of this working with Xamarin.
Alternatively ,the other option is to integrate with server-side confirmation, (which is what I've been describing) and for 3D Secure ,send the URL to the app and have the app open it in a webview. It's really complex though and hard to implement and there are no guides. But it's combining https://stripe.com/docs/payments/accept-a-payment-synchronously with https://stripe.com/docs/payments/3d-secure#manual-redirect essentially.

wary lion
#

Ok But my question then would be how do I handle non 3DS cards?

#

if I confirm on server side

near acorn
#

Hi! For cards without 3DS, you can directly confirm the PaymentIntent on the backend and it should work.

wary lion
#

something I have seen now I can maybe try and do is the following:

#

get paymentintent and client secret from api

#

confirm paymentintent on client side

#

then check the NextAction on client side if it has a url for redirect then I can send for 3DS

#

if not it should succeed

#

can you maybe check for me to which email this test account is linked to?

#

acct_1IgVWK2ZHju5IOtm

#

I am trying to do a test but cant find this test connect sccount

next owl
#

Hello. Taking over for soma as they have to step out

#

I can't provide that. I recommend you reach out to support for that info as they will be able to verify your identity (and make sure that is your account) to proceed.

wary lion
#

Is there any easy way on backend to find accounts based on ID?

#

I have a lot of different accounts

next owl