Skip to content

Commit

Permalink
Merge pull request #469 from miuchan/release/3.2.0
Browse files Browse the repository at this point in the history
fix(payment): set notify url for transfer batch
  • Loading branch information
Matrix-X committed Apr 11, 2024
2 parents ba948a6 + 6b411bc commit efba800
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/payment/transfer/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ func NewBatchClient(app *payment.ApplicationPaymentInterface) (*BatchClient, err
// https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter4_3_1.shtml
func (comp *BatchClient) Batch(ctx context.Context, param *request.RequestTransferBatch) (*response.ResponseTrasferBatch, error) {

config := (*comp.App).GetConfig()

if param.GetNotifyUrl() == "" {
url := config.GetString("notify_url", "")
param.SetNotifyUrl(url)
}

result := &response.ResponseTrasferBatch{}

options, err := object.StructToHashMap(param)
Expand Down
8 changes: 8 additions & 0 deletions src/payment/transfer/request/requestBatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,12 @@ type RequestTransferBatch struct {
TotalNum int `json:"total_num"`
TransferDetailList []*TransferDetail `json:"transfer_detail_list"`
TransferSceneID string `json:"transfer_scene_id,omitempty"`
NotifyUrl string `json:"notify_url,omitempty"`
}

func (requestTransferBatch *RequestTransferBatch) SetNotifyUrl(url string) {
requestTransferBatch.NotifyUrl = url
}
func (requestTransferBatch *RequestTransferBatch) GetNotifyUrl() string {
return requestTransferBatch.NotifyUrl
}

0 comments on commit efba800

Please sign in to comment.