Documentation
¶
Overview ¶
Package circle implements the Circle Payments API processor for Commerce. Uses the Circle REST API v1 directly (no SDK dependency).
Index ¶
- type Config
- type Provider
- func (p *Provider) Authorize(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
- func (p *Provider) Capture(ctx context.Context, transactionID string, amount currency.Cents) (*processor.PaymentResult, error)
- func (p *Provider) Charge(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
- func (p *Provider) EstimateFee(ctx context.Context, req processor.PaymentRequest) (currency.Cents, error)
- func (p *Provider) GenerateAddress(ctx context.Context, customerID string, chain string) (string, error)
- func (p *Provider) GetBalance(ctx context.Context, address string, chain string) (*processor.Balance, error)
- func (p *Provider) GetTransaction(ctx context.Context, txID string) (*processor.Transaction, error)
- func (p *Provider) Refund(ctx context.Context, req processor.RefundRequest) (*processor.RefundResult, error)
- func (p *Provider) SupportedChains() []string
- 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 PaymentProcessor and CryptoProcessor for Circle.
func NewProvider ¶
NewProvider creates a configured Circle provider instance.
func (*Provider) Authorize ¶
func (p *Provider) Authorize(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
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 ¶
func (p *Provider) Charge(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
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 ¶
GetTransaction retrieves a Circle payment by ID.
func (*Provider) Refund ¶
func (p *Provider) Refund(ctx context.Context, req processor.RefundRequest) (*processor.RefundResult, error)
Refund creates a Circle return/refund for a payment.
func (*Provider) SupportedChains ¶
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.