square

package
v1.35.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SquareSupportedCurrencies

func SquareSupportedCurrencies() []currency.Type

SquareSupportedCurrencies returns currencies Square supports

Types

type Config

type Config struct {
	AccessToken   string
	LocationID    string
	WebhookSecret string
	Environment   string // "sandbox" or "production"
}

Config holds Square processor configuration

type SquareProcessor

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

SquareProcessor implements the processor.PaymentProcessor interface

func NewProcessor

func NewProcessor(cfg Config) *SquareProcessor

NewProcessor creates a new Square processor

func (*SquareProcessor) Authorize

Authorize authorizes a payment without capturing

func (*SquareProcessor) Capture

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

Capture captures a previously authorized payment

func (*SquareProcessor) Charge

Charge processes a payment

func (*SquareProcessor) GetTransaction

func (sp *SquareProcessor) GetTransaction(ctx context.Context, txID string) (*processor.Transaction, error)

GetTransaction retrieves transaction details

func (*SquareProcessor) IsAvailable

func (sp *SquareProcessor) IsAvailable(ctx context.Context) bool

IsAvailable checks if the processor is configured and available

func (*SquareProcessor) Refund

Refund processes a refund

func (*SquareProcessor) Type

Type returns the processor type

func (*SquareProcessor) ValidateWebhook

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

ValidateWebhook validates an incoming webhook

Jump to

Keyboard shortcuts

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