Documentation
¶
Overview ¶
Package opennode implements the OpenNode (Lightning) payment processor for Commerce. Uses the OpenNode API v2 directly (no SDK dependency).
Index ¶
- type Config
- type Provider
- func (p *Provider) Charge(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
- func (p *Provider) GetTransaction(ctx context.Context, txID string) (*processor.Transaction, error)
- func (p *Provider) IsAvailable(ctx context.Context) bool
- func (p *Provider) Refund(ctx context.Context, req processor.RefundRequest) (*processor.RefundResult, error)
- func (p *Provider) SupportedCurrencies() []currency.Type
- func (p *Provider) Type() processor.ProcessorType
- func (p *Provider) ValidateWebhook(ctx context.Context, payload []byte, signature string) (*processor.WebhookEvent, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
*processor.BaseProcessor
// contains filtered or unexported fields
}
Provider implements processor.PaymentProcessor for OpenNode API v2.
func NewProvider ¶
NewProvider creates a configured OpenNode provider instance.
func (*Provider) Charge ¶
func (p *Provider) Charge(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
Charge creates an OpenNode Lightning charge (amount in satoshis).
func (*Provider) GetTransaction ¶
GetTransaction retrieves an OpenNode charge by ID.
func (*Provider) IsAvailable ¶
IsAvailable reports whether the processor is configured.
func (*Provider) Refund ¶
func (p *Provider) Refund(ctx context.Context, req processor.RefundRequest) (*processor.RefundResult, error)
Refund creates an OpenNode refund.
func (*Provider) SupportedCurrencies ¶
SupportedCurrencies returns currencies this processor supports.
func (*Provider) Type ¶
func (p *Provider) Type() processor.ProcessorType
Type returns the processor type.
func (*Provider) ValidateWebhook ¶
func (p *Provider) ValidateWebhook(ctx context.Context, payload []byte, signature string) (*processor.WebhookEvent, error)
ValidateWebhook verifies an OpenNode webhook signature (HMAC-SHA256).