#iefsu
1 messages · Page 1 of 1 (latest)
import stripe
stripe.api_key = ""
payment_method = stripe.PaymentMethod.create(
type="card",
card={
"number": "4000002760003184",
"exp_month": 12,
"exp_year": 2023,
"cvc": "123",
},
)
customer = stripe.Customer.create(
email="customer@example.com",
payment_method=payment_method.id, # Replace with your own payment method ID
)
stripe.PaymentMethod.attach(payment_method.id, customer=customer.id)
stripe.Customer.modify(
customer.id,
invoice_settings={
"default_payment_method": payment_method.id,
},
)
product = stripe.Product.create(
name="My Product",
description="A test product",
)
price = stripe.Price.create(
unit_amount=1000, # Replace with your own price amount
currency="usd",
recurring={"interval": "month"},
product=product.id,
)
subscription = stripe.Subscription.create(
customer=customer.id,
items=[{
"price": price.id,
}],
)
i have this problem
when more verification is required the payment stays incomplete
how to redirect the user to the verification page (bank vbv) to complete verification
Hi, it looks like you're creating a Subscription and you can enable a setting in the Dashboard to send emails: https://dashboard.stripe.com/settings/billing/automatic in cases like this when 3DS is required.
'Send a Stripe-hosted link for customers to confirm their payments when required'
So in cases like these, when it's enabled, a Stripe hosted link will be sent to the customer to confirm the payments
they will have to re-enter the info once again?
can i just get that link from a webhook and redirect user to it?
No, you can look at the preview email here to see what it looks like.
on other websites that's uses stripe subscriptions
i don't have to do this when i'm the client for example netflix displays the verification page inside netflix page (iframe)
how to do that?
actually stripe does provide that
it's called
"next_action": {
"type": "use_stripe_sdk",
"use_stripe_sdk": {
"source": "src_1MwY0WK8PSvVi4I4",
"stripe_js": URL
}
I brushed over the second question, can i just get that link from a webhook and redirect user to it?.
Looking