Skip to content

Commit 22ac453

Browse files
committed
add payments api support
1 parent 6c3bd1f commit 22ac453

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+7579
-134
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ V3-JAVA-SDK
44
===========
55

66
**Help:** [Support](https://developer.intuit.com/help), [Samples](https://developer.intuit.com/docs/0100_quickbooks_online/0400_tools/0005_sdks/0200_java/0004_sample_code_and_sample_apps) <br/>
7-
**Documentation:** [User Guide](https://developer.intuit.com/docs/0100_quickbooks_online/0400_tools/0005_accounting/0200_java/0001_quick_start), [JavaDocs](https://developer-static.intuit.com/SDKDocs/QBV3Doc/ipp-v3-java-devkit-javadoc/index.html)
7+
**Documentation:** [User Guide](https://developer.intuit.com/app/developer/qbo/docs/develop/sdks-and-samples-collections/java), [JavaDocs](https://developer-static.intuit.com/SDKDocs/QBV3Doc/ipp-v3-java-devkit-javadoc/index.html)
88
<br/>
99
**Continuous Integration:** [![Build Status](https://travis-ci.org/intuit/QuickBooks-V3-Java-SDK.svg?branch=develop)](https://travis-ci.org/intuit/QuickBooks-V3-Java-SDK)
1010
<br/>
@@ -34,6 +34,7 @@ The QuickBooks Online Java SDK provides a set of Java class libraries that make
3434
* ipp-v3-java-devkit - core component, contains REST API support.
3535
* ipp-java-qbapihelper - contains QuickBooks Online API Helper methods for OAuth, Disconnect and Reconnect API.
3636
* oauth2-platform-api - contains QuickBooks Online API Helper methods for obtaining OAuth2 tokens, Disconnect and Reconnect API for OAuth2 apps.
37+
* payments-api - Payments SDK for V2 API, contains methods for charge, echeck, token, card and bank account APIs.
3738

3839
## System Requirements
3940
The SDK works on JDK 1.6 and above.

ipp-java-qbapihelper/pom.xml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
<parent>
2222
<artifactId>ipp-v3-java-devkit-pom</artifactId>
2323
<groupId>com.intuit.quickbooks-online</groupId>
24-
<version>4.0.9</version>
24+
<version>5.0.0</version>
2525
</parent>
2626
<artifactId>ipp-java-qbapihelper</artifactId>
27-
<version>4.0.9</version>
27+
<version>5.0.0</version>
2828
<packaging>jar</packaging>
2929
<name>Quickbooks API Helper for Oauth</name>
3030
<description>Quickbooks API Helper Project for OAuth, Disconnect and Reconnect</description>
@@ -33,7 +33,22 @@
3333
<groupId>org.openid4java</groupId>
3434
<artifactId>openid4java</artifactId>
3535
<version>0.9.8</version>
36-
</dependency>
36+
</dependency>
37+
<dependency>
38+
<groupId>net.sf.kxml</groupId>
39+
<artifactId>kxml2</artifactId>
40+
<version>2.2.2</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>oauth.signpost</groupId>
44+
<artifactId>signpost-core</artifactId>
45+
<version>1.2.1.1</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>oauth.signpost</groupId>
49+
<artifactId>signpost-commonshttp4</artifactId>
50+
<version>1.2</version>
51+
</dependency>
3752
</dependencies>
3853

3954
<build>

ipp-v3-java-data/pom.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,25 @@
44
<parent>
55
<groupId>com.intuit.quickbooks-online</groupId>
66
<artifactId>ipp-v3-java-devkit-pom</artifactId>
7-
<version>4.0.9</version>
7+
<version>5.0.0</version>
88
</parent>
99

1010
<artifactId>ipp-v3-java-data</artifactId>
1111
<name>IPP V3 Java - Data Project</name>
1212
<description>IPP Java V3 DevKit Data project - FMS Entities generation</description>
13-
<version>4.0.9</version>
13+
<version>5.0.0</version>
1414

1515
<properties>
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1717
<javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
1818
</properties>
1919

2020
<dependencies>
21+
<dependency>
22+
<groupId>org.jvnet.jaxb2_commons</groupId>
23+
<artifactId>jaxb2-basics-runtime</artifactId>
24+
<version>1.11.1</version>
25+
</dependency>
2126
<dependency>
2227
<groupId>joda-time</groupId>
2328
<artifactId>joda-time</artifactId>
@@ -28,6 +33,11 @@
2833
<artifactId>jaxb2-commons-lang</artifactId>
2934
<version>2.4</version>
3035
</dependency>
36+
<dependency>
37+
<groupId>com.fasterxml.jackson.core</groupId>
38+
<artifactId>jackson-annotations</artifactId>
39+
<version>2.9.6</version>
40+
</dependency>
3141

3242
</dependencies>
3343

ipp-v3-java-devkit/pom.xml

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<parent>
77
<artifactId>ipp-v3-java-devkit-pom</artifactId>
88
<groupId>com.intuit.quickbooks-online</groupId>
9-
<version>4.0.9</version>
9+
<version>5.0.0</version>
1010
</parent>
1111

1212
<artifactId>ipp-v3-java-devkit</artifactId>
13-
<version>4.0.9</version>
13+
<version>5.0.0</version>
1414
<packaging>jar</packaging>
1515
<name>IPP V3 Java Devkit - Development Project</name>
1616
<description>IPP Java V3 DevKit Project - Core</description>
@@ -25,8 +25,81 @@
2525
<dependency>
2626
<groupId>com.intuit.quickbooks-online</groupId>
2727
<artifactId>ipp-v3-java-data</artifactId>
28-
<version>4.0.9</version>
28+
<version>5.0.0</version>
2929
</dependency>
30+
<dependency>
31+
<groupId>cglib</groupId>
32+
<artifactId>cglib</artifactId>
33+
<version>2.2.2</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>asm</groupId>
37+
<artifactId>asm-commons</artifactId>
38+
<version>3.3.1</version>
39+
</dependency>
40+
<dependency>
41+
<groupId>com.sun.mail</groupId>
42+
<artifactId>javax.mail</artifactId>
43+
<version>1.6.1</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>com.google.code.gson</groupId>
47+
<artifactId>gson</artifactId>
48+
<version>2.8.1</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>javax.servlet</groupId>
52+
<artifactId>servlet-api</artifactId>
53+
<version>2.4</version>
54+
<scope>provided</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>com.sun.xml.bind</groupId>
58+
<artifactId>jaxb-impl</artifactId>
59+
<version>2.2.11</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>com.sun.xml.bind</groupId>
63+
<artifactId>jaxb-core</artifactId>
64+
<version>2.2.11</version>
65+
</dependency>
66+
<dependency>
67+
<groupId>oauth.signpost</groupId>
68+
<artifactId>signpost-core</artifactId>
69+
<version>1.2.1.1</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>oauth.signpost</groupId>
73+
<artifactId>signpost-commonshttp4</artifactId>
74+
<version>1.2</version>
75+
</dependency>
76+
<dependency>
77+
<groupId>commons-configuration</groupId>
78+
<artifactId>commons-configuration</artifactId>
79+
<version>1.6</version>
80+
</dependency>
81+
<dependency>
82+
<groupId>commons-io</groupId>
83+
<artifactId>commons-io</artifactId>
84+
<version>2.5</version>
85+
</dependency>
86+
<dependency>
87+
<groupId>com.fasterxml.jackson.jaxrs</groupId>
88+
<artifactId>jackson-jaxrs-json-provider</artifactId>
89+
<version>2.9.6</version>
90+
</dependency>
91+
<dependency>
92+
<groupId>org.jmockit</groupId>
93+
<artifactId>jmockit</artifactId>
94+
<version>1.16</version>
95+
<scope>test</scope>
96+
</dependency>
97+
<dependency>
98+
<groupId>junit</groupId>
99+
<artifactId>junit</artifactId>
100+
<version>4.12</version>
101+
<scope>test</scope>
102+
</dependency>
30103
</dependencies>
31104

32105
<build>

ipp-v3-java-devkit/src/main/resources/ippdevkit.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Devkit Version
44
# This version has to be updated according to the pom version
5-
version = 4.0.9
5+
version = 5.0.0
66

77
# This is to have the request source to be sent to IDS request header
88
request.source = V3JavaSDK

ipp-v3-java-devkit/src/test/resources/ippdevkit.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### IPP Dev Kit helper properties
22

33
## Devkit version
4-
version = 4.0.9
4+
version = 5.0.0
55

66
# This is to have the request source to be sent to IDS request header
77
request.source = V3JavaSDK

oauth2-platform-api/pom.xml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
<parent>
1919
<artifactId>ipp-v3-java-devkit-pom</artifactId>
2020
<groupId>com.intuit.quickbooks-online</groupId>
21-
<version>4.0.9</version>
21+
<version>5.0.0</version>
2222
</parent>
2323
<artifactId>oauth2-platform-api</artifactId>
24-
<version>4.0.9</version>
24+
<version>5.0.0</version>
2525
<name>Quickbooks API Helper for OAuth2</name>
2626
<description>Quickbooks API Helper Project for OAuth2</description>
2727
<dependencies>
@@ -35,6 +35,27 @@
3535
<artifactId>json</artifactId>
3636
<version>20160810</version>
3737
</dependency>
38+
<dependency>
39+
<groupId>oauth.signpost</groupId>
40+
<artifactId>signpost-core</artifactId>
41+
<version>1.2.1.1</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>oauth.signpost</groupId>
45+
<artifactId>signpost-commonshttp4</artifactId>
46+
<version>1.2</version>
47+
</dependency>
48+
<dependency>
49+
<groupId>com.fasterxml.jackson.core</groupId>
50+
<artifactId>jackson-databind</artifactId>
51+
<version>2.9.6</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>commons-codec</groupId>
55+
<artifactId>commons-codec</artifactId>
56+
<version>1.11</version>
57+
</dependency>
58+
3859
</dependencies>
3960

4061
<build>

oauth2-platform-api/src/main/resources/oauthclient.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ADDRESS=address
3333
EMAIL=email
3434

3535
#Version
36-
version=4.0.9
36+
version=5.0.0
3737

3838
#MIGRATION SERVICE URL
3939
OAUTH_MIGRATION_URL_PRODUCTION=https://developer.api.intuit.com/v2/oauth2/tokens/migrate

oauth2-platform-api/src/test/resources/oauthclient.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ADDRESS=address
3333
EMAIL=email
3434

3535
#Version
36-
version=4.0.9
36+
version=5.0.0
3737

3838
#MIGRATION SERVICE URL
3939
OAUTH_MIGRATION_URL_PRODUCTION=https://developer.api.intuit.com/v2/oauth2/tokens/migrate

payments-api/README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
JAVA-PAYMENTS-SDK
2+
==================
3+
4+
**Help:** [Support](https://developer.intuit.com/help), [Samples](https://developer.intuit.com/docs/0100_quickbooks_online/0400_tools/0005_sdks/0200_java/0004_sample_code_and_sample_apps) <br/>
5+
**Documentation:** [User Guide](https://developer.intuit.com/app/developer/qbpayments/docs/develop/using-an-sdk-to-integrate-with-the-payments-api#java) <br/>
6+
**Continuous Integration:** [![Build Status](https://travis-ci.org/intuit/QuickBooks-V3-Java-SDK.svg?branch=develop)](https://travis-ci.org/intuit/QuickBooks-V3-Java-SDK) <br/>
7+
**Maven:** [![Data](https://maven-badges.herokuapp.com/maven-central/com.intuit.quickbooks-online/ipayments-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.intuit.quickbooks-online/payments-api) <br/>
8+
**License:** [![Apache 2](https://img.shields.io/badge/license-Apache%202-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0) <br/>
9+
10+
11+
## Overview
12+
This Payments SDK provides a Java library that make it easier to call QuickBooks Online Payments API. This library supports the following APIs:
13+
14+
* Token creation for card and bankAccount.
15+
* BankAccount functions like create, delete, retrieve.
16+
* Card functions like create, delete, retrieve.
17+
* Charge functions like create, capture, retrieve, refund.
18+
* ECheck functions like create retrieve, refund.
19+
20+
In addition to the above, the library also supports, logging, error handling, serialization/deserialization and capturing intuit_tid for easier debugging.
21+
Note: This library works only for OAuth2 apps.
22+
23+
## System Requirements
24+
The SDK works on JDK 1.6 and above.
25+
26+
## Install
27+
The SDK can be installed using one of the ways below-
28+
1. Download the latest version of the jar from [maven](https://search.maven.org/search?q=quickbooks) and add it to your projects classpath
29+
```sh
30+
payment-api.jar
31+
```
32+
33+
2. Add the following dependency to the build.gradle file. Make sure to use the latest version of the SDK found [here](https://search.maven.org/search?q=quickbooks)
34+
```sh
35+
compile("com.intuit.quickbooks-online:payments-api:5.0.0")
36+
```
37+
38+
3. Add the following dependency to the pom.xml file. Make sure to use the latest version of the SDK found [here](https://search.maven.org/search?q=quickbooks)
39+
```sh
40+
<dependency>
41+
<groupId>com.intuit.quickbooks-online</groupId>
42+
<artifactId>payments-api</artifactId>
43+
<version>5.0.0</version>
44+
</dependency>
45+
```
46+
47+
## Usage
48+
1. Create the RequestContext object as shown below. Pass in the accessToken and Environment.
49+
```java
50+
RequestContext requestContext = new RequestContext.Builder(accessToken, Environment.SANDBOX).build();
51+
```
52+
The above code automatically sets a unique requestid as well. To provide your custom requestid use the below code-
53+
```java
54+
RequestContext requestContext = new RequestContext.Builder(accessToken, Environment.SANDBOX)
55+
.requestId(requestId).build();
56+
```
57+
You can also set Proxy parameters in the same way.
58+
59+
2. Create the Service object. The sample below shows how to create a TokenService, you can create other service objects - Echeck, Charge, Card, BankAccount in the same way.
60+
```java
61+
TokenService tokenService = new TokenService(requestContext);
62+
```
63+
64+
3. Prepare Token request create token for a credit card
65+
```java
66+
Address address = new Address.Builder().region("CA").postalCode("94086")
67+
.streetAddress("1130 Kifer Rd").city("Sunnyvale")
68+
.country("US").build();
69+
```
70+
71+
```java
72+
Card card = new Card.Builder().expYear("2020").expMonth("02").address(address)
73+
.name("emulate=0").cvc("123")
74+
.number("4111111111111111").build();
75+
```
76+
77+
```java
78+
Token tokenRequest = new Token.Builder().card(card).build();
79+
```
80+
81+
4. Call the TokenService to create token
82+
```java
83+
Token token = tokenService.createToken(tokenRequest);
84+
```
85+
86+
5. Retrieve token value
87+
```java
88+
token.getValue();
89+
```
90+
91+
## Logging important attributes
92+
Makes sure to log intuit_tid and requestId for each of your request for easier debugging
93+
94+
For logging intuit_tid, use the following method
95+
```java
96+
token.getIntuit_tid();
97+
```
98+
99+
For logging requestId, use the following method
100+
```java
101+
token.getRequestId();
102+
```
103+
104+
## Sample
105+
For more samples on how to create other entities and operation, take a look at the sample application below :
106+
[sample](https://github.com/IntuitDeveloper/SampleApp-Payments-Java)
107+
108+

0 commit comments

Comments
 (0)