You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Stripe payment for ticket purchases in Camptix, if the ticket name contains [, an error occurs in the Stripe API response. This is because the Stripe API specification interprets the string inside [] as an object key. To resolve this issue, the clean_metadata function needs to replace [] with another character like ().
To reproduce
Create a new ticket and include the [ string, e.g., 6/2 – Micro Sponsor [ 10USD ]
Enable Camptix Stripe Payment (it's okay to use sandbox mode)
Try to order this ticket from the Ticket page
You will encounter an error when creating a new Stripe Checkout Session
Expected behavior
The ticket name needs to be included in the metadata of the Stripe Payment Intent object when creating Stripe Checkout Sessions API.
e.g.: $args['payment_intent_data']['metadata']['6/2 [Sponsor ticket]'] = '1';
**Expected Behavior
The ticket name needs to be included in the metadata of the Stripe Payment Intent object when creating Stripe Checkout Sessions API.
e.g.: $args['payment_intent_data']['metadata']['6/2 [Sponsor ticket]'] = '1';
Actual Behavior**
Due to the Stripe API specification, a text inside the [] will be converted to an object key like the following:
I think this is something that needs to be raised with Stripe, as to whether it's a bug on their platform, as using square brackets in their UI also results in a.. less than expected, unexpected request error.
Screen.Recording.2024-03-19.at.11.50.17.AM.mov
I've raised a support ticket with them, as [] are not documented as being invalid in the field.
Describe the bug
When using Stripe payment for ticket purchases in Camptix, if the ticket name contains
[
, an error occurs in the Stripe API response. This is because the Stripe API specification interprets the string inside[]
as an object key. To resolve this issue, theclean_metadata
function needs to replace[]
with another character like()
.To reproduce
[
string, e.g.,6/2 – Micro Sponsor [ 10USD ]
Expected behavior
The ticket name needs to be included in the metadata of the Stripe Payment Intent object when creating Stripe Checkout Sessions API.
e.g.:
$args['payment_intent_data']['metadata']['6/2 [Sponsor ticket]'] = '1';
**Expected Behavior
The ticket name needs to be included in the metadata of the Stripe Payment Intent object when creating Stripe Checkout Sessions API.
e.g.:
$args['payment_intent_data']['metadata']['6/2 [Sponsor ticket]'] = '1';
Actual Behavior**
Due to the Stripe API specification, a text inside the
[]
will be converted to an object key like the following:Suggestion
In the
clean_metadata
function, we may need to replace the[]
string with another character like()
instead.When we avoid passing the
[]
string as the key of the metadata, the Stripe API request will work correctly.This idea seems reasonable, and if you approve, I'll proceed with creating a new pull request for this.
Screenshots
If applicable, add screenshots to help explain your problem.
WordCamp
If this is a problem on a specific WordCamp's site, list the site or page URL here.
At the WordCamp Kansai 2024, we suffered from this error:
https://kansai.wordcamp.org/2024/wp-admin/post.php?post=3772&action=edit
System (please complete the following information):
Security Issues
To report a security issue, please visit the WordPress HackerOne program: https://hackerone.com/wordpress.
The text was updated successfully, but these errors were encountered: