#bishal-biswas_api
1 messages ยท Page 1 of 1 (latest)
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.
- bishal-biswas_api, 47 minutes ago, 14 messages
- bishal-biswas_api, 3 days ago, 5 messages
- bishal_card-funding, 5 days ago, 6 messages
๐ 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/1239906923038638181
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you provide me step by step guide which will set the payment method used by the user for zero dollar sub as default mode of payment
unfortunately I don't understand what you mean.
let's start over. You are using Checkout to create a Subscription for a customer?
Yes! I want the mode of payment they used for the checkout page should be automatically set to default mode of payment for them.
that's already the case, when you use Checkout it sets the default_payment_method of the Subscription to the payment method that was used.
is that not enough? do you want to set the customer-level default as well?
Let explain the issue,
We are trying to only onboard customer who has either credit card or debit card with balance in there account. We check the stripe when user complete the checkout session,
what type of card they used,
if that's a debit then we initiate a payment of 50 cents using PaymentIntent.create
for that we need payment_method_id
and for getting the payment_method_id I am using
payment_intent = stripe.PaymentIntent.retrieve(payment_intent_id, expand=["payment_method"])
which is not working as the default payment is not set for the customer.
- the value of
payment_intent.payment_methodhas nothing to do with default payment methods - it's very strange to charge an extra 50c for that, and might not be allowed in many countries (https://stripe.com/ie/resources/more/credit-card-surcharges-explained-what-businesses-need-to-know#rules-of-credit-card-surcharges)
- it also has a high chance of being declined I would say
maybe share more code showing how you create the CheckoutSession and handle the webhooks where you're trying to get that payment method to charge.
I need you help on this:
This is what we using to create a session id for checkout
checkout_session = stripe.checkout.Session.create(
customer_email=customer_email, # Add this line
mode='subscription',
line_items=[{
'price': pricing_plan_id, # The ID of the pricing plan
'quantity': 1,
}],
success_url='https://www.betimeful.com/success?session_id={CHECKOUT_SESSION_ID}',
cancel_url='https://www.betimeful.com/cancel-subscription',
)
hi! I'm taking over this thread.
this code will create a Checkout Session in Subscription mode. what's your question exactly?
is your goal to retrieve the payment method saved on the customer?
if so, you can use this: https://docs.stripe.com/api/payment_methods/customer_list
Yes! I need the payment method id for the customer who just made zero dollar checkout
then yes, check the link I shared above.
Yes I have checked and implemented the code but it does not work for the customer who has zero dollar checkout as the payment_intent is null
can we use stripe.SetupIntent.retrieve to retrieve setup_intent.payment_method ?
Yes I have checked and implemented the code but it does not work for the customer who has zero dollar checkout as the payment_intent is null
what does not work? when you list the payment method there's nothing returned? can you share the customer ID (cus_xxx)?
Yes! For customer who just onboard using zero dollar checkout return no payment method,
For this customer I have to set the default mode of payment from the dashboard "cus_Q6F6Tkvykb3rMd"
this customer does have a payment method
you cans see it here: https://dashboard.stripe.com/customers/cus_Q6F6Tkvykb3rMdW
so just use this: https://docs.stripe.com/api/payment_methods/customer_list
Okay wait let create new customer
Hi! Actually it worked for new customer and I was able to fetch the payment method.
I want to know, why it was not worked for the this "cus_Q6F6Tkvykb3rMd" customer. After setting the visa card as default mode of payment from the dashboard it worked? Is anything special about this customer?
Hi there ๐ jumping in as my teammate needs to step away soon. Can you share the ID of the request where you tried to list Payment Methods for that Customer?
ok
Just checking to see if you were able to get the ID of that request you made to list Payment Methods that didn't return any results?