#shawon34_code
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.
- shawon34_code, 6 hours ago, 4 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/1233424062127276082
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐ I see you mentioned a concern in livemode. Are you able to reproduce this same behavior when your site is running against testmode?
My website is already running live. Card payments are working perfectly, but when I tried using bank payments, it was set up successfully but not working for actual payments.
What's the behavior you're seeing? What errors are you encountering? Do you have example objects that I can look at?
It looks a little odd that there is a request to attach the Payment Method in your code. Confirming the Setup Intent should attach the Payment Method to the Customer.
Wait, I will test it again. After that, I will explain it to you in full. The payment was successful when using a card, but not successful when using a bank payment.
try:
if payment_method_types == "us_bank_account":
stripe.PaymentMethod.attach(
stripe_payment_id,
customer=customer.stripe_customer_id,
)
payment = stripe.PaymentIntent.create(
payment_method=stripe_payment_id,
customer=stripe_customer_id,
amount=int(1 * 100),
currency='usd',
confirm=True,
return_url='https://my_domain.com/',
off_session=True,
payment_method_types=["ach_credit_transfer", "ach_debit", "us_bank_account"]
)
else:
payment = stripe.PaymentIntent.create(
payment_method=stripe_payment_id,
customer=stripe_customer_id,
amount=int(1 * 100),
currency='usd',
confirm=True,
return_url='https://my_domain.com/',
off_session=True
)
except Exception as e:
print(str(e))
if payment.status == 'succeeded':
print("Payment success.")
else:
print("Payment not success.")
When I used my set up bank account, it always prints "Payment not success."
Okay. What is the ID of a failed Payment Intent from your testing? What is the error on that Payment Intent?
Right now, all that tells me is the Payment Intent isn't going to a succeeded state, so your code throws that "Payment not success" string.
I don't know the payment intent ID or any other ID because everything is saved in our database, which is on a server. We cannot see the database. That's the issue.
After bank setup, should i wait 48hours or is it immediate?
๐ hopping in here since toby has to head out soon
Generally, if the Setup Intent has a status of succeeded that means it should be ready for future payments
If there's no object ID that we can look at it's really hard for us to give you concrete next steps on what may be happening with the payment
Is there any way for you to get an ID?
def setup_payment_account_for_bank(request):
user = User.objects.get(id=request.user.id)
customer = Customer.objects.get(user=user)
customerIndentForBank = stripe.SetupIntent.create(
customer = customer.stripe_customer_id,
payment_method_types=["us_bank_account"],
payment_method_options={
"us_bank_account": {
"financial_connections": {"permissions": ["payment_method", "balances"]},
},
},
)
client_secret_for_bank = customerIndentForBank.client_secret
context = {
"customer": customer,
"client_secret_for_bank": client_secret_for_bank,
}
return render(request, "setup_payment_account_for_bank.html", context)
Here is the code. Now i cannot setup my bank account
Here is the error
Have you read through the error message you got back? It says you're missing some part of your setup and need to go to the dashboard if you want to use financial connections
If the payment is not working for the bank, which ID do you want?
We would need the Payment Intent ID