s2member icon indicating copy to clipboard operation
s2member copied to clipboard

Invalid Json sent to Stripe - s2memberPro with Stripe - Webhooks

Open Dean-Wilson opened this issue 7 years ago • 0 comments

EXPLANATION OF THE ISSUE

I am in the process of using a webhook from stripe to generate a CSV with member info on the charge.succeeded event. The data that gets sent to Stripe and then to my webhook includes these lines:

"metadata": {
      "tax_info": "{"tax":"0.00","tax_per":"0%"}"
    },

These lines are invalid Json and I am therefore unable to json_decode them and use the data to create my CSV. After contacting Stripe they have made it clear that those lines above form part of the POST from the site so it isn't an issue with Stripe. I have another site using a webhook as well and they have also started failing as of a couple of months ago and I suspect it's the same issue. Not sure if something has changed recently as it was working before that..

STEPS TO REPRODUCE THE ISSUE

  1. Send data on charge.succeeded event via webhook
  2. Try and json_decode that string...

BEHAVIOR THAT I EXPECTED

Should be able to json_decode and use the data.

Dean-Wilson avatar Aug 25 '17 04:08 Dean-Wilson