#manish777-identity

1 messages · Page 1 of 1 (latest)

somber wedge
#

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?

timber coral
#

is there any way to do a screensharing? I can show you

somber wedge
#

hrm, not here on discord i think, you can probably do a screen recording?

timber coral
#

yep, lemme send a video link

#

2 mins

digital lynx
#

can you share your code?

#

your video shows the PHP but not the client-side code

#

I'd like to see the JS

timber coral
#

This is for frontend

#

This is how I create the verification session

digital lynx
#

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?

timber coral
#

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

digital lynx
#

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

timber coral
#

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

digital lynx
#

you keep posting the same code right?

timber coral
#

yes

digital lynx
#

also please use to wrap. Just add 3 times before and after your code

timber coral
#

just formatted to be readable

digital lynx
#

grrr Discord, the backtick character `

#

But really, did you see what I recommended? That's what you need to do next

timber coral
#

let me try that first, and then will get back

#

brb in 5 mins

digital lynx
#

sounds good, it's possible it's unrelated but it will help narrow things down

timber coral
#

Nope, not helped again

digital lynx
#

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

timber coral
#

lemme do that

digital lynx
#

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

timber coral
#

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

digital lynx
#

hum

timber coral
#

is there anything to do with account settings?

#

this comes on top of my stripe account >>

digital lynx
#

I don't think so

timber coral
#

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.

digital lynx
#

ah

#

Can I give you a publishable key and client_secret to try / hardcode?

timber coral
#

but I think that's for payments

#

pk_test_51JXpdiFCHSOKds3xR9cz3D7td5SfnLGUDahScMu61l6R5ViTRf5wZduKhRzhDkoEcAHqbevwu4d2UdKTq6YMxvB700X04kmSTO

digital lynx
#

let me try yours for a second

timber coral
#

sure

digital lynx
#

(also you should never share the secret key, even Test)

timber coral
#

hmm

#

will update once done

digital lynx
#

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

timber coral
#

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

digital lynx
#

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

timber coral
#

Thanks for all the help 🙂

digital lynx
#

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)