Skip to content

Commit

Permalink
feat(payment): add other notify like refund
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrix-X committed Dec 7, 2022
1 parent 0d9af6a commit e5afe4d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/zh/payment/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ if err != nil {
}
```


``` go
// 其他支付通知的回调通知
func (app *Payment) HandlePaidNotify(request *http.Request, closure func(message *request.RequestNotify, transaction *models.Transaction, fail func(message string)) interface{}) (*response.HttpResponse, error) {
return notify.NewPaidNotify(app, request).Handle(closure)
}

func (app *Payment) HandleRefundedNotify(request *http.Request, closure func(message *request.RequestNotify, transaction *models.Refund, fail func(message string)) interface{}) (*response.HttpResponse, error) {
return notify.NewRefundNotify(app, request).Handle(closure)
}

func (app *Payment) HandleScannedNotify(request *http.Request, closure func(message *request.RequestNotify, fail func(message string), alert func(message string)) interface{}) (*response.HttpResponse, error) {
return notify.NewScannedNotify(app, request).Handle(closure)
}

```

> **注意:**
> * 同样的通知可能会多次发送给商户系统。商户系统必须能够正确处理重复的通知。
> * 推荐的做法是,当商户系统收到通知进行处理时,先检查对应业务数据的状态,并判断该通知是否已经处理。
Expand Down
2 changes: 1 addition & 1 deletion src/zh/payment/profit-share.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ paymentService.ProfitSharing.Query("[transaction_id]", "[out_trade_no]")



## 分帐回退(TODO)
## 分帐回退

```go
paymentService.ProfitSharing.Return(&request.RequestShareReturn{
Expand Down

0 comments on commit e5afe4d

Please sign in to comment.