#hendr1x_api
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/1361344253803888640
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- hendr1x_api, 3 minutes ago, 8 messages
Hello again ๐
Sorry if I missed it in the post, but I don't really see a question being asked. Can you help me understand what you're trying to ask?
How are you trying to log things currently? confirmPayment and confirmSetup both return a Promise, if you don't have a mechanism for that promise to resolve and then inspect the results then it could look like nothing is happening.
My question is, how do I get confirmPayment and confirmSetup returning an error and doing their redirect properly?
Are they not currently? What are the Promises resolving to?
Sorry...that question doesn't make sense to me...
Here the small section of the code where I'm calling confirmPayment()
var {error} = await stripe.confirmPayment({
clientSecret: paymentSecret,
confirmParams: {
return_url: completeURL,
}
});
error never gets anything assigned and the redirect that was happening prior does not occur
I do not know how to do any other logging other than console..log() and alert()
Just be clear...you are probably 100% right. I 100% admit that I am not good at javascript
I'm a backend developer being forced to do this
It's hard to guess at what could be going on without more context. You mentioned the behavior changed when you changed your code, right? Do you have the code that you had before the refactor?
Do you have an ID of a Payment or Setup Intent that you confirmed during your testing that you can share the ID for that we can look at?
Do you see that intent being confirmed in your Stripe logs?
I have an id, I can check the logs but I'm not if the payment is getting confirmed either way if thats going to change anything.
I totally get you are limited on what you can do here
This is what you said prior "if you don't have a mechanism for that promise to resolve and then inspect the results then it could look like nothing is happening."
How can I confirm that I have a mechanism in place fully?
Clearly I lost the mechanism at some point but I don't really get how
Also...to answer your question...the old code is too different to help me diagnosis this issue
await is one of the approaches that I know of for waiting for the result of the Promise, so you are using one of the mechanisms that I was referring to.
The .then() syntax is the other approach that I know of, and what I thought you might be using since I thought your previous thread said you weren't using await.
No use of then
I don't understand what is missing.
I would have assumed if something was not coded properly that js would through an error but the code runs fine
How confident are you that your call to confirmPayment is being executed?
I can tell you 100% that an alert('here') directly above the confirmPayment() code provided above triggers
However one placed directly after it does not fire
console.log(error) is undefined BUT alerts do weird things with console.log so I don't trust that test at all
Okay, so if the alert before it is triggering, then I think investigating the next step in the execution of the code means checking the request that was made to our API from confirmPayment via your Stripe logs.
Ok will do that right now
Ok
Got it
This is all test data
The request is getting recieved in the logs...here is the response body
{
"id": "seti_1RDoBsCTw3MsNtCvtofK59wN",
"object": "setup_intent",
"application": null,
"automatic_payment_methods": {
"enabled": false
},
"cancellation_reason": null,
"client_secret": "seti_1R**********************_******_***************************ZoRl",
"created": 1744641652,
"customer": "cus_RMZxI2SLKKEHah",
"description": null,
"flow_directions": null,
"last_setup_error": null,
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {
"source": "checkout",
"token": "4VCRLUFW"
},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1RC4YsCTw3MsNtCvCKY8etJ3",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
},
"us_bank_account": {
"mandate_options": {
},
"verification_method": "automatic"
}
},
"payment_method_types": [
"card",
"us_bank_account"
],
"single_use_mandate": null,
"status": "requires_confirmation",
"usage": "off_session"
}
I don't see any request to confirm that intent, only the one to create it, which is the one that returned that status value as requires_confirmation:
https://dashboard.stripe.com/test/logs/req_1hkPUvWCJ2vtuR
This is also a Setup Intent, so you'd be calling confirmSetup here instead. So are you using different code for handling this than the approach you shared earlier in the thread?
Sorry...I can switch to whatever...my system supports both
I need this to work though
Ok..so confirmSetup is not running properly.
Any idea why?
It's helpful if you share the actual code you're running with us, otherwise we don't have insight into what you're trying to debug and the best we can do is guess off the context that you do so share.
Based on what I'm seeing for that Setup Intent, no confirmation request is making it to our API for that intent. I don't know if that's because confirmSetup isn't being called, or if it's being called but blocked by a network or something.
I tested again a few seconds ago with the alert directly before the call and it did trigger
Do you have a publicly accessible test page where we can see this behavior?
I don't think that approach is going to be worth your time. The system is really complicated. It is setup to support multiple payment processors and basically all the functionality you offer.
Can I just repeat my last question.
How, would confirmSetup not run if an alert directly above it does run?
and no js errors
No idea, I can't think of a scenario where that would happen.
Unless you have code that catches all errors to keep them from landing on the browser console that is hiding an integration error we're throwing, or you have another JS script that is tearing down the one running, or some other bizarre edge case.
Ok...my guess is it has something do with the async tags that I am adding to the functions because I was forced to do so becuase your confirmSetup requires await.
I'm assuming that doesn't give you anything to worth with
I just know I've been coding js for 12+ years and when it runs procedurelly I understand its behavior well. But things are running async and afaik js doesn't give me any insight into what is happening
I guess I'll let you go then. I appreciate you trying to help
Does confirmSetup trigger when you dismiss your alert?
Looks like alert() pauses script execution, which may explain why your confirm code isn't being triggered after the alerts appear if you aren't dismissing them.
https://developer.mozilla.org/en-US/docs/Web/API/Window/alert
I don't know how to tell. I just know the alert before triggers and the one after does not.
and, according to your logs, it is not getting to your server
When the first alert triggers, do you click the button in the modal/popup to close the alert? If not, it seems expected for the execution of your script to be paused while the alert window is open.
I close it and it is the same behaviour as if it wasn't there
My thought there is to swap out your alert() calls for less disruptive console.log() calls, but if you still don't see anything I'm back to not having enough context to make an educated guess on why.