title: Retrieve stripe data from stripe webhook event
body: <p>When implementing stripe webhook in java, I am successful in getting the event object in JSON format. The problem is I am not able to get the details like the amount, subscription_id, attributes which are in nested JSON. Getting these values from the class object is also not available. Could you please tell me how to extract these values</p>
  
  <pre><code>public void handle(HttpServletRequest request) {
  
      Stripe.apiKey = sk_test_XXXXXXXXXXXXXXXXXXXX;
  
      String rawJson = "";
  
      try {
              rawJson = IOUtils.toString(request.getInputStream());
          } 
          catch (IOException ex) {
              System.out.println("Error extracting json value : " + ex.getMessage());
           }
      Event event = APIResource.GSON.fromJson(rawJson, Event.class);
      System.out.println("Webhook event : " + event);
  
  }
  </code></pre>
  
  <p>And I get the following response :-</p>
  
  <pre><code>Webhook event : &lt;com.stripe.model.Event@1462134034 id=evt_18qdEBElSMaq70BZlEwdDJG3&gt; JSON: {
    "id": "evt_18qdEBElSMaq70BZlEwdDJG3",
    "api_version": "2016-07-06",
    "created": 1473143919,
    "data": {
      "object": {
        "id": "in_18qcFkElSMaq70BZy1US7o3g",
        "amount_due": 4100,
        "application_fee": null,
        "attempt_count": 1,
        "attempted": true,
        "charge": "ch_18qdEBElSMaq70BZIEQvJTPe",
        "closed": true,
        "created": null,
        "currency": "usd",
        "customer": "cus_95uFN7q2HzHN7j",
        "date": 1473140172,
        "description": null,
        "discount": null,
        "ending_balance": 0,
        "forgiven": false,
        "lines": {
          "data": [
            {
              "id": "sub_95uFmJLQM3jFwP",
              "amount": 4100,
              "currency": "usd",
              "description": null,
              "discountable": true,
              "livemode": false,
              "metadata": {},
              "period": {
                "end": 1473226524,
                "start": 1473140124
              },
              "plan": {
                "id": "aug 19 01",
                "amount": 4100,
                "created": 1472448923,
                "currency": "usd",
                "interval": "day",
                "interval_count": 1,
                "livemode": false,
                "metadata": {},
                "name": "Aug 19 plan. Better than paypal",
                "statement_descriptor": null,
                "trial_period_days": null,
                "statement_description": null
              },
              "proration": false,
              "quantity": 1,
              "subscription": null,
              "type": "subscription"
            }
          ],
          "total_count": 1,
          "has_more": false,
          "request_options": null,
          "request_params": null,
          "url": "/v1/invoices/in_18qcFkElSMaq70BZy1US7o3g/lines",
          "count": null
        },
        "livemode": false,
        "metadata": {},
        "next_payment_attempt": null,
        "paid": true,
        "period_end": 1473140124,
        "period_start": 1473053724,
        "receipt_number": null,
        "starting_balance": 0,
        "statement_descriptor": null,
        "subscription": "sub_95uFmJLQM3jFwP",
        "subscription_proration_date": null,
        "subtotal": 4100,
        "tax": null,
        "tax_percent": null,
        "total": 4100,
        "webhooks_delivered_at": 1473140184
      },
      "previous_attributes": null
    },
    "livemode": false,
    "pending_webhooks": 1,
    "request": null,
    "type": "invoice.payment_succeeded",
    "user_id": null
  }
  </code></pre>
  
  <p>I want to get the values like the <code>customer_id</code>, <code>subscription_id</code> , etc. But when I try to get the data using the event object, I couldn't simply do as <code>event.get....</code> . How would I extract the data.</p>