Documentation ¶
Overview ¶
Package payment implements payment methods.
Register your payment methods for POST requests under /payment/{method}:
router.Handler(http.MethodPost, fmt.Sprintf("/payment/%s/*path", paymentMethod.ID()), paymentMethod)
Note that the handlers will be publicly available.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BTCPay ¶
type BTCPay struct { ExpirationMinutes int RedirectPath string Store btcpay.Store Purchases PurchaseRepo CreateInvoiceError func(err error, msg string) http.Handler WebhookError func(err error) http.Handler }
func (BTCPay) VerifiesAdult ¶
type Cash ¶
type Cash struct {
AddressHTML string
}
func (Cash) VerifiesAdult ¶
type CashForeign ¶
type CashForeign struct { AddressHTML string Purchases PurchaseRepo History *rates.History }
func (CashForeign) ID ¶
func (CashForeign) ID() string
func (CashForeign) ServeHTTP ¶
func (CashForeign) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (CashForeign) VerifiesAdult ¶
func (CashForeign) VerifiesAdult() bool
type Method ¶
type Method interface { http.Handler ID() string Name(l lang.Lang) string PayHTML(purchaseID, paymentKey string, l lang.Lang) (template.HTML, error) VerifiesAdult() bool }
Method is the interface that wraps payment methods.
PayHTML takes a purchase ID and an optional payment key. The purchase ID should be unique. It is usually short and suitable for bank transfer forms, bookkeeping etc. It must not contain a colon. The optional payment key should have a high entropy. It can prevent the loss of goods if an purchase ID is accidentally or maliciously issued twice. Even if a payment key is used, payment methods should store the purchase ID because tax accounting may require a connection between payment and purchase.
type PayPal ¶
type PayPal struct { Config *paypal.Config Purchases PurchaseRepo }
PayPal does the PayPal Standard Checkout described at https://developer.paypal.com/docs/checkout/standard/
func (PayPal) VerifiesAdult ¶
type PurchaseRepo ¶
type SEPA ¶
type SEPA struct { Account SEPAAccount Purchases PurchaseRepo }
func (SEPA) VerifiesAdult ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package health provides a widget which displays the synchronization status of payment methods.
|
Package health provides a widget which displays the synchronization status of payment methods. |
Package rates retrieves and stores daily exchange rates.
|
Package rates retrieves and stores daily exchange rates. |