• Resolved Simon

    (@simonmaddox)


    Our shop name is “Ruby & Ginger” but messages sent to Stripe shows html coding – e.g. a Payment Intents message:

    {
      "amount": "1050",
      "currency": "GBP",
      "description": "Order 672 from Ruby &amp: Ginger",
      "shipping": {
        "address": {
    

    (I had to change the closing semicolon to colon otherwise it gets removed when I post!!)

    Is this easy to fix?

    • This topic was modified 4 years, 2 months ago by Simon. Reason: &amp got lost
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @simonmaddox,

    The data is encoded before it’s sent to Stripe to ensure special characters don’t cause API request errors.

    The easiest fix is to change “&” to “and” in your description. You can do this be either editing your blog name (I doubt you want to do that) or change it in the plugin’s filter.

    Example:

    add_filter('wc_stripe_payment_intent_args', function($args, $order){
        $args['description'] = sprintf( __( 'Order %1$s from Ruby and Ginger', 'woo-stripe-payment' ), 
        $order->get_order_number(), get_bloginfo( 'name' ) );
        return $args;
    }, 10, 2);

    Kind Regards,

    Thread Starter Simon

    (@simonmaddox)

    Thanks for the reply – and the suggested workaround. Unfortunately we use the ‘&’ symbol a lot in the shop within the product titles too, so I don’t think that hook will be enough for our needs.

    It’s clear Stripe is not looking for html encoded text as it displays it verbatum – is there any other way you could avoid API request errors without adding the html coding that Stripe will not interpret correctly?

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @simonmaddox,

    It’s actually the Stripe PHP SDK that encodes the ‘&’ symbol so it would require by-passing Stripe’s code in some instances which is not a good option.

    My recommendation is to reach out to Stripe support and inquire if there are any settings or options available for this scenario. Reply back to this thread once you hear from them and we can review what they respond with.

    Kind Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘ampersand html coding in messages to Stripe’ is closed to new replies.