Hi, @donovanmat.76
First, your json seems to be malformed. You need to replace opening/closing quotes with standard double quote.
Second, you need to escape quotes in “payload” value as this is a single string value.
In the perfect scenario you should end up with the following body:
{ “body”: { “payload”: “{‘id’:4,‘status’:‘completed’,‘totalAmount’:100,‘tipAmount’:0,‘feeAmount’:3,‘settleAmount’:97,‘requiredAmount’:null,‘date’:‘2023-07-03T15:24:02Z’,‘snapCode’:‘Fa4GM9V2’,‘snapCodeReference’:‘5aead989-ac90-4be3-84ae-4230032aea32’,‘userReference’:‘777777’,‘merchantReference’:null,‘statementReference’:null,‘authCode’:null,‘deliveryAddress’:null,‘deviceSerialNumber’:null,‘extra’:{‘merchantId’:‘82C252D3-2105-4D80-9716-1842EED711EA’,‘transactionType’:‘Payment’,‘checksum’:‘6AD75139F93ED0E66541F9EF240D358AC6B7461E151D8AD55E2F473E683B7C5B’,‘amount’:‘100’,‘strict’:false,‘redirectUrl’:’’,‘successRedirectUrl’:’’,‘failRedirectUrl’:’’,‘id’:’’,‘wegotOrderId’:null,‘plugin’:’’,‘plugin_version’:’’},‘isVoucher’:false,‘isVoucherRedemption’:false,‘paymentType’:‘gateway’,‘transactionType’:‘payment’}” } }
What is the origin of the body text above? Can you turn this into a valid json string?
Once you get this as a valid json string, you can then extract different values from JSON string in your backend workflow using json plugins that support backend workflows (i.e. provide server-side actions). For example, JSON Manipulator. If you have a thing that corresponds to “payload” structure, you can also try other plugins that convert JSON to things, but I never tried them.
And the most comprehensive, but the most solid approach, is to create your own plugin that parses “payload” and exposes it as a set of values you need. If you know javascript it won’t take you more than an hour.
And finally, you always have an option to parse the whole request body yourself without initializing backend workflow parameters.