payment stream + unreachable provider + fess calc fix

This commit is contained in:
boufni95 2025-11-19 15:46:35 +00:00
parent d319c1d4be
commit c8ede119d6
16 changed files with 365 additions and 64 deletions

View file

@ -121,6 +121,7 @@ type Client struct {
PayAddress func(req PayAddressRequest) (*PayAddressResponse, error)
PayAppUserInvoice func(req PayAppUserInvoiceRequest) (*PayInvoiceResponse, error)
PayInvoice func(req PayInvoiceRequest) (*PayInvoiceResponse, error)
PayInvoiceStream func(req PayInvoiceRequest) (*InvoicePaymentStream, error)
PingSubProcesses func() error
RequestNPubLinkingToken func(req RequestNPubLinkingTokenRequest) (*RequestNPubLinkingTokenResponse, error)
ResetDebit func(req DebitOperation) error
@ -1835,6 +1836,7 @@ func NewClient(params ClientParams) *Client {
}
return &res, nil
},
// server streaming method: PayInvoiceStream not implemented
PingSubProcesses: func() error {
auth, err := params.RetrieveMetricsAuth()
if err != nil {

View file

@ -341,6 +341,9 @@ type HttpCreds struct {
Token string `json:"token"`
Url string `json:"url"`
}
type InvoicePaymentStream struct {
Update *InvoicePaymentStream_update `json:"update"`
}
type LatestBundleMetricReq struct {
Limit int64 `json:"limit"`
}
@ -545,13 +548,15 @@ type PayAddressResponse struct {
type PayAppUserInvoiceRequest struct {
Amount int64 `json:"amount"`
Debit_npub string `json:"debit_npub"`
Fee_limit_sats int64 `json:"fee_limit_sats"`
Invoice string `json:"invoice"`
User_identifier string `json:"user_identifier"`
}
type PayInvoiceRequest struct {
Amount int64 `json:"amount"`
Debit_npub string `json:"debit_npub"`
Invoice string `json:"invoice"`
Amount int64 `json:"amount"`
Debit_npub string `json:"debit_npub"`
Fee_limit_sats int64 `json:"fee_limit_sats"`
Invoice string `json:"invoice"`
}
type PayInvoiceResponse struct {
Amount_paid int64 `json:"amount_paid"`
@ -751,6 +756,18 @@ type DebitRule_rule struct {
Expiration_rule *DebitExpirationRule `json:"expiration_rule"`
Frequency_rule *FrequencyRule `json:"frequency_rule"`
}
type InvoicePaymentStream_update_type string
const (
ACK InvoicePaymentStream_update_type = "ack"
DONE InvoicePaymentStream_update_type = "done"
)
type InvoicePaymentStream_update struct {
Type InvoicePaymentStream_update_type `json:"type"`
Ack *Empty `json:"ack"`
Done *PayInvoiceResponse `json:"done"`
}
type LiveDebitRequest_debit_type string
const (