Skip to content

Commit

Permalink
Remove IsRefundableStatus() function. Probably it shouldn't be a part…
Browse files Browse the repository at this point in the history
… of this library
  • Loading branch information
nikita-vanyasin committed Apr 23, 2020
1 parent 12b9fc5 commit babe571
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,6 @@ fmt.Println("resend scheduled for %d notifications", res.Count)
httpResp, err := client.PostRequest(&myCouponUpgradeRequest{PaymentID: "3293", Coupon: "whatever"})
```

- `tinkoff.IsRefundableStatus(s)` allows you to check if the payment can be refunded according to policies provided by Tinkoff API doc:
```go
if !tinkoff.IsRefundableStatus(payment.Status) {
return errors.New("payment can't be refunded")
}
```

## References
The code in this repo based on some code from [koorgoo/tinkoff](https://github.com/koorgoo/tinkoff). Differences:
- Support for API v2
Expand Down
10 changes: 0 additions & 10 deletions status.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,3 @@ const (
StatusPartialRefunded = "PARTIAL_REFUNDED" // Возвращен частично
StatusRefunded = "REFUNDED" // Возвращен полностью
)

func IsRefundableStatus(status string) bool {
switch status {
case StatusNew,
StatusAuthorized,
StatusConfirmed:
return true
}
return false
}

0 comments on commit babe571

Please sign in to comment.