title: 'NoneType' object has no attribute 'get': AttributeError
body: <p>I am getting error : 'NoneType' object has no attribute 'get': AttributeError. PLease help me to figure out.</p>
  <p>File &quot;/var/task/lambda_function.py&quot;, line 15, in lambda_handler
  create_stripe_customer(cardData,phone,email)</p>
  <pre><code>import json
  import boto3
  import stripe
  client = boto3.client('secretsmanager')
  keys = json.loads(client.get_secret_value(
    SecretId = 'arn:aws:secretsmanager:ap-so',
  )['SecretString'])
  public_key = keys['stripe-public']
  secret_key = keys['stripe-secret']
  stripe.api_key = secret_key
  def lambda_handler(event, context):
      cardData = event.get('cardData')
      phone = event.get('phone')
      email = event.get('email')
      create_stripe_customer(cardData,phone,email)
      return event
  
  def create_stripe_customer(payment_info, phone, email):
      customer_id = stripe.Customer.create( phone = phone,email=email)['id']
      payment_method_id = create_payment_method(payment_info)
      stripe.PaymentMethod.attach(payment_method_id, customer = customer_id)
      return {&quot;customer_id&quot;: customer_id,
              &quot;plan&quot;: create_stripe_plan(customer_id)
      }
  
  def create_payment_method(payment_info):
      return stripe.PaymentMethod.create(type = &quot;card&quot;,
      card = {&quot;number&quot;: payment_info.get('cardNumber'),
              &quot;exp_month&quot;: payment_info.get('expirationMonth'),
              &quot;exp_year&quot;: payment_info.get('expirationYear'),
              &quot;cvc&quot;: payment_info.get('ccv'),
              }).get('id')      
          
  def create_stripe_plan(customer_id):
      return stripe.Subscription.create(
          customer = customer_id,items = [{&quot;plan&quot;: &quot;plan_idxxxxxxx&quot;}]).get(&quot;id&quot;)
  </code></pre>