• Pavan Gunda 4
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I need to read ContactID from my below JSON.  I used this code to read the fieldvalue, but returning null. 

StripeJSON = StripeChargeParser.parse(RestContext.request.requestBody.toString());
             if (StripeJSON.type == 'charge.succeeded') {       
                system.debug('ContactId:'+StripeJSON.data
                            );


{
  "id": "evt_3LAK6BBp4qEbkdeL1hyxcg7K",
  "object": "event",
  "data": {
    "object": {
      "id": "ch_3LAK6BBp4qEbkdeL1YeUC11P",
      "object": "charge",
      "amount": 100,
      "amount_captured": 100,
      "amount_refunded": 0,
      "balance_transaction": "txn_3LAK6BBp4qEbkdeL1I0CRyU4",
      "billing_details": {
        "address": {
          "city": null,
          "country": null
        },
        "email": null,
        "name": "LakshmiSuren",
        "phone": null
      },

      "invoice": null,
      "livemode": false,
      "metadata": {
        "ContactID": "0038J000001Q8IpQAK",
        "created_by": "FormAssembly - Stripe - Reference: Form 156 / Conn. 302 / Resp. 92945"
      }
}
}
}