#cnguyen-statement-descriptors
1 messages · Page 1 of 1 (latest)
Thank you. I take a look
So iI read it. Just to be sure. If I just want to add a suffix. It will use the default statement descriptor set for the connected account
And it will add the suffix that I set up ?
const paymentIntent = await stripe.paymentIntents.create({
amount: 1099,
currency: 'gbp',
payment_method_types: ['card'],
statement_descriptor_suffix: 'TEST',
});
It will give : DEFAULT_STATEMENT_DESCRIPTOR* TEST
And if it's too long, the end will be cut ?
And what is a 'non-card charges' ?
hey there, stepping in for karbi while they step away
The prefix is also limited in length, it used the "shortened" descriptor for these suffixed descriptors
And on my way, I want to have the default statement descriptor and add a suffix. But I want to use the suffix. But when I read the documentation, I think I don't create the payment intent to allow me to use the statement_descriptor_suffix. I do like that:
{ payment_method: stripePaymentMethod, payment_method_types: ['card'], amount: price, currency: currency, transfer_data: { destination: stripeMerchantId, }, metadata: additionalMeta, customer: user.stripeId, on_behalf_of: stripeMerchantId, setup_future_usage: 'off_session' };
But maybe I have to handle on another way, better with statement_descriptor and statement_descriptor_prefix. So move the default statement descriptor in the prefix and put the TEST (suffix) in statement_descriptor ?
A static prefix, also called a shortened descriptor in the Dashboard, must contain between 2 and 10 characters, inclusive. The remaining characters are reserved for the dynamic suffix.
https://stripe.com/docs/statement-descriptors#requirements
Yes but when I create my PI, I just want to add a suffix. Not a prefix
so in your example it would instead be: SHORT_DESC* TEST
Is it enough if I add the parameter 'statement_descriptor_suffix'
The prefix is set once at the account level, each PI need only set the suffix, yes
So, just to be sure, for example :
- I have a Connected account with the default statement descriptor set to 'MYSHOP'
- I create the PI on this way for now :
{
payment_method: stripePaymentMethod,
payment_method_types: ['card'],
amount: price, // in cents
currency: currency,
transfer_data: {
destination: stripeMerchantId,
},
metadata: additionalMeta,
customer: user.stripeId,
on_behalf_of: stripeMerchantId,
setup_future_usage: 'off_session'
};
- I add to it the 'statement_descriptor_suffix' with TEST for example
- It will give on the bank statement => MYSHOP* TEST
Right ?
You'd specify the account descriptor that's use as the prefix here: https://stripe.com/docs/api/accounts/update#update_account-settings-payments-statement_descriptor
If it's fill in here, it means it's already done ?
That looks like a full/long descriptor, which would be truncated to 10 char when using a suffix
SEWINSTYLE* TEST
OK because I use the login link to create the express connected account. When I use this, the statement descriptor seems to be set. So I do need to update the statement_descriptor with your link above ?
I believe it gets set during onboarding, but you can optionally set it to something else if preferred
You should test this with some test payment and inspect the result!
https://stripe.com/docs/api/charges/object#charge_object-calculated_statement_descriptor
The calculated_statement_descriptor is the final combined descriptor we send to the card networks
So you can see what the result would be for any given payment
I can test by creating the payment intent with the suffix so,and check the calculated one after that ?
Yep, exactly!
And you said that, if I setup a suffix, the statement descriptor will be always 10 char max ? It's not the rules with 22char max all included ?
When using a suffix the prefix is limited to 10 char, correct
And it means that the descriptor is 10 char max. And the suffix could be max 22char - 10char (- 2 char for * and space) = 10 char max
correct
anything longer than 22 will be truncated -- note the suffix can be longer if the prefix is shorter than 10 char
ok so the best way if I want to avoid that, it's to update the default statement descriptor
yes
And to retrieve the default statement descriptor ? What is it and where is it ?
And the stripe.oauth.token give me an account object too ?
yes, that's correct on the statement descriptor piece
on the oauth piece, could you clarify? are you asking if stripe's response to /oauth/token will return an account object?
yes
got it. in that case, no. if a call to /oauth/token is successful, stripe will respond with an access token and some other parameters. the access token can be used to make requests on behalf of the stripe account you authenticated: https://stripe.com/docs/connect/oauth-reference#post-token-response
Lurk: you never use the access token
You always use your own platform API key to make requests. Either on your account or connected accounts (via https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header)