title: Stripe STPCustomerDeserializer unable to parse customer Swift
body: <p>Customer JSON returned from Stripe API unable to be parsed by using                                 STPCustomerDeserializer(jsonResponse: data), returns nil when locating the "id" field. logging the data shows that the id is not nil.</p>
  
  <p>The customer object is in the exact same format as what the Stripe API returns. Error message 'The response from Stripe failed to get parsed into valid JSON." </p>
  
  <p>Debugging the deserialiser shows that it is failing here: </p>
  
  <pre><code>// required fields
  NSString *stripeId = [dict stp_stringForKey:@"id"];
  if (!stripeId) {
      return nil; &lt;&lt;&lt; returning here
  }
  </code></pre>
  
  <p>at >>></p>
  
  <pre><code>- (nullable NSString *)stp_stringForKey:(NSString *)key {
      id value = self[key];
      if (value &amp;&amp; [value isKindOfClass:[NSString class]]) {
          return value;
      }
      return nil; &lt;&lt; returning here
  }
  </code></pre>
  
  <p>I have tried passing in the customer data in different formats to no avail.</p>
  
  <p>I saw someone asks a similar question here <a href="https://stackoverflow.com/questions/41494186/the-data-could-not-be-read-because-it-isnt-in-the-correct-format-json-swift-3">The data could not be read because it isn&#39;t in the correct format JSON &amp; SWIFT 3</a></p>
  
  <pre><code>["customer": {
      "account_balance" = 0;
      address = "&lt;null&gt;";
      balance = 0;
      created = ***;
      currency = "&lt;null&gt;";
      "default_source" = “***”;
      delinquent = 0;
      description = "&lt;null&gt;";
      discount = "&lt;null&gt;";
      email = “***”;
      id = "cus_***";
      "invoice_prefix" = ***;
      "invoice_settings" =     {
          "custom_fields" = "&lt;null&gt;";
          "default_payment_method" = "&lt;null&gt;";
          footer = "&lt;null&gt;";
      };
      livemode = 1;
      metadata =     {
      };
      name = "&lt;null&gt;";
      object = customer;
      phone = "&lt;null&gt;";
      "preferred_locales" =     (
      );
      shipping = "&lt;null&gt;";
      sources =     {
          data =         (
                          {
                  "address_city" = "&lt;null&gt;";
                  "address_country" = GB;
                  "address_line1" = "&lt;null&gt;";
                  "address_line1_check" = "&lt;null&gt;";
                  "address_line2" = "&lt;null&gt;";
                  "address_state" = "&lt;null&gt;";
                  "address_zip" = "&lt;null&gt;";
                  "address_zip_check" = "&lt;null&gt;";
                  brand = Visa;
                  country = GB;
                  customer = "cus_***";
                  "cvc_check" = pass;
                  "dynamic_last4" = "&lt;null&gt;";
                  "exp_month" = ***;
                  "exp_year" = ***;
                  fingerprint = ***;
                  funding = debit;
                  id = "card_***";
                  last4 = ***;
                  metadata =                 {
                  };
                  name = "&lt;null&gt;";
                  object = card;
                  "tokenization_method" = "&lt;null&gt;";
              }
          );
          "has_more" = 0;
          object = list;
          "total_count" = 1;
          url = "/v1/customers/cus_***/sources";
      };
      subscriptions =     {
          data =         (
          );
          "has_more" = 0;
          object = list;
          "total_count" = 0;
          url = "/v1/customers/cus_***/subscriptions";
      };
      "tax_exempt" = none;
      "tax_ids" =     {
          data =         (
          );
          "has_more" = 0;
          object = list;
          "total_count" = 0;
          url = "/v1/customers/cus_***/tax_ids";
      };
      "tax_info" = "&lt;null&gt;";
      "tax_info_verification" = "&lt;null&gt;";
  }]
  </code></pre>