moonpay

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 moonpay implements the MoonPay on-ramp processor for Commerce. Uses the MoonPay REST API v3 directly (no SDK dependency). MoonPay is a fiat-to-crypto on-ramp — Charge returns a widget URL for the customer to complete KYC and payment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey     string
	SecretKey  string
	WebhookKey string
}

Config holds MoonPay API credentials.

type Provider

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

Provider implements PaymentProcessor for MoonPay.

func NewProvider

func NewProvider(cfg Config) *Provider

NewProvider creates a configured MoonPay provider instance.

func (*Provider) Authorize

Authorize is not supported for MoonPay on-ramp.

func (*Provider) Capture

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

Capture is not supported for MoonPay on-ramp.

func (*Provider) Charge

Charge creates a MoonPay buy transaction (fiat to crypto on-ramp). Returns a widget URL for the customer to complete KYC and payment.

func (*Provider) GetTransaction

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

GetTransaction retrieves a MoonPay transaction by ID.

func (*Provider) Refund

Refund is not supported for MoonPay crypto purchases.

func (*Provider) ValidateWebhook

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

ValidateWebhook verifies a MoonPay webhook signature (HMAC-SHA256).

Jump to

Keyboard shortcuts

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