title: Charging a card in Stripe using java
body: <p>I'm new at Stripe integration and java too and the first thing I want to do is charging a credit card. I'm using java. Here is the code for charging the card.</p>
  
  <pre><code>enter code here
   //CHARGING THE CARD
  
  Stripe.apiKey = "cgchhcchv";
  // Get the credit card details submitted by the form
  String token = request.getParameter("stripeToken");
  
  // Create the charge on Stripe's servers - this will charge the user's card
  try {
  Map&lt;String, Object&gt; chargeParams = new HashMap&lt;String, Object&gt;();
  chargeParams.put("amount", 1000); // amount in cents, again
  chargeParams.put("currency", "usd");
  chargeParams.put("source", token);
  chargeParams.put("description", "Example charge");
  
  Charge charge = Charge.create(chargeParams);
  } catch (CardException e) {
  // The card has been declined
  }
  </code></pre>
  
  <p>I added the Stripe libraries and they seem to work well but when trying to execute this code these errors output: "HashMap cannot be resolved to a type", "request cannot be resolved". I don't understand why these errors output even when I create these variables that cannot be resolved.Can someone explain this? Regards!</p>