- last update
about 1 year ago 38 pass - π¨π¦Canada leducdubleuet Chicoutimi QC
We would need to do the same for a specific project so I created a patch adding this feature.
I tested in Stripe test mode and this adds the owner's display name in the customer created on Stripe as intended.
As you know, Stripe simply uses the email as the customer's name when the name is not specified on creation.
I wonder if using the display name might cause some unwanted side effects?
Can someone confirm this is OK to do so?
Thank you!
- Status changed to RTBC
about 1 year ago 9:28am 23 December 2023 - π¬π§United Kingdom jonathanshaw Stroud, UK
I can't imagine any side effects.
- π¨π¦Canada leducdubleuet Chicoutimi QC
@jonathanshaw
Thank you for your feedback.@maintainers
Would it be possible to see this new feature anytime soon in a new release?Thanks.
- π¨π¦Canada maursilveira Windsor, ON
@LeDucDuBleuet
Thank you for the patch, but I'm a bit confused here, and not seeing the expected result.
I applied the patch, and have Realname β configured in my site with
[user:field_first_name] [user:field_last_name]
as pattern. When I call::getDisplayName()
elsewhere I get the correct user name format. However, when I complete a purchase using Commerce Stripe for a new customer, it gets created in Stripe with the name empty. All I see is the email address and the description "Customer for ".Am I missing something here? Do I need any other configuration for getting the user display name to have this working?
Thank you.
- π¬π§United Kingdom jonathanshaw Stroud, UK
This is not caused by this patch or fixable here. Likely it's because the real name is not properly available for a new user.
You might be able to workaround that using the display name alter hook.
You could also check for and/or create an issue for this module to add an event to allow customising the Stripe customer metadata.
- Status changed to Needs review
10 months ago 6:39pm 27 February 2024 - π¨π¦Canada maursilveira Windsor, ON
@jonathanshaw Thank you for your response, but I've just figured out the cause of the issue: I am using Stripe Payment Element, and the patch #3 only adds the
name
item to the classStripe
.I created a new patch that adds the name for both payment gateways. Moving the issue back to "Needs review" status.
Please let me know if you have any questions, concerns or comments.
Thank you.
- Status changed to RTBC
10 months ago 9:37am 28 February 2024 - Merge request !84Issue #3090817: User display name for stripe customer name β (Open) created by maursilveira
- πΊπ¦Ukraine marchuk.vitaliy Rivne, UA
vmarchuk β made their first commit to this issueβs fork.
- Merge request !87Issue #3090817: User display name for stripe customer name. β (Merged) created by Unnamed author
-
vmarchuk β
committed 5704290a on 8.x-1.x
Issue #3090817: User display name for stripe customer name.
-
vmarchuk β
committed 5704290a on 8.x-1.x
- Status changed to Fixed
10 months ago 2:54pm 4 March 2024 - π¨π¦Canada leducdubleuet Chicoutimi QC
This is great, thank you very much!
I guess this will be included in the next pre-release version 8.x-1.2-rc2, right?
For a new site, this is perfect but what about existing sites with customers on Stripe already created prior to this new behaviour? I guess we could have some code to update them on our Stripe account from Drupal? Would that possible? Advisable?
Thanks again.
- πΊπ¦Ukraine marchuk.vitaliy Rivne, UA
@LeDucDuBleuet
Definitely possible. This could be hook_update() with a batch where we can go through all Stripe users and update them accordingly.
Please create a separate issue for this. - π¨π¦Canada leducdubleuet Chicoutimi QC
OK, thank you for your quick reply.
I was just asking for now and I will open a new issue for that if need be.
Thanks again!
Automatically closed - issue fixed for 2 weeks with no activity.
- π¬π§United Kingdom joehuggans Harrogate, UK
Can I ask why you wouldn't use the name from the billing profile if available for this rather than the username?
- π¬π§United Kingdom jonathanshaw Stroud, UK
Hi @joe, I'm not sure. The billing profile is specific to the order; but the Drupal user is counterpart to stripe customer, the stripe customer id is stored on Drupal user entity I think. If the billing profile has the better info in a certain use case, maybe the display name needs to be updated to use it.