stripe-api-java
A Java client library for Stripe's API.
Usage
Maven dependency
<dependency>
<groupId>net.joelinn</groupId>
<artifactId>stripe</artifactId>
<version>1.2.0</version>
</dependency>
Making API Calls
Initialize the client object
Stripe stripe = new Stripe("your_api_key");
Customers calls
// create a customer
CreateCustomerRequest customerRequest = new CreateCustomerRequest()
.setEMail("[email protected]")
.setDescription("A customer!")
.setCard(new CreateCardRequest("4242424242424242", 1, 2020));
CustomerResponse customer = stripe.customers().createCustomer(customerRequest);
// retrieve the customer
CustomerResponse retrievedCustomer = stripe.customers().getCustomer(customer.getId());
Charges calls
// create a charge
CreateChargeRequest chargeRequest = new CreateChargeRequest(350, "usd")
.setCustomer(customer.getId());
ChargeResponse charge = stripe.charges().createCharge(chargeRequest);