s2member
s2member copied to clipboard
Invalid Json sent to Stripe - s2memberPro with Stripe - Webhooks
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
- Send data on charge.succeeded event via webhook
- Try and json_decode that string...
BEHAVIOR THAT I EXPECTED
Should be able to json_decode and use the data.