Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow interface values in notification payload #11

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 uint64 `json:"amount" binding:"required,min=1"`
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