-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
102 additions
and
29 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,2 +1,15 @@ | ||
# tosspay-rs | ||
사업자 등록증 없이 결제 시스템을 만들수있는 라이브러리 | ||
|
||
> [!IMPORTANT] | ||
> 이 라이브러리를 사용하기 위해서는 토스아이디(toss-id)가 필요합니다 | ||
> ![](./img/important.png) | ||
|
||
## on_payment | ||
특정 유저가 보낸돈만 확인할때만 사용합니다 <br/> | ||
[자세히보기 >](./docs/on_payment.md) | ||
|
||
## on_donate | ||
모든 사용자가 보낸 후원 내역을 확인합니다. <br/> | ||
[자세히보기 >](./docs/on_donate.md) |
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,15 @@ | ||
# tosspay-rs | ||
사업자 등록증 없이 결제 시스템을 만들수있는 라이브러리 | ||
|
||
> [!IMPORTANT] | ||
> 이 라이브러리를 사용하기 위해서는 토스아이디(toss-id)가 필요합니다 | ||
> ![](../img/important.png) | ||
|
||
## on_payment | ||
특정 유저가 보낸돈만 확인할때만 사용합니다 <br/> | ||
[자세히보기 >](./on_payment.md) | ||
|
||
## on_donate | ||
모든 사용자가 보낸 후원 내역을 확인합니다. <br/> | ||
[자세히보기 >](./on_donate.md) |
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,18 @@ | ||
# on_donate | ||
|
||
```rs | ||
use tosspay::TossPay; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let toss = TossPay::new("wntjd0612".to_string()); | ||
toss.on_donate(|data| { | ||
if data.amount == 1 { | ||
println!("{:?}", data); | ||
} else { | ||
println!("nou"); | ||
} | ||
}); | ||
loop {} // 코드가 계속 반복되고있지 않은 코드라면 이걸 넣어줘야해요 | ||
} | ||
``` |
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,20 @@ | ||
# on_donate | ||
|
||
```rs | ||
use tosspay::TossPay; | ||
#[tokio::main] | ||
async fn main() { | ||
let toss = TossPay::new("objective".to_string() /* 여기 자신의 toss-id 써주세여*/); | ||
let code = toss.on_payment(|data| { | ||
if data.amount == 1 { | ||
println!("{:?}", data); | ||
Ok(()) // 성공했다면 Ok(())를 반환해주세요 | ||
} else { | ||
println!("nou"); | ||
Err(()) // 실패했다면 Ok(())를 반환해주세요 | ||
} | ||
}); | ||
println!("{}", code); | ||
loop {} // 코드가 계속 반복되고있지 않은 코드라면 이걸 넣어줘야해요 | ||
} | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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