#nikolay_code
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/1381723100479230134
📝 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.
- nikolay_code, 7 minutes ago, 27 messages
- nikolay_code, 4 hours ago, 24 messages
Hello
Ive fixed my code but its still not working, my logs show everything is working
Hello, can you tell me more about what specifically isn't working with your code?
payment_intent.created
Inspect event detail in Workbench
Event data
{
"id": "pi_3RYBeB1VlpCPYqMR0oBystqS",
"object": "payment_intent",
"last_payment_error": null,
"livemode": false,
"next_action": null,
"status": "requires_payment_method",
"amount": 100,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 0,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3RYBeB1VlpCPYqMR0oBystqS_secret_Dmzz3hvTOHgUxF13izvBDBSPf",
"confirmation_method": "automatic",
"created": 1749498379,
"currency": "gbp",
"customer": "cus_ST7tBFSEKqDsss",
"description": "Subscription creation",
"latest_charge": null,
"metadata": {
},
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": "off_session",
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"transfer_data": null,
"transfer_group": null
}
I dont know, ive removed all payment intents as stripe no longer supports this from their breaking update: https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices ive adjusted my code to append to this but its still not working, my logs show everything is ok.
The main problem is that the 3DS isnt showing up so the payment is being regarded as incomplete
Logs:
[09-Jun-2025 19:46:18 UTC] ---- payments-api.php START ----
[09-Jun-2025 19:46:18 UTC] Request method: POST
[09-Jun-2025 19:46:18 UTC] Raw POST data:
[09-Jun-2025 19:46:18 UTC] $_POST: Array
(
[cs_booking_nonce] => 5ae374b68c
[_wp_http_referer] => /checkout/
[firstName] => Stripe
[lastName] => Stripe
[email] => Stripe@Stripe.com
[phone] => 0300303003
[swimmerFirstName] => Stripe
[swimmerLastName] => Stripe
[swimmerAge] => 30
[swimmerAbility] => Stripe
[lesson_type] => private
[lesson-category] => adult
[payment-plan] => price_1RJe2j1VlpCPYqMR8UkiOwNI
[cardName] => Stripe
[address] => Stripe
[city] => Stripe
[postCode] => d430jd
[payment_method_id] => pm_1RYBe91VlpCPYqMRqNFwKS9z
[payment-plan-name] => Starter
[lessonCategory] => adult
[form_version] => v1.0.0
[submitted_at] => 1749498377181
)
[09-Jun-2025 19:46:18 UTC] ✅ Security check passed
[09-Jun-2025 19:46:18 UTC] ✅ Core inputs sanitized: first=Stripe, last=Stripe, email=Stripe@Stripe.com, plan=price_1RJe2j1VlpCPYqMR8UkiOwNI
[09-Jun-2025 19:46:18 UTC] ✅ Metadata compiled
[09-Jun-2025 19:46:18 UTC] ✅ Stripe initialized
[09-Jun-2025 19:46:18 UTC] ℹ️ Idempotency key: sub_e1e230eb1a3ff06dfed1267927c9a5f3
[09-Jun-2025 19:46:18 UTC] ℹ️ Creating Stripe customer for Stripe@Stripe.com
[09-Jun-2025 19:46:18 UTC] ✅ Customer created: id=cus_ST7tBFSEKqDsss
[09-Jun-2025 19:46:18 UTC] ℹ️ Creating subscription for customer cus_ST7tBFSEKqDsss
[09-Jun-2025 19:46:20 UTC] ✅ Subscription created: id=sub_1RYBeB1VlpCPYqMR4i0bJWcZ
[09-Jun-2025 19:46:20 UTC] ✅ confirmation_secret obtained
[09-Jun-2025 19:46:20 UTC] ℹ️ Responding with confirmation_secret client secret
Gotcha, happy to help debug the 3DS issue. Does your code confirm your payment intents on your server or in the web browser here? Stripe.js should automatically show 3DS if the intent is confirmed on the client. If it is on your server, your code is expected to signal that 3DS is needed to the client so that it can call handleNextAction and show 3DS
I know you provided quite a bit of your code, but my colleagues and I typically can't just look at hundreds of lines of code, it is better if we keep things focused and just look at snippets of code as they become relevant
yea sure:
My integration confirms the PaymentIntent in the browser, not on the server. In my stripe-elements.js i call:
form.addEventListener('submit', async e => {
e.preventDefault();
if (submitBtn) submitBtn.disabled = true;
// … create PaymentMethod, append hidden fields, etc.
// 9️⃣ Confirm using PM ID + return_url
let confirmResult;
try {
confirmResult = await stripe.confirmCardPayment(
csSecret, {
payment_method: pmResult.paymentMethod.id,
return_url: window.location.origin + '/thank-you'
}
);
} catch {
return showError('Authentication failed—please try again.');
}
console.log('🛎 confirmCardPayment result:', confirmResult);
if (confirmResult.error) {
return showError(confirmResult.error.message);
}
// 🔟 Redirect handled by Stripe via return_url
});
Interesting. Stripe.js should definitely handle 3DS at that point. And from your logs I see that "🛎 confirmCardPayment result" isn't logged. Have you checked whether that confirmCardPayment call is actually getting called? It sounds like that code is either hanging somehow or not getting called
adding logs to check now, eta 2 min plz
Sounds good, it looks like the PI you provided earlier pi_3RYBeB1VlpCPYqMR0oBystqS never got confirmed, so it looks like your code is either not getting called or it is erroring out in some way
still here, please bear with
oh my.
The 3DS works but i dont know how, i asked chatgpt to answer since i dont know how to fix it and it fixed it. 3DS now appearing:
Logs:
[Log] Final formIsValid = – false (front-end.js, line 169)
[Log] [stripe-elements] 🔔 Submit handler fired (stripe-elements.js, line 116)
[Log] [stripe-elements] ℹ️ Billing details collected – Object (stripe-elements.js, line 127)
Object
[Log] [stripe-elements] ▶️ Calling stripe.createPaymentMethod… (stripe-elements.js, line 132)
[Log] [stripe-elements] ✅ stripe.createPaymentMethod result: – Object (stripe-elements.js, line 143)
Object
[Log] [stripe-elements] 🔗 Attached payment_method_id: – "pm_1RYCKq1VlpCPYqMRE5L06W18" (stripe-elements.js, line 159)
[Log] [stripe-elements] 🔗 Attached plan: – "price_1RJe2j1VlpCPYqMR8UkiOwNI" – "Starter" (stripe-elements.js, line 176)
[Log] [stripe-elements] ℹ️ Extra metadata appended: – Object (stripe-elements.js, line 199)
Object
[Log] [stripe-elements] 📡 Sending request to server (stripe-elements.js, line 222)
[Log] [stripe-elements] 📡 Response status: 200 (stripe-elements.js, line 229)
[Log] [stripe-elements] 📡 Parsed server JSON: – Object (stripe-elements.js, line 231)
Object
[Log] [stripe-elements] ✅ Server returned success (stripe-elements.js, line 240)
[Log] [stripe-elements] ℹ️ confirmation_secret received: – "pi_3RYCKs1VlpCPYqMR02vBBRLG_secret_yuBFtGTZHM47X62PHrfGlkOm0" (stripe-elements.js, line 244)
[Log] [stripe-elements] 🛠️ About to call confirmCardPayment with secret (stripe-elements.js, line 251)
[Log] [stripe-elements] ▶️ Calling stripe.confirmCardPayment… (stripe-elements.js, line 254)
If youre interested. Here is the file difference:
Old (bad):
Good: (working):
thanks though anyways.
Of course, glad it is working now
payment_intent.succeeded
Inspect event detail in Workbench
Event data
{
"id": "pi_3RYCKs1VlpCPYqMR02vBBRLG",
"object": "payment_intent",
"last_payment_error": null,
"livemode": false,
"next_action": null,
"status": "succeeded",
"amount": 100,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 100,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3RYCKs1VlpCPYqMR02vBBRLG_secret_yuBFtGTZHM47X62PHrfGlkOm0",
"confirmation_method": "automatic",
"created": 1749501026,
"currency": "gbp",
"customer": "cus_ST8cIVoX5ql8VV",
"description": "Subscription creation",
"latest_charge": "ch_3RYCKs1VlpCPYqMR0QOI6DbU",
"metadata": {
},
"on_behalf_of": null,
"payment_method": "pm_1RYCKq1VlpCPYqMRE5L06W18",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": "off_session",
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"transfer_data": null,
"transfer_group": null
}
yes is succeeded on stripes test end.
thanks anyways from the UK, youve been a big help. I hope you get some sleep in the states.
never mind its 16:36 in easter standard time
I appreciate the sentiment anyways, get some sleep yourself!