#caijixingxing_code
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1250614043408863365
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
Hi, by confirmCardSetup are you using PaymentElement?
PaymentElement already did HCaptcha for you https://docs.stripe.com/disputes/prevention/card-testing#optimize-integration
Yes, I have read this document before, but I don't know how to write the front-end code to implement implicit verification. Part of my code is as follows:
<!DOCTYPE html>
<html>
<head>
<title>Add Payment Method</title>
<script src="https://js.stripe.com/v3/?advancedFraudSignals=true"></script>
</head>
<body>
<form id="setup-form">
<div id="card-element"></div>
<button id="submit-button">Add Payment Method</button>
</form>
<script>
var stripe = Stripe('my public key');
var elements = stripe.elements();
var card = elements.create('card');
card.mount('#card-element');
var form = document.getElementById('setup-form');
var submitButton = document.getElementById('submit-button');
form.addEventListener('submit', function(event) {
event.preventDefault();
submitButton.disabled = true;
stripe.confirmCardSetup(
'paste client_secret from my server',
{
payment_method: {
card: card,
billing_details: {
name: 'Jenny Rosen'
}
}
}
).then(function(result) {
if (result.error) {
submitButton.disabled = false;
} else {
console.log(result.setupIntent.payment_method);
}
});
});
</script>
</body>
</html>
Okie you use CardElelments. Btw are the screenshot correct? I see hCaptcha on the right when it says “your website, do not begin”
The screenshot is correct. In the screenshot on the right, hCaptcha is not activated immediately when entering the website. You need to click "Submit" to trigger confirmCardSetup to activate hCaptcha verification. I hope hCaptcha will be activated as soon as I enter the website.
I see, you want a more of implicit + controllable hCaptcha with Stripe. I am afraid we currently don't offer that customization. But please write to Support and we can record your feedback