#BRData
1 messages · Page 1 of 1 (latest)
Hello. Can you share a request id? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Also please don't expose api secret keys in here
You'll need to roll your key now: https://stripe.com/docs/keys#rolling-keys
That's sensitive data
Yeah. You still need to roll it
No that's a request to create a payment intent
Do you have multiple accounts?
Usually the no such payment intent errors come when you either use the wrong api key
Or use the stripe account header incorrectly
Yes I have a "connected" test account
and I have my main account
Connected standard account
pi_3NGjkgEVoNb8mE9201du68Lk exists on the
acct_1N5blfEVoNb8mE92 connect account
So you'll need to pass the stripe account header too when retrieving it
What do you mean by that?
How do I pass that in when using this:
var service = new PaymentIntentService();
service.Get(paymentIntent);
The same way you passed it to create the payment intent
Well looks like there's an error
What does the message say? requestOptions is underlined in red
One sec let me get back to you with the proper syntax
Oh ok so issue looks like the second argument is supposed to be the parameters sent to the request (like expand if you're using expansion). However, since you're not using any params in the request, you'd still need to send an empty object for the params. Try: service.Get(paymentIntent, new PaymentIntentGetOptions(), requestOptions)
Got it that seemed to have worked
How do I get the status so I can check if the payment was successful or not from the service.Get method?
status should be a param on the intent that you get back
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yeah because service isn't the payment intent
the result of service.Get is the payment intent
So assign it to a variable and print it out
Well did you provide a payment method to charge?
What I am doing is as soon as the pay button is hit it calls a custom function on my backend the check the payment status
I am using the test card number so I know its a successful payment
Can you share the payment intent id you just printed out?
whoops i think I know the issue
stripe.confirmPayment(): the confirmParams.return_url argument is required unless passing redirect: 'if_required'
I removed the return url from this method because I dont want the page to redirect at all
Ah yep
what can I put in there to stop it from redirecting?
You can't
So you need to also pass redirect: if_required. But return_url is necessary because some payment methods absolutely require a redirect. Card payments don't. So if you pass the return_url and redirect: if_required w/ a card payment then you won't be redirected
No
Look at the docs: https://stripe.com/docs/js/payment_intents/confirm_payment
param is called redirect
What's the message/response body?
It has to do with the redirect
What does it say
That's because redirect isn't supposed to be in confirmParams
Look at the docs I sent
That should be right
So i put it in as a method param
Is ^ not working?
I dont think so.
What's the response this time?
Which sample code out of curiosity?
Wait I am figuring out what is happening
I think its a race condition
Yeah 100% a race condition
That is the javascript - if you look at reportrequest that is when it is calling the service.Get function to check the status of the payment
Is there a better time that this should be called?
Ah yeah that's why you should use webhooks
That'll enable you to receive a request on your endpoint from Stripe's servers when the payment intent succeeds
Yeah I was hoping there was a way I could do it without webhooks