11package co .dapi ;
22
3- import co .dapi .response .CreatePullResponse ;
4- import co .dapi .response .GetPullResponse ;
3+ import co .dapi .response .CreateACHPullResponse ;
4+ import co .dapi .response .GetACHPullResponse ;
55import co .dapi .types .UserInput ;
66import com .google .gson .JsonSyntaxException ;
77
@@ -17,7 +17,7 @@ public ACH(Config config) {
1717 this .config = config ;
1818 }
1919
20- public CreatePullResponse createPull (PullTransfer transfer , String accessToken , String userSecret , String operationID , UserInput [] userInputs ) throws IOException {
20+ public CreateACHPullResponse createPull (PullTransfer transfer , String accessToken , String userSecret , String operationID , UserInput [] userInputs ) throws IOException {
2121
2222 // Create the request body of this call
2323 CreatePullRequest bodyObj = new CreatePullRequest (transfer , this .config .getAppSecret (), userSecret ,
@@ -35,9 +35,9 @@ public CreatePullResponse createPull(PullTransfer transfer, String accessToken,
3535
3636
3737 // Convert the got response to the wanted response type
38- CreatePullResponse resp = null ;
38+ CreateACHPullResponse resp = null ;
3939 try {
40- resp = DapiRequest .jsonAgent .fromJson (respJson , CreatePullResponse .class );
40+ resp = DapiRequest .jsonAgent .fromJson (respJson , CreateACHPullResponse .class );
4141 } catch (JsonSyntaxException e ) {
4242 // Empty catch, cause the handling code is below
4343 }
@@ -46,13 +46,13 @@ public CreatePullResponse createPull(PullTransfer transfer, String accessToken,
4646 if (resp == null || (resp .getStatus () == null && !resp .getType ().isPresent ())) {
4747 // If the got response wasn't a JSON string, resp will be null, and if
4848 // it didn't have the 'status' field, getStatus() will return null.
49- return new CreatePullResponse ("UNEXPECTED_RESPONSE" , "Unexpected response body" );
49+ return new CreateACHPullResponse ("UNEXPECTED_RESPONSE" , "Unexpected response body" );
5050 }
5151
5252 return resp ;
5353 }
5454
55- public GetPullResponse getPull (String accessToken , String userSecret , String operationID , UserInput [] userInputs ) throws IOException {
55+ public GetACHPullResponse getPull (String accessToken , String userSecret , String operationID , UserInput [] userInputs ) throws IOException {
5656
5757 // Create the request body of this call
5858 GetPullRequest bodyObj = new GetPullRequest (this .config .getAppSecret (), userSecret , operationID , userInputs );
@@ -68,9 +68,9 @@ public GetPullResponse getPull(String accessToken, String userSecret, String ope
6868 String respJson = DapiRequest .Do (bodyJson , DapiRequest .Dapi_URL + "/v2" + bodyObj .action , headers );
6969
7070 // Convert the got response to the wanted response type
71- GetPullResponse resp = null ;
71+ GetACHPullResponse resp = null ;
7272 try {
73- resp = DapiRequest .jsonAgent .fromJson (respJson , GetPullResponse .class );
73+ resp = DapiRequest .jsonAgent .fromJson (respJson , GetACHPullResponse .class );
7474 } catch (JsonSyntaxException e ) {
7575 // Empty catch, cause the handling code is below
7676 }
@@ -79,7 +79,7 @@ public GetPullResponse getPull(String accessToken, String userSecret, String ope
7979 if (resp == null || (resp .getStatus () == null && !resp .getType ().isPresent ())) {
8080 // If the got response wasn't a JSON string, resp will be null, and if
8181 // it didn't have the 'status' field, getStatus() will return null.
82- return new GetPullResponse ("UNEXPECTED_RESPONSE" , "Unexpected response body" );
82+ return new GetACHPullResponse ("UNEXPECTED_RESPONSE" , "Unexpected response body" );
8383 }
8484
8585 return resp ;
0 commit comments