#knuppi-connectaccount-objects
1 messages ยท Page 1 of 1 (latest)
HI ๐
I"m going to need much more information to help here.
What is the error they are seeing? How are you creating Payment Intents?
Sorry, we are NOT successful in creating a paymentintent
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
The token ID comes from the mobile app
The error message is pretty explicit. The token parameter is not valid
Yes, however. We're using your Stripe Google/Apple Pay Flutter package
Okay, how does that change anything?
I'm a bit lost. When we run this through staging and localhost, then everything is working
You need to be creating a Payment Method (instead of a token) and using that ID pm_ as the payment_method parameter
We're using stripe_account in all our communication with your API
That doesn't change this either
I'm sorry if it's confusing but you keep bringing up things that have no connection to the error you are seeing
What you are attempting to do is to provide a payment method when creating the payment Intent. But you are using a Token ID, which is not valid
You need to create a Payment Method and supply it in the payment_method parameter
the token - which is wrong - is generated by your flutter library, am I not correct?
We dont' have or support a flutter library. That is a third party
https://pub.dev/packages/flutter_stripe
This is yours, no?
I'm curious - and this is perhaps outside your purview - but how is the token generated? Do you have an API endpoint for it?
Also; is it possible to read change logs for your APIs?
Need to understand why a token is generated when it's faulty. I mean, It shouldn't be generated at all if it's wrong/broken
This is an old integration as far as I know. The Tokens API does exist but it was inteded to work with the Charges API.
https://docs.stripe.com/api/tokens
Even when using the Tokens API, it will create a different type of ID for each type of payment method
For example, if you use the Tokens API to create a Credit Card payment method it will have an ID with card_
What is the suggested approach when creating PaymentIntents now?
During testing, we've been using "token": "pm_card_visa", and then the flutter_stripe package to use it in production
Yes that works because It's a Payment Method, not a Token or a Card
Payment Intents are designed to work with Payment Methods
Since we don't own and control flutterstripe, I don't have insight into how that package is confgured. but I would imagine there are ways to create payment methods instead of tokens
if self.token and not settings.DEBUG:
intent_kwargs |= {
"payment_method_data": {
"type": "card",
"card": {"token": self.token},
},
}
return stripe.PaymentIntent.create(**intent_kwargs)
this worked until recently, and it seems that there may be some problem between stripe_flutter and your API?
When you say "this worked" do you have any example requests where it was successful?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Do you see anything weird/odd?
OH!
Sorry for the delay. I see the problem now
๐คฆโโ๏ธ
The issue is that this request that failed is a Direct Charge. This means that the payment method represented by that Token ID and the Customer both need to exist on the Connected Acount
But that is not the case here.
Oh, could you explain a bit further?
The customer, are they not connected to the Account?
No they are not
The Connected Account is acct_1NvFsKQ6t7QQwXAB, But the Token exists on account acct_1MRCHrL8luXqMHtb . So even though the Customer exists on the Connected Account, the Token does not
which Account does cus_PdMJiCRVUw2Mgn belong to?
The Connected Account
This is what I see in our server logs as well
No it should not, because the Token does not belong to that Customer or Account
Ooooh! So when the Token is created, it has to be called with stripe_account=acct_1NvFsKQ6t7QQwXAB in the header - correct?
Correct
Can you please verify that the stripe_account is missing from the Token generation call? (like, if you check the token and check its history?)
Your (very good) search field doesn't give me any results.
Thank you for checking!
The token request was made with the account header for acct_1MRCHrL8luXqMHtb
So you will need to review the workflow for your application to make sure it keeps the correct Stripe Account header for all related requests.
Can you give me the name of the Account with acct_1MRCHrL8luXqMHtb?
Sorry no. This is something you will need to look up via the API.
And pleae do not share those names here
OK, so if I'm correct we must make sure that the stripe_account-header is correct when requesting the token and that should fix everything?
Correct, that is what I am gathering from these API requests
You will want to make sure you are using the same stripe_account header value for all the calls that should be occurring on the same account
Yes, absolutely correct!
Great! Hopefully ๐ค that has resolved your issue
You've absolutely pointed me in the right direction ๐