circle

package
v1.37.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package circle implements the Circle Payments API processor for Commerce. Uses the Circle REST API v1 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 // "sandbox" or "production"
}

Config holds Circle API credentials.

type Provider

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

Provider implements PaymentProcessor and CryptoProcessor for Circle.

func NewProvider

func NewProvider(cfg Config) *Provider

NewProvider creates a configured Circle provider instance.

func (*Provider) Authorize

Authorize is not directly supported by Circle payments API.

func (*Provider) Capture

func (p *Provider) Capture(ctx context.Context, transactionID string, amount currency.Cents) (*processor.PaymentResult, error)

Capture is not supported by Circle payments API.

func (*Provider) Charge

Charge creates a Circle payment with blockchain settlement.

func (*Provider) EstimateFee

func (p *Provider) EstimateFee(ctx context.Context, req processor.PaymentRequest) (currency.Cents, error)

EstimateFee returns an estimated fee for a Circle payment. Circle absorbs gas fees for USDC transfers in most cases.

func (*Provider) GenerateAddress

func (p *Provider) GenerateAddress(ctx context.Context, customerID string, chain string) (string, error)

GenerateAddress creates a new deposit address on a specified chain.

func (*Provider) GetBalance

func (p *Provider) GetBalance(ctx context.Context, address string, chain string) (*processor.Balance, error)

GetBalance retrieves the balance for a Circle wallet.

func (*Provider) GetTransaction

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

GetTransaction retrieves a Circle payment by ID.

func (*Provider) Refund

Refund creates a Circle return/refund for a payment.

func (*Provider) SupportedChains

func (p *Provider) SupportedChains() []string

SupportedChains returns the blockchain networks supported by Circle.

func (*Provider) ValidateWebhook

func (p *Provider) ValidateWebhook(ctx context.Context, payload []byte, signature string) (*processor.WebhookEvent, error)

ValidateWebhook verifies a Circle notification signature (SNS-based). Circle uses AWS SNS for webhooks. The signature verification uses the SigningCertURL from the SNS message to validate the signature.

Jump to

Keyboard shortcuts

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