File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 77)
88
99// Payment holds information about a processed payment stored in the request context
10- type Payment struct { //nolint: revive // Ignore that struct starts with package name
10+ type Payment struct {
1111 // SatoshisPaid is the amount paid in satoshis
1212 SatoshisPaid int
1313 // Accepted indicates whether the payment was accepted
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
1010)
1111
1212const (
13+ // HeaderPaymentPaid is the name of the header with confirmation of the payed amount.
1314 HeaderPaymentPaid = payment .HeaderSatoshisPaid
1415)
1516
@@ -28,6 +29,7 @@ func WithPaymentLogger(logger *slog.Logger) func(*PaymentMiddlewareConfig) {
2829 }
2930}
3031
32+ // WithRequestPriceCalculator sets a custom function to calculate the price of a request in satoshis for a payment middleware.
3133func WithRequestPriceCalculator (calculator func (r * http.Request ) (int , error )) func (* PaymentMiddlewareConfig ) {
3234 if calculator == nil {
3335 panic ("calculator must be provided" )
You can’t perform that action at this time.
0 commit comments