This repository has been archived by the owner on Jul 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#21 Stabilize code of Accounts services: finish implementation and wr…
…ite tests
- Loading branch information
1 parent
9e3d687
commit a33c96b
Showing
32 changed files
with
891 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
[*] | ||
charset=utf-8 | ||
end_of_line=lf | ||
insert_final_newline=true | ||
indent_style=space | ||
indent_size=4 | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/main/java/org/proshin/finapi/account/FpMoneyTransfer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright 2018 Roman Proshin | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.proshin.finapi.account; | ||
|
||
import org.json.JSONObject; | ||
import org.proshin.finapi.accesstoken.AccessToken; | ||
import org.proshin.finapi.account.in.MoneyTransferParameters; | ||
import org.proshin.finapi.account.out.FpSepaExecutingResponse; | ||
import org.proshin.finapi.account.out.FpSepaRequestingResponse; | ||
import org.proshin.finapi.account.out.SepaExecutingResponse; | ||
import org.proshin.finapi.account.out.SepaRequestingResponse; | ||
import org.proshin.finapi.endpoint.Endpoint; | ||
|
||
public final class FpMoneyTransfer implements MoneyTransfer { | ||
|
||
private final Endpoint endpoint; | ||
private final AccessToken token; | ||
private final String url; | ||
|
||
public FpMoneyTransfer(final Endpoint endpoint, final AccessToken token, final String url) { | ||
this.endpoint = endpoint; | ||
this.token = token; | ||
this.url = url; | ||
} | ||
|
||
@Override | ||
public SepaRequestingResponse request(final MoneyTransferParameters parameters) { | ||
return new FpSepaRequestingResponse( | ||
new JSONObject( | ||
this.endpoint.post( | ||
this.url + "requestSepaMoneyTransfer", | ||
this.token, | ||
parameters | ||
) | ||
) | ||
); | ||
} | ||
|
||
@Override | ||
public SepaExecutingResponse execute(final Long account, final String bankingTan) { | ||
return new FpSepaExecutingResponse( | ||
new JSONObject( | ||
this.endpoint.post( | ||
this.url + "executeSepaMoneyTransfer", | ||
this.token, | ||
() -> new JSONObject() | ||
.put("accountId", account) | ||
.put("bankingTan", bankingTan) | ||
.toString() | ||
) | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
src/main/java/org/proshin/finapi/account/QueryCriteria.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.