Documentation
¶
Overview ¶
Package payment holds what every payment gateway protocol shares: the supported platforms and their names, and the money conversions between the minor units orders count and the decimal amounts gateways exchange.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAmount ¶ added in v1.21.0
ConvertAmount converts minor units of one currency into minor units of another at rate, the price of one source unit in target units; both currencies count hundredths. The rate is taken at its shortest decimal representation, which is the value the rate provider published rather than the nearest binary fraction, and the exact product is rounded to the nearest target minor unit with halves rounded away from zero. The result therefore never differs from the exact conversion by more than half a minor unit, and the same inputs always produce the same charge.
func FormatAmount ¶ added in v1.21.0
FormatAmount renders minor units as the two-decimal string payment gateways exchange: 1990 is "19.90" and 5 is "0.05". It never goes through a float.
func GetSupportedPlatforms ¶
func GetSupportedPlatforms() []integration.Info
func ParseAmount ¶
ParseAmount converts a non-negative decimal currency amount to its integer minor unit. Financial callback code must not compare parsed float64 values.
func SupportedPlatformNames ¶
func SupportedPlatformNames() []string
SupportedPlatformNames lists every platform that may be exposed for a new checkout. Keep this separate from GetSupportedPlatforms because balance is an internal checkout method rather than an administrator-configurable gateway.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package alipay implements the Alipay face-to-face payment protocol: QR code trade creation, trade query and close, and signed notification decoding.
|
Package alipay implements the Alipay face-to-face payment protocol: QR code trade creation, trade query and close, and signed notification decoding. |
|
Package cryptomus implements the Cryptomus crypto-payment gateway protocol: invoice creation, invoice lookup and webhook signature verification.
|
Package cryptomus implements the Cryptomus crypto-payment gateway protocol: invoice creation, invoice lookup and webhook signature verification. |
|
Package epay implements the EPay payment protocol: signed payment URLs, callback signature verification and the order query, with the EasyPay-compatible query as a fallback.
|
Package epay implements the EPay payment protocol: signed payment URLs, callback signature verification and the order query, with the EasyPay-compatible query as a fallback. |
|
protocol
Package protocol implements EPay V1 and V2 using Go's standard library.
|
Package protocol implements EPay V1 and V2 using Go's standard library. |
|
Package stripe implements the Stripe payment protocol: payment intents and their payment sheets, customers, webhook endpoints and signed webhook events.
|
Package stripe implements the Stripe payment protocol: payment intents and their payment sheets, customers, webhook endpoints and signed webhook events. |