#Ante75
1 messages · Page 1 of 1 (latest)
đź‘‹ happy to help
you shouldn't use the URL for next action
this should take care of handling 3DS
for you
this problem is only with payments with 3d secure, but i don't understand what to do after the "requires_action" response
do I have to open a webView ? but in newAction I find "use_stripe_sdk"
I do not understand...
is this for mobile?
yes
what are you using? React native?
Xamarin forms
that doesn't mean it's OK
there's a huge risk with this, and we really don't recommend this at all
I do not know what you mean...
we followed all your guides
how did you that with Xamarin though?
are you using Xamarin as a hybrid mobile app development kit?
are you using Stripe.js in a webview?
I use Stripe API in Xamarin Forms
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
we used this api without no problems for mobile. We need only to know how this api works for the 3ds. Nobody tell us that this api doesen't work for xamarin.
and so what can we do?
we have already do all the other stuff with this sdk
the only problem is with sdk. Rebuild everything only for this would be a big problem
*3ds
can we use stripe without 3ds?
If the bank asks for 3DS you will need to handle it somehow, otherwise the payment fails.
If you use Stripe.js, stripe-ios, stripe-android or stripe-react-native, it will be handled for you.
we can't rebuild in native all the app only for this. The only problem is that the answer of paymentintentservice the status is "requires_action" . But in new_action the redirect to url is null
Could you please share the PaymentIntent ID? pi_xxx
pi_3MgnWgR9sfcnxwPB01M2oDXn
This URL is designed to be used by Stripe.js.
I understand you invested a lot in your Xamarin application and it's not easy to rebuild it now.
However, there're some facts that I'd like to stress:
- You should never use your secret key on the frontend
sk_xxx, otherwise your whole Stripe account can be compromised. - stripe-dotnet is not designed to be used on the frontend, even if your frontend shares the programming language with the backend. That's why there's separate stripe-node and Stripe.js. It's the wrong tool for the job and it's likely a waste of time to try to make it work.
One solution I see is to use Stripe Checkout, and redirect the user outside of your app for payment: https://stripe.com/docs/payments/checkout/how-checkout-works
You can generate links on your backend, and then redirect the users away from your own frontend. You can use return_url to return them to your app.
It is yep
how can you say we can't use it?
Nobody has said not to use it, but how you're using it is wrong
I don't understand why my way is wrong,
I use this method:
var createOptions = new PaymentIntentCreateOptions
{
Amount = (long)Amount,
Currency = App.Currency,
Description = Description,
Customer = App.StripeClientId,
ApplicationFeeAmount = ApplicationFeeAmount,
PaymentMethod = PaymentMethodId,
Confirm = true,
CaptureMethod = "manual",
ReceiptEmail = ReceiptEmail,
PaymentMethodOptions = new PaymentIntentPaymentMethodOptionsOptions()
{
Card = new PaymentIntentPaymentMethodOptionsCardOptions()
{
RequestThreeDSecure = "automatic"
}
}
};
var paymentIntentService = new PaymentIntentService();
var paymentIntentServiceRes = paymentIntentService.Create(createOptions, requestOptions);
if (paymentIntentServiceRes.Status == "requires_capture")
{
... we confirm payments from our servers
}
You need to complete the requested actions/auth on the PI in your front-end code with Stripe.js (not stripe-dotnet). See: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
are our servers (.net)
who confirm the payment and have the keys
The confirm/auth flow requires input from your customer (who is making the payment). Those actions cannot be completed server-side, you need a client-side element as outlined on the doc above
it is our server that then confirms the payment, the customer only makes the request, the private keys are not provided to the mobiles
In this instance that isn't enough. Additional action is required for the payment to be completed – the bank/issuer has requested authentication from your user. They need to complete those steps in your front-end application using Stripe.js. Once completed, the status field of the Payment Intent will transition from requires_action to requires_capture.
the problem is that after requires_action, the RedirectToUrl is null
should I maybe make the PaymentIntentService request with some option to have RequestToUrl ?
That's because you're expected to use confirmPayment from Stripe.js with the client_secret to handle the auth. You can handle that manually if you prefer, but it's not recommended: https://stripe.com/docs/payments/3d-secure#manual-redirect
not being able to use Stripe.js, I would like to replace it manually, but not having RedirectToUrl, I can't, this is the problem
in newAction I find "use_stripe_sdk" NotRedirectToUrl
The link above explains how to get a redirect_to_url
i'm trying with fake stripe papers
4000000000003220
but after the
paymentIntentService.Create(createOptions, requestOptions)
I receive
paymentIntentServiceRes.Status = "requires_action"
It's inside
paymentIntentServiceRes.NewAction.Type = "use_stripe_sdk"
paymentIntentServiceRes.RedirectToUrl = null
Can you share a pi_xxx ID?
The sounds like a payment following the exact flow I described above
pi_3MgoHsR9sfcnxwPB1GuAvYCe
Did you pass a return_url on creation? https://stripe.com/docs/api/payment_intents/create#create_payment_intent-return_url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Did you read the doc I sent?
the return_url (from what I understand) is something else, used to redirect the customer at the end of the payment...
the RedirectToUrl (which I don't receive) is the page where to confirm the 3d secure,
From the doc I shared:
To redirect your customer to the 3DS authentication page, pass a return_url to the PaymentIntent when confirming on the server or on the client. You can also set return_url when creating the PaymentIntent.
After confirmation, if a PaymentIntent has a requires_action status, inspect the PaymentIntent’s next_action. If it contains redirect_to_url, that means 3DS is required.
Please try what I suggested