Skip to content

Commit

Permalink
Use RequestOptions in README example
Browse files Browse the repository at this point in the history
  • Loading branch information
danwang-stripe committed Mar 25, 2015
1 parent 02fc967 commit 1255fcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -50,11 +50,12 @@ StripeExample.java
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.Charge;
import com.stripe.net.RequestOptions;

public class StripeExample {

public static void main(String[] args) {
Stripe.apiKey = "YOUR-SECRET-KEY";
RequestOptions requestOptions = (new RequestOptionsBuilder()).setApiKey("YOUR-SECRET-KEY").build();
Map<String, Object> chargeMap = new HashMap<String, Object>();
chargeMap.put("amount", 100);
chargeMap.put("currency", "usd");
Expand All @@ -64,7 +65,7 @@ StripeExample.java
cardMap.put("exp_year", 2020);
chargeMap.put("card", cardMap);
try {
Charge charge = Charge.create(chargeMap);
Charge charge = Charge.create(chargeMap, requestOptions));
System.out.println(charge);
} catch (StripeException e) {
e.printStackTrace();
Expand Down

0 comments on commit 1255fcf

Please sign in to comment.