opennode

package
v1.49.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package opennode implements the OpenNode (Lightning) payment processor for Commerce. Uses the OpenNode API v2 directly (no SDK dependency).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey      string
	Environment string // "dev" or "live"
}

Config holds OpenNode API credentials.

type Provider

type Provider struct {
	*processor.BaseProcessor
	// contains filtered or unexported fields
}

Provider implements processor.PaymentProcessor for OpenNode API v2.

func NewProvider

func NewProvider(cfg Config) *Provider

NewProvider creates a configured OpenNode provider instance.

func (*Provider) Charge

Charge creates an OpenNode Lightning charge (amount in satoshis).

func (*Provider) GetTransaction

func (p *Provider) GetTransaction(ctx context.Context, txID string) (*processor.Transaction, error)

GetTransaction retrieves an OpenNode charge by ID.

func (*Provider) IsAvailable

func (p *Provider) IsAvailable(ctx context.Context) bool

IsAvailable reports whether the processor is configured.

func (*Provider) Refund

Refund creates an OpenNode refund.

func (*Provider) SupportedCurrencies

func (p *Provider) SupportedCurrencies() []currency.Type

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL