Skip to content

Commit

Permalink
allow interface values in notification payload
Browse files Browse the repository at this point in the history
  • Loading branch information
roeierez committed Jan 17, 2024
1 parent 308df30 commit b8d3b1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions http/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (p *LnurlPayInfoPayload) ToNotification(query *MobilePushWebHookQuery) *not
Type: query.Platform,
TargetIdentifier: query.Token,
AppData: query.AppData,
Data: map[string]string{
Data: map[string]interface{}{
"callback_url": p.Data.CallbackURL,
"reply_url": p.Data.ReplyURL,
},
Expand All @@ -48,7 +48,7 @@ func (p *LnurlPayInfoPayload) ToNotification(query *MobilePushWebHookQuery) *not
type LnurlPayInvoicePayload struct {
Template string `json:"template" binding:"required,eq=lnurlpay_invoice"`
Data struct {
Amount string `json:"amount" binding:"required"`
Amount int `json:"amount" binding:"required"`
ReplyURL string `json:"reply_url" binding:"required"`
} `json:"data"`
}
Expand All @@ -60,7 +60,7 @@ func (p *LnurlPayInvoicePayload) ToNotification(query *MobilePushWebHookQuery) *
Type: query.Platform,
TargetIdentifier: query.Token,
AppData: query.AppData,
Data: map[string]string{
Data: map[string]interface{}{
"amount": p.Data.Amount,
"reply_url": p.Data.ReplyURL,
},
Expand All @@ -81,7 +81,7 @@ func (p *PaymentReceivedPayload) ToNotification(query *MobilePushWebHookQuery) *
Type: query.Platform,
TargetIdentifier: query.Token,
AppData: query.AppData,
Data: map[string]string{"payment_hash": p.Data.PaymentHash},
Data: map[string]interface{}{"payment_hash": p.Data.PaymentHash},
}
}

Expand All @@ -99,7 +99,7 @@ func (p *TxConfirmedPayload) ToNotification(query *MobilePushWebHookQuery) *noti
Type: query.Platform,
TargetIdentifier: query.Token,
AppData: query.AppData,
Data: map[string]string{"tx_id": p.Data.TxID},
Data: map[string]interface{}{"tx_id": p.Data.TxID},
}
}

Expand All @@ -117,7 +117,7 @@ func (p *AddressTxsChangedPayload) ToNotification(query *MobilePushWebHookQuery)
Type: query.Platform,
TargetIdentifier: query.Token,
AppData: query.AppData,
Data: map[string]string{"address": p.Data.Address},
Data: map[string]interface{}{"address": p.Data.Address},
}
}

Expand Down
2 changes: 1 addition & 1 deletion notify/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Notification struct {
Type string
TargetIdentifier string
AppData *string
Data map[string]string
Data map[string]interface{}
}

type Service interface {
Expand Down

0 comments on commit b8d3b1e

Please sign in to comment.