Skip to content

Commit

Permalink
Merge pull request #36 from OpenBapul/dev
Browse files Browse the repository at this point in the history
Subscribe-api v1.1.0
  • Loading branch information
gongdo authored Mar 9, 2017
2 parents 7ff2b4e + d106701 commit 2cafef7
Show file tree
Hide file tree
Showing 80 changed files with 32,467 additions and 16,521 deletions.
62 changes: 50 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# iamport-rest-client-net
[아임포트](http://www.iamport.kr/)는 한국 Payment Gateway(PG)사의 복잡한 구현을 간소화주는 서비스로 PG사의 UI나 플러그인을 거치지 않고 처리할 수 있는 몇 가지 기능을 REST API로 제공합니다.

Expand All @@ -12,21 +10,27 @@

### Installation

> **Note**
> 2017-02-15 현재, `subscribe-api` 기능을 테스트중입니다.
> `subscribe-api`를 사용하지 않을 경우 `1.0.0` 버전을 사용하면 됩니다.
(패키지 매니저 콘솔에서)
```
Install-Package Iamport.RestApi
Install-Package Iamport.RestApi -Version 1.1.0-34
```

(또는 project.json에 추가 - .NET Core xproj 프로젝트)
```
{
"dependencies": {
"Iamport.RestApi": "1.0.0"
"Iamport.RestApi": "1.1.0-34"
}
}
```

### Usage
### Usage - 결제 플러그인 방식

```CSharp
using Iamport.RestApi;
Expand Down Expand Up @@ -59,13 +63,47 @@ var result = await paymentsApi.GetByTransactionIdAsync("1234567890");
var result2 = await paymentsApi.GetByIamportIdAsync("IMP12345");
```

### Usage - 비인증 API 결제

`iamport`[subscribe-api](http://api.iamport.kr/#!/subscribe/onetime)를 사용한 결제입니다.

```
// iamportClient 생성은 위와 동일
var subscribeApi = new SubscribeApi(iamportClient);
var request = new DirectPaymentRequest
{
CustomerId = null, // (customer_uid) 등록된 사용자 빌링키 없이 한번 진행
TransactionId = "merchant_uid",
Amount = 1004,
Title = "상품명",
CardNumber = "dddd-dddd-dddd-dddd",
Expiry = "yyyy-mm,
AuthenticationNumber = "dddddd", // (birth) 생년월일 앞 6자리 또는 법인번호
PartialPassword = "dd", // (pwd_2digit) 카드비밀번호 앞 2자리, 법인카드일 경우 생략
};
Payment iamportPayment = null;
try
{
iamportPayment = await subscribeApi.DoDirectPaymentAsync(request);
// 결과는 payments-api에서 얻은 payment 정보와 동일
}
catch (IamportResponseException ex)
{
// 결제에 실패하였거나 통신에 오류가 있었을 경우
Trace.WriteLine("결제 실패 사유: " + ex.Message);
}
```


## Status

|||
|Type|Status|
|---|---|
| Build | [![Build status](https://ci.appveyor.com/api/projects/status/icygwugodo4jalcs?svg=true)](https://ci.appveyor.com/project/gongdo/iamport-rest-client-net)
| Pre-release | [![MyGet](https://img.shields.io/myget/bapul/v/Iamport.RestApi.svg)](https://www.myget.org/feed/bapul/package/nuget/Iamport.RestApi)
| Release | [![NuGet](https://img.shields.io/nuget/v/Iamport.RestApi.svg)](https://www.nuget.org/packages/Iamport.RestApi/)
| CI Build | [![Build status](https://ci.appveyor.com/api/projects/status/icygwugodo4jalcs?svg=true)](https://ci.appveyor.com/project/gongdo/iamport-rest-client-net)
| MyGet Pre-release | [![MyGet](https://img.shields.io/myget/bapul/v/Iamport.RestApi.svg)](https://www.myget.org/feed/bapul/package/nuget/Iamport.RestApi)
| NuGet Release | [![NuGet](https://img.shields.io/nuget/v/Iamport.RestApi.svg)](https://www.nuget.org/packages/Iamport.RestApi/)

### Pre-release
Pre-release 버전은 [MyGet](https://www.myget.org)으로 배포합니다.
Expand All @@ -77,11 +115,10 @@ Pre-release 버전은 [MyGet](https://www.myget.org)으로 배포합니다.
아임포트RESTAPI닷넷은 다음과 같이 진행됩니다. 각 마일스톤의 일정은 아직 미정입니다.
아임포트RESTAPI닷넷의 버전 규칙은 [Semantic Versioning](http://semver.org/)을 따릅니다.

* [1.0](https://github.com/gongdo/iamport-rest-client-net/milestones/1.0)
* 마이너 버그 수정
* 최초 릴리스!
* [1.1](https://github.com/gongdo/iamport-rest-client-net/milestones/1.1.0)
* Subscription API 추가
* 1.2
* SMS 본인 인증 추가

## Contribution
이 프로젝트는 누구나 참여할 수 있는 오픈소스 프로젝트입니다. 참여와 기여는 다음과 같이 할 수 있습니다.
Expand All @@ -91,6 +128,7 @@ Pre-release 버전은 [MyGet](https://www.myget.org)으로 배포합니다.

- 이니시스(구버전)
- 이니시스(웹표준버전)
- 나이스(subscribe-api)

### 이슈 제기
이 프로젝트에 관한 문제점, 문의, 개선 사항 건의 등은 [Issues](https://github.com/gongdo/iamport-rest-client-net/issues)에 등록해주세요. 단, 이슈를 등록할 때에는 충분히 검색하여 같은 이슈가 없었는지 확인을 바랍니다.
Expand Down
1 change: 1 addition & 0 deletions RestApi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9549D4E9-456
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{80EA0D1C-8636-4912-9D33-FC10F4117824}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
appveyor.yml = appveyor.yml
build.ps1 = build.ps1
global.json = global.json
Expand Down
5 changes: 5 additions & 0 deletions Samples/Sample.AspNet/App_Start/DependencyConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public static void RegisterDependencies()
.As<IPaymentsApi>()
.SingleInstance();

builder
.RegisterType<SubscribeApi>()
.As<ISubscribeApi>()
.SingleInstance();

// Register your MVC controllers.
builder.RegisterControllers(typeof(DependencyConfig).Assembly);

Expand Down
Loading

0 comments on commit 2cafef7

Please sign in to comment.