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 ¶
- 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) 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) 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 for MoonPay.
func NewProvider ¶
NewProvider creates a configured MoonPay provider instance.
func (*Provider) Authorize ¶
func (p *Provider) Authorize(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
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 ¶
func (p *Provider) Charge(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
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 ¶
GetTransaction retrieves a MoonPay transaction by ID.
func (*Provider) Refund ¶
func (p *Provider) Refund(ctx context.Context, req processor.RefundRequest) (*processor.RefundResult, error)
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).