Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (46 sloc) 1.71 KB

Stripe Java Bindings

You can sign up for a Stripe account at


Java 1.5 and later.


Maven users

Add this dependency to your project's POM:



You'll need to manually install the following JARs:


import java.util.HashMap;
import java.util.Map;

import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.Charge;

public class StripeExample {

    public static void main(String[] args) {
        Stripe.apiKey = "YOUR-SECRET-KEY";
        Map<String, Object> chargeMap = new HashMap<String, Object>();
        chargeMap.put("amount", 100);
        chargeMap.put("currency", "usd");
        Map<String, Object> cardMap = new HashMap<String, Object>();
        cardMap.put("number", "4242424242424242");
        cardMap.put("exp_month", 12);
        cardMap.put("exp_year", 2012);
        chargeMap.put("card", cardMap);
        try {
            Charge charge = Charge.create(chargeMap);
        } catch (StripeException e) {

See for more examples.

Jump to Line
Something went wrong with that request. Please try again.