New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use statement_descriptor_suffix
for card payments and fallback to Stripe account statement descriptions for all payments
#2833
Conversation
|
||
// Stripe requires at least 1 latin (alphabet) character in the suffix so we add the first character of the prefix before the order number. | ||
if ( 0 === preg_match( '/[a-zA-Z]/', $suffix ) ) { | ||
$suffix = substr( $prefix, 0, 1 ) . ' ' . $suffix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to add some additional details for the reviewer. Stripe requires the statement_descriptor_suffix
to have at least 1 latin character in it - ie an letter from the alphabet.
Normally the get_order_number()
wouldn't include a letter as it would just be #1245
. Some folks do customise the order number to include a letter so I've made this conditional based on that.
If the order number doesn't include a letter, I just took the first letter of the prefix from the Stripe account settings and added it.
eg the suffix may look like this WCDEV* W #123
.
I considered an "O" for order. I considered the customers first name initial. I didn't like either of those two options though. Feedback is very welcome :)
… the Stripe account
… suffix for card payments
… the suffix for card payments
49a2ee1
to
740717a
Compare
@diegocurbelo I'm just noting that because I'm still not sure what causes it. But now that I have been able replicate on own account I have a feeling it's either new accounts or specific to certain countries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the work investigating this @james-allan!
The code looks good, and it works great (the fields updating with the Stripe on refresh are great).
The required latin character in the suffix is not ideal, and I don't have a different idea 🤷🏼, but we should update the preview in the settings to reflex that extra character.
Thanks for the feedback @diegocurbelo. I've updated the statement previews to include the latin character inserted into the description. I changed the description in my Stripe settings to confirm it is updated in the previews too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @james-allan! 🚢
Fixes #2830
Changes proposed in this Pull Request:
According to Stripe's docs, using the
statement_descriptor
parameter for card payments is deprecated since January 2nd 2024. We're suppose to be usingstatement_descriptor_suffix
instead.No one internally has been able to replicate this issue, however many merchants have already reported this and experiencing this error.
This PR does a number of things to fix this:
statement_descriptor
arg.statement_descriptor_suffix
.Testing instructions
Base tests
develop
you'll notice the bank statement description settings are customisable.Repeat the following steps with both UPE enabled and disabled.
changelog.txt
andreadme.txt
(or does not apply)Post merge