Built an integration for Java?
Get it featured here →

Java

Accepting credit card payments in Java

The following example uses PinPayments Java by Jiakuan Wang.

@Inject
private ChargesApi chargesApi;

public final void myBusinessMethod() {
  final ChargeResponse chargeResponse = chargesApi.create(ImmutableCharge.builder()
    .email("roland@pinpayments.com")
    .currency("AUD")
    .description("test charge")
    .amount(400)
    .ipAddress("203.192.1.172")
    .capture(String.valueOf(capture))
    .card(ImmutableCard.builder()
      .number("5520000000000000")
      .expiryMonth("05")
      .expiryYear("2018")
      .cvc("123")
      .name("Roland Robot")
      .addressLine1("42 Sevenoaks St")
      .addressLine2("")
      .addressCity("Lathlain")
      .addressPostcode("6454")
      .addressState("WA")
      .addressCountry("Australia")
      .build())
    .metadata(ImmutableMap.of("OrderNumber", "123456", "CustomerName", "Roland Robot"))
    .build());
  assertThat(chargeResponse.response().token()).isNotBlank();
}

Java libraries compatible with Pin Payments

Charge credit cards with any language or framework See Examples