Trolley Java SDK (Previously Payment Rails1)
A native Java SDK for Trolley
For Java
Add this dependency to your project's POM:
<dependency>
<groupId>com.trolley</groupId>
<artifactId>java-sdk</artifactId>
<version>1.0.1</version>
</dependency>The library's source is hosted at https://github.com/paymentRails/java-sdk
The library can be found at: https://central.sonatype.com/artifact/com.trolley/java-sdk/1.0
import com.trolley.java-sdk.*;
import com.trolley.Exceptions.*;
public class PaymentRailsExample {
public static void main(String[] args) {
Gateway client = new Gateway(new Configuration("YOUR_PUBLIC_KEY","YOUR_PRIVATE_KEY","production"));
try {
Recipient recipient = client.recipient.find("R-1a2B3c4D5e6F7g8H9i0J1k");
System.out.println(recipient.getId());
} catch (Exception e) {
e.printStackTrace();
}
}
}Methods should all have Java Doc comments to help you understand their usage. As mentioned the full API documentation is the best source of information about the API.
For more information please read the Java API docs is available. The best starting point is:
| Data Type | SDK Documentation |
|---|---|
| Batch | API Docs for Batch |
| Payment | API Docs for Payment |
| Recipient | API Docs for Recipient |
| Recipient Account | API Docs for Recipient Account |
- Type: Authorization
- Authorization parts: Access code, Secret code
- Location: HTTP header
Footnotes
-
Payment Rails is now Trolley. We're in the process of updating our SDKs to support the new domain. In this transition phase, you might still see "PaymentRails" at some places. ↩