bitpay

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package bitpay implements the BitPay.ir gateway (REST, bitpay.ir).

Credentials: core.Config.MerchantKey is the API key. The literal "bitpay.ir-demo-api-key" is BitPay's own sandbox key and is used when the gateway is built with core.WithSandbox.

Index

Constants

View Source
const Name core.Name = "bitpay"

Name is the registry name of this gateway.

Variables

This section is empty.

Functions

func Message

func Message(code int64) string

Message returns the meaning of a BitPay error code.

func WithDefaultDescription

func WithDefaultDescription(description string) core.Option

WithDefaultDescription sets the description used when a purchase request carries none.

Types

type Gateway

type Gateway struct {
	// Unsupported answers Refund and Inquiry, which BitPay does not expose.
	core.Unsupported
	// contains filtered or unexported fields
}

Gateway is the BitPay.ir implementation of core.Gateway.

func New

func New(cfg core.Config, opts ...core.Option) (*Gateway, error)

New builds a BitPay.ir gateway.

func (*Gateway) Capabilities

func (g *Gateway) Capabilities() core.Capabilities

Capabilities reports what BitPay offers.

func (*Gateway) Name

func (g *Gateway) Name() core.Name

Name returns the gateway name.

func (*Gateway) ParseCallback

func (g *Gateway) ParseCallback(r *http.Request) (core.Callback, error)

ParseCallback reads the id_get/trans_id pair BitPay returns the payer with.

func (*Gateway) Purchase

Purchase creates a payment and returns the BitPay redirect URL.

func (*Gateway) Verify

Verify settles the payment. BitPay identifies it by the pair (id_get, trans_id); the transaction id comes from the callback.

Jump to

Keyboard shortcuts

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