Skip to content

Commit

Permalink
Merge pull request #14 from iamport/feature/naver-point
Browse files Browse the repository at this point in the history
[PCM-359] POST /payments/{imp_uid}/naver/point API 추가
  • Loading branch information
anymate98 authored Nov 29, 2021
2 parents 8063b91 + e686259 commit aa3e9cc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pom.xml에 아래의 내용을 추가해주세요.
<dependency>
<groupId>com.github.iamport</groupId>
<artifactId>iamport-rest-client-java</artifactId>
<version>0.2.15</version>
<version>0.2.17</version>
</dependency>
</dependencies>
```
Expand Down Expand Up @@ -80,6 +80,7 @@ pom.xml에 아래의 내용을 추가해주세요.
- POST /payments/{imp_uid}/naver/ship
- POST /payments/{imp_uid}/naver/place
- POST /payments/{imp_uid}/naver/confirm
- POST /payments/{imp_uid}/naver/point

### 네이버페이 반품처리 관련 API

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.github.iamport</groupId>
<artifactId>iamport-rest-client</artifactId>
<version>0.2.16</version>
<version>0.2.17</version>
<packaging>jar</packaging>

<name>IamportRestClient</name>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/siot/IamportRestClient/Iamport.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,10 @@ Call<IamportResponse<List<NaverProductOrder>>> naver_resolve_return(
@Path("imp_uid") String imp_uid,
@Body NaverResolveReturnData naver_resolve_return_data
);

@POST("/payments/{imp_uid}/naver/point")
Call<IamportResponse<EmptyResponse>> naver_point(
@Header("Authorization") String token,
@Path("imp_uid") String imp_uid
);
}
11 changes: 11 additions & 0 deletions src/main/java/com/siot/IamportRestClient/IamportClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,17 @@ public IamportResponse<List<NaverProductOrder>> naverResolveReturnOrders(String
return response.body();
}

public IamportResponse<EmptyResponse> naverPoint(String impUid) throws IamportResponseException, IOException {
AccessToken auth = getAuth().getResponse();
Call<IamportResponse<EmptyResponse>> call = iamport.naver_point(auth.getToken(), impUid);

Response<IamportResponse<EmptyResponse>> response = call.execute();

if( !response.isSuccessful() ) throw new IamportResponseException( getExceptionMessage(response), new HttpException(response) );

return response.body();
}

protected Iamport create(boolean useStaticIP) {
OkHttpClient client = new OkHttpClient.Builder()
.readTimeout(30, TimeUnit.SECONDS)
Expand Down

0 comments on commit aa3e9cc

Please sign in to comment.