#manish777-identity
1 messages · Page 1 of 1 (latest)
heya @timber coral! i'm not really that familiar with Stripe Identity yet, but will give it a shot! can you share your account id i.e. acct_xyz, and do you have a url which we can take a look at the issue you're facing?
is there any way to do a screensharing? I can show you
hrm, not here on discord i think, you can probably do a screen recording?
yep, lemme send a video link
2 mins
Please watch this >> https://springbok-helpdesk.tinytake.com/msc/NTg2MDM1M18xNzk1MDA5Ng
can you share your code?
your video shows the PHP but not the client-side code
I'd like to see the JS
Can you share real code instead of pictures?
Just the front-end
My guess is that session.client_secret is invalid
Can you try hardcoding a value just to debug?
I did, but not getting the session token
var stripe = Stripe('pk_test_51JXpdiFCHSOKds3xR9cz3D7td5SfnLGUDahScMu61l6R5ViTRf5wZduKhRzhDkoEcAHqbevwu4d2UdKTq6YMxvB700X04kmSTO')
var verifyButton = document.getElementById('verify-button');
verifyButton.addEventListener('click', function() {
// Get the VerificationSession client secret using the server-side
// endpoint you created in step 3.
fetch('/create-verification-session', {
method: 'GET',
headers: {
"Content-Type": "application/json"
},
})
.then(function(response) {console.log(response)
return response.json();
})
.then(function(session) {console.log(session)
// Show the verification modal.
sessionStorage.setItem('verification_session_id', session.id);
return stripe.verifyIdentity(session.client_secret);
})
.then(function(result) {
// If verifyIdentity fails, you should display the error message
// using error.message.
if (result.error) {
alert(result.error.message);
} else {
window.location.href = 'submittedIdenity';
}
})
.catch(function(error) {
console.error('Error:', error)
});
});
this is my frontend code
you can wrap code in 3 ` to make it readable
but really the bug is on .then(function(session) {console.log(session) // Show the verification modal. sessionStorage.setItem('verification_session_id', session.id); return stripe.verifyIdentity(session.client_secret); })
that uses session.client_secret assuming you've deserialized the session class or something and I am confident that doesn't work
Try logging session.client_secret before that and you will see it is empty
So next, just create a Session manually in PHP and then look at the secret and then hardcode that secret instead of the variable and you should see it work
Does that make sense?
It might not be the problem, but that's where I would start personally
var stripe = Stripe('pk_test_51JXpdiFCHSOKds3xR9cz3D7td5SfnLGUDahScMu61l6R5ViTRf5wZduKhRzhDkoEcAHqbevwu4d2UdKTq6YMxvB700X04kmSTO')
var verifyButton = document.getElementById('verify-button');
verifyButton.addEventListener('click', function() {
fetch('/create-verification-session', {method: 'GET',headers: {"Content-Type": "application/json"}})
.then(function(response) { return response.json(); })
.then(function(session) { sessionStorage.setItem('verification_session_id', session.id); return stripe.verifyIdentity(session.client_secret); })
.then(function(result) {
if (result.error) {
alert(result.error.message);
} else {
window.location.href = 'submittedIdenity';
}
})
.catch(function(error) {
console.error('Error:', error)
});
});
See now if this helps
you keep posting the same code right?
yes
also please use to wrap. Just add 3 times before and after your code
just formatted to be readable
grrr Discord, the backtick character `
But really, did you see what I recommended? That's what you need to do next
sounds good, it's possible it's unrelated but it will help narrow things down
Nope, not helped again
I've recorded this whole so watch >> https://springbok-helpdesk.tinytake.com/msc/NTg2MDQ0Ml8xNzk1MDI2NA
did a compare with https://identity.stripedemos.com/ and my code looks okay
watching videos is not the best I'm sorry
that's a really long time to listen to, when you can share the code and output here in real time
like it's a 3+ minutes long entire video 😦
but okay I see you confirmed the client secret is coming back properly
Can you just try a separate code. Like just initialize Stripe.js properly and explicitly hardcode the client secret in your code
lemme do that
yeah I'm just trying to figure out what is causing the request to behave differently since I literally copy/pasted the code like yours except I just hardcode a secret manually and it works
Like your code does a GET to your endpoint and ours does a POST but that should be completely irrelevant in this flow
yes, all we need is client_secret to be generated, I did a get
vs_1JcjwOFCHSOKds3xICSb5SMq_secret_gmTzpXeAYwFGxand4bcWhD6QMskRt
I hardcoded and still the same invalid link
hum
is there anything to do with account settings?
this comes on top of my stripe account >>
I don't think so
Your account isn’t eligible
Unfortunately, your business isn’t eligible to use Stripe for payments because it doesn't meet our Terms of Service. If you think this may be a mistake, please contact us. You may continue to use Stripe Identity.
but I think that's for payments
pk_test_51JXpdiFCHSOKds3xR9cz3D7td5SfnLGUDahScMu61l6R5ViTRf5wZduKhRzhDkoEcAHqbevwu4d2UdKTq6YMxvB700X04kmSTO
let me try yours for a second
sure
(also you should never share the secret key, even Test)
ughhhhh what a horrible error
okay I get the exact same thing in my code with your key
so yes it's the problem, your account seems blocked from using the product likely because it's a fake/test account
you will have to reach out to our support team
oops
how come
that stands verified
I had done a payment -intent integration with another account and never had such headache that time
Stripe is not that complicated to integrate with such a perfect documentation
Not sure I'm sorry I've never seen this error but I can confirm I see the same problem with your keys and not mine so it's definitely a configuration issue on your account. I'd recommend asking our support team over email so that they can investigate: https://support.stripe.com/contact/email
Thanks for all the help 🙂
You could try to open a separate account in Test mode in the meantime just to test Identity
might unblock you overall, and sorry for the back and forth, so strange when issues like this happen. Mention you talked to me in Discord (I also reported it to the product team to debug and add a better error message too)