Versions in this module Expand all Collapse all v0 v0.1.0 Jul 23, 2026 Changes in this version + const IPNAck + const Version + var ErrAPI = errors.New("dpay: API error") + var ErrAccessDenied = errors.New("dpay: access denied") + var ErrAuthentication = errors.New("dpay: authentication failed") + var ErrCardEncryption = errors.New("dpay: card encryption failed") + var ErrCardPayment = errors.New("dpay: card payment failed") + var ErrInvalidArgument = errors.New("dpay: invalid argument") + var ErrInvalidRequest = errors.New("dpay: invalid request") + var ErrNotFound = errors.New("dpay: not found") + var ErrPaymentRejected = errors.New("dpay: payment rejected") + var ErrRateLimit = errors.New("dpay: rate limited") + var ErrServer = errors.New("dpay: server error") + var ErrSignature = errors.New("dpay: signature verification failed") + var ErrTransport = errors.New("dpay: transport failure") + func Bool(b bool) *bool + func EncryptCard(card CardData, transactionID, publicKeyPEM string) (string, error) + func Int(i int) *int + func Int64(i int64) *int64 + func String(s string) *string + type APIError struct + ErrorCode string + FieldErrors map[string][]string + HTTPStatus int + RawBody string + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type ApplePayRequest struct + ChannelID *int + DeviceInfo DeviceInfo + Init bool + Token *string + func (r *ApplePayRequest) Validate() error + type Bank struct + func (b *Bank) ID() string + func (b *Bank) Image() string + func (b *Bank) IsTest() bool + func (b *Bank) Iterator() *int64 + func (b *Bank) Name() string + func (b *Bank) OnFrom() int64 + func (b *Bank) OnTo() int64 + func (b *Bank) Raw() map[string]any + func (b *Bank) Type() string + type BankService struct + func (s *BankService) All(ctx context.Context) ([]*Bank, error) + func (s *BankService) ForService(ctx context.Context, opts ...TimestampOption) ([]*Bank, error) + type BaseURLs struct + APIPayments string + Gateway string + Panel string + type BlikAlias struct + func (a *BlikAlias) Apps() []*BlikApp + func (a *BlikAlias) ExpirationDate() string + func (a *BlikAlias) IsActive() bool + func (a *BlikAlias) Raw() map[string]any + func (a *BlikAlias) Status() string + func (a *BlikAlias) Type() BlikAliasType + func (a *BlikAlias) Value() string + type BlikAliasRegistration struct + Label string + Type BlikAliasType + func (b BlikAliasRegistration) Validate() error + type BlikAliasType string + const BlikAliasTypePayID + const BlikAliasTypeUID + func (t BlikAliasType) Valid() bool + type BlikApp struct + func (a *BlikApp) Key() string + func (a *BlikApp) Label() string + type BlikRecurringInfo struct + func (i *BlikRecurringInfo) Frequency() string + func (i *BlikRecurringInfo) InitDate() string + func (i *BlikRecurringInfo) IsLimitAmtFixed() *bool + func (i *BlikRecurringInfo) Label() string + func (i *BlikRecurringInfo) LimitAmt() *int64 + func (i *BlikRecurringInfo) Model() string + func (i *BlikRecurringInfo) Raw() map[string]any + func (i *BlikRecurringInfo) RegisteredAt() string + func (i *BlikRecurringInfo) TotLimitAmt() *int64 + type BlikRecurringModel string + const BlikRecurringModelAutomatic + const BlikRecurringModelManual + const BlikRecurringModelOnDemand + func (m BlikRecurringModel) Valid() bool + type BlikRecurringRegistration struct + ExpirationDate *string + Frequency string + InitDate *string + Label string + LimitAmt *int + LimitAmtFixed *bool + Model BlikRecurringModel + TotLimitAmt *int + Value *Money + func (b BlikRecurringRegistration) Validate() error + type BlikRecurringStatus struct + func (s *BlikRecurringStatus) ExpirationDate() string + func (s *BlikRecurringStatus) IsActive() bool + func (s *BlikRecurringStatus) Raw() map[string]any + func (s *BlikRecurringStatus) Registration() *BlikRecurringInfo + func (s *BlikRecurringStatus) Status() string + func (s *BlikRecurringStatus) Type() BlikAliasType + func (s *BlikRecurringStatus) Value() string + type BlikService struct + func (s *BlikService) Alias(ctx context.Context, aliasValue string, aliasType BlikAliasType) (*BlikAlias, error) + func (s *BlikService) RecurringStatus(ctx context.Context, aliasValue string) (*BlikRecurringStatus, error) + func (s *BlikService) UnregisterAlias(ctx context.Context, aliasValue string, aliasType BlikAliasType, ...) error + type CardData struct + CVV string + Expiry string + PAN string + func (c CardData) Normalized() CardData + func (c CardData) Validate() error + type CardEncryptionError struct + func (e *CardEncryptionError) Error() string + func (e *CardEncryptionError) Is(target error) bool + func (e *CardEncryptionError) Unwrap() error + type CardPaymentError struct + func (e *CardPaymentError) Unwrap() error + type CardPaymentRequest struct + CardHolderFirstName *string + CardHolderLastName *string + ChannelID *int + DCCDecision DCCDecision + DeviceInfo DeviceInfo + Email *string + EncryptedCardData *string + ThreeDSConfirmed *bool + func (r *CardPaymentRequest) Validate() error + type CardPaymentResult struct + func (r *CardPaymentResult) DCCOffer() *DCCOffer + func (r *CardPaymentResult) HasDCCOffer() bool + func (r *CardPaymentResult) IsSuccess() bool + func (r *CardPaymentResult) Raw() map[string]any + func (r *CardPaymentResult) RedirectType() RedirectType + func (r *CardPaymentResult) RedirectURL() string + func (r *CardPaymentResult) RequiresRedirect() bool + func (r *CardPaymentResult) RequiresThreeDSForm() bool + func (r *CardPaymentResult) ThreeDSFormHTML() string + type CardRecurringFrequency string + const CardRecurringFrequencyAnnual + const CardRecurringFrequencyBiweekly + const CardRecurringFrequencyDaily + const CardRecurringFrequencyMonthly + const CardRecurringFrequencyQuarterly + const CardRecurringFrequencySemiannual + const CardRecurringFrequencyWeekly + func (f CardRecurringFrequency) Valid() bool + type CardRecurringOperation string + const CardRecurringOperationAddCard + const CardRecurringOperationCOFInitial + const CardRecurringOperationCharge + func (o CardRecurringOperation) Valid() bool + type CardRecurringRegistration struct + ExpirationDate *string + Frequency CardRecurringFrequency + InitDate *string + Label string + LimitAmt *Money + LimitAmtFixed *bool + TotLimitAmt *Money + func (c CardRecurringRegistration) Validate() error + type CardService struct + func (s *CardService) ApplePay(ctx context.Context, transactionID string, request *ApplePayRequest) (*CardPaymentResult, error) + func (s *CardService) Cancel(ctx context.Context, transactionID string, amount *Money) (*CardPaymentResult, error) + func (s *CardService) Capture(ctx context.Context, transactionID string, amount *Money) (*CardPaymentResult, error) + func (s *CardService) GooglePay(ctx context.Context, transactionID string, request *GooglePayRequest) (*CardPaymentResult, error) + func (s *CardService) PayOTP(ctx context.Context, transactionID string, request *CardPaymentRequest) (*CardPaymentResult, error) + func (s *CardService) PreAuth(ctx context.Context, transactionID string, request *CardPaymentRequest) (*CardPaymentResult, error) + func (s *CardService) PublicKey(ctx context.Context) (string, error) + type Client struct + Banks *BankService + Blik *BlikService + Cards *CardService + Payments *PaymentService + Payouts *PayoutService + Refunds *RefundService + func New(service, secretHash string, opts ...Option) (*Client, error) + func (c *Client) Service() string + type Currency string + const CurrencyCZK + const CurrencyEUR + const CurrencyPLN + func (c Currency) Valid() bool + type DCCDecision string + const DCCDecisionAccept + const DCCDecisionReject + func (d DCCDecision) Valid() bool + type DCCMarkup struct + func (m *DCCMarkup) AdditionalInfo() string + func (m *DCCMarkup) Rate() float64 + type DCCOffer struct + func (o *DCCOffer) ConvertedAmount() Money + func (o *DCCOffer) CurrencyConversionID() string + func (o *DCCOffer) DeclarationText() string + func (o *DCCOffer) ExchangeRate() float64 + func (o *DCCOffer) IsEuropeanEconomicArea() bool + func (o *DCCOffer) Markup() []*DCCMarkup + func (o *DCCOffer) OriginalAmount() Money + func (o *DCCOffer) Raw() map[string]any + func (o *DCCOffer) ValidUntil() string + type DeviceInfo struct + ApplicationName string + BrowserAcceptHeader string + BrowserColorDepth int + BrowserJavaEnabled *bool + BrowserLanguage string + BrowserScreenHeight int + BrowserScreenWidth int + BrowserTZ int + BrowserUserAgent string + DeviceID string + GeoLocalization string + SystemFamily string + func (d DeviceInfo) Validate() error + type Fields struct + func NewFields() *Fields + func (f *Fields) MarshalJSON() ([]byte, error) + func (f *Fields) Set(key string, value any) *Fields + type GooglePayRequest struct + ChannelID *int + DeviceInfo DeviceInfo + Email *string + Token string + func (r *GooglePayRequest) Validate() error + type HTTPDoer interface + Do func(req *http.Request) (*http.Response, error) + type IPNEvent struct + func VerifyIPN(rawBody []byte, secretHash string) (*IPNEvent, error) + func (e *IPNEvent) Amount() string + func (e *IPNEvent) Attempt() int64 + func (e *IPNEvent) CapturePaymentID() string + func (e *IPNEvent) Custom() string + func (e *IPNEvent) Email() string + func (e *IPNEvent) ID() string + func (e *IPNEvent) IsCapture() bool + func (e *IPNEvent) IsDCB() bool + func (e *IPNEvent) IsTransfer() bool + func (e *IPNEvent) Raw() map[string]any + func (e *IPNEvent) Signature() string + func (e *IPNEvent) Type() IPNType + func (e *IPNEvent) Version() int64 + type IPNType string + const IPNTypeCapture + const IPNTypeDCB + const IPNTypeTransfer + func (t IPNType) Valid() bool + type InvoiceDetails struct + InvoiceNumber *string + PayerNIP *string + PayerName *string + PaymentDueDate *string + VatAmount *Money + func (i InvoiceDetails) Validate() error + type Money struct + func NewMoney(minor int64, currency Currency) (Money, error) + func PLN(minor int64) Money + func ParseMoney(decimal string, currency Currency) (Money, error) + func (m Money) Currency() Currency + func (m Money) Equal(other Money) bool + func (m Money) IsNegative() bool + func (m Money) IsZero() bool + func (m Money) Minor() int64 + func (m Money) String() string + type Option func(*clientConfig) + func WithBaseURLs(urls BaseURLs) Option + func WithHTTPClient(doer HTTPDoer) Option + func WithTimeout(timeout time.Duration) Option + type Payer struct + Email *string + FirstName *string + LastName *string + func (p Payer) Validate() error + type PaymentRejectedError struct + TransactionID string + func (e *PaymentRejectedError) Unwrap() error + type PaymentService struct + func (s *PaymentService) Details(ctx context.Context, transactionID string) (*Transaction, error) + func (s *PaymentService) Register(ctx context.Context, request *RegisterPaymentRequest) (*RegisteredPayment, error) + type PayoutDetails struct + func (p *PayoutDetails) CreationDate() string + func (p *PayoutDetails) DeclineReason() string + func (p *PayoutDetails) DeclineStatus() string + func (p *PayoutDetails) Fee() Money + func (p *PayoutDetails) Gross() Money + func (p *PayoutDetails) ID() int64 + func (p *PayoutDetails) IsDeclined() bool + func (p *PayoutDetails) IsDirectSettlement() bool + func (p *PayoutDetails) IsFailed() bool + func (p *PayoutDetails) IsProcessed() bool + func (p *PayoutDetails) IsWaiting() bool + func (p *PayoutDetails) NRB() string + func (p *PayoutDetails) Net() Money + func (p *PayoutDetails) Raw() map[string]any + func (p *PayoutDetails) Receiver() *PayoutReceiver + func (p *PayoutDetails) State() int64 + type PayoutFeeMode string + const PayoutFeeModeGross + const PayoutFeeModeNet + func (m PayoutFeeMode) Valid() bool + type PayoutInstruction struct + FeeMode PayoutFeeMode + Positions []PayoutPosition + func (p PayoutInstruction) Validate() error + type PayoutPosition struct + Amount Money + IBAN string + Title string + func (p PayoutPosition) Validate() error + type PayoutReceiver struct + func (r *PayoutReceiver) Amount() (Money, bool) + func (r *PayoutReceiver) NRB() string + func (r *PayoutReceiver) Raw() map[string]any + func (r *PayoutReceiver) ReceiverAddress() string + func (r *PayoutReceiver) ReceiverName() string + func (r *PayoutReceiver) Service() string + func (r *PayoutReceiver) Title() string + type PayoutService struct + func (s *PayoutService) Details(ctx context.Context, withdrawID int64, opts ...TimestampOption) (*PayoutDetails, error) + type RateLimitError struct + Limit *int + Remaining *int + RetryAfter *int + func (e *RateLimitError) Unwrap() error + type RedirectType string + const RedirectTypeDCCOffer + const RedirectTypeForm + const RedirectTypeSuccess + const RedirectTypeURL + func (t RedirectType) Valid() bool + type Refund struct + func (r *Refund) IsAccepted() bool + func (r *Refund) Message() string + func (r *Refund) Raw() map[string]any + type RefundAvailability struct + func (a *RefundAvailability) HTTPStatus() int + func (a *RefundAvailability) IsAvailable() bool + func (a *RefundAvailability) Message() string + func (a *RefundAvailability) Raw() map[string]any + type RefundOption func(*refundOptions) + func WithRefundAmount(amount Money) RefundOption + func WithRefundReason(reason string) RefundOption + type RefundService struct + func (s *RefundService) CheckAvailability(ctx context.Context, transactionID string, opts ...RefundOption) (*RefundAvailability, error) + func (s *RefundService) Create(ctx context.Context, transactionID string, opts ...RefundOption) (*Refund, error) + type RegisterPaymentRequest struct + AcceptTos *bool + AliasIPNURL *string + Amount Money + AuthorizeOnly *bool + BillingAddress any + Blik *bool + BlikAlias *string + BlikCode *string + CardRecurring *CardRecurringRegistration + CardRecurringAlias *string + CardRecurringOperation CardRecurringOperation + Channel *string + CreditCard *bool + CurrencyCode Currency + Custom *string + Description *string + DeviceInfo *DeviceInfo + Efaktura *bool + Installment *bool + Invoice *InvoiceDetails + NoBanks *bool + NoDelay *bool + PartnerPlatform *string + PayPal *bool + Payer *Payer + Payout *PayoutInstruction + Paysafecard *bool + PhoneNumber *string + Products []any + RegisterBlikAlias *BlikAliasRegistration + RegisterBlikRecurringAlias *BlikRecurringRegistration + ShippingAddress any + TransactionType TransactionType + URLs ReturnURLs + UserAgent *string + UserIP *string + func (r *RegisterPaymentRequest) Validate() error + type RegisteredPayment struct + func (p *RegisteredPayment) CardRecurringAlias() string + func (p *RegisteredPayment) IPKSeF() string + func (p *RegisteredPayment) IsInlineProcessing() bool + func (p *RegisteredPayment) IsPaid() bool + func (p *RegisteredPayment) Message() string + func (p *RegisteredPayment) Raw() map[string]any + func (p *RegisteredPayment) RedirectURL() string + func (p *RegisteredPayment) TransactionID() string + type ReturnURLs struct + Fail string + IPN string + Success string + func (u ReturnURLs) Validate() error + type SignatureError struct + func (e *SignatureError) Error() string + func (e *SignatureError) Is(target error) bool + type TimestampOption func(*int64) + func WithTimestamp(timestamp int64) TimestampOption + type Transaction struct + func (t *Transaction) AvailableRefundAmount() Money + func (t *Transaction) CreationDate() string + func (t *Transaction) GatewayID() string + func (t *Transaction) ID() string + func (t *Transaction) IsDirect() bool + func (t *Transaction) IsFullyRefunded() bool + func (t *Transaction) IsPaid() bool + func (t *Transaction) IsRefunded() bool + func (t *Transaction) IsSettled() bool + func (t *Transaction) Payer() map[string]any + func (t *Transaction) PaymentDate() string + func (t *Transaction) PaymentMethod() string + func (t *Transaction) Raw() map[string]any + func (t *Transaction) RefundedAmount() Money + func (t *Transaction) Refunds() []*TransactionRefund + func (t *Transaction) Status() TransactionStatus + func (t *Transaction) Value() Money + type TransactionRefund struct + func (r *TransactionRefund) CreationDate() string + func (r *TransactionRefund) PaymentDate() string + func (r *TransactionRefund) PaymentID() string + func (r *TransactionRefund) Raw() map[string]any + func (r *TransactionRefund) Status() TransactionStatus + func (r *TransactionRefund) Value() Money + type TransactionStatus string + const TransactionStatusCaptured + const TransactionStatusCreated + const TransactionStatusExpired + const TransactionStatusPaid + const TransactionStatusProcessing + func (s TransactionStatus) Valid() bool + type TransactionType string + const TransactionTypeBizumDirect + const TransactionTypeBlikRecurring + const TransactionTypeCardAuth + const TransactionTypeCardRecurring + const TransactionTypeDCBGateway + const TransactionTypeMBWayDirect + const TransactionTypeTransfers + func (t TransactionType) Valid() bool + type TransportError struct + func (e *TransportError) Error() string + func (e *TransportError) Is(target error) bool + func (e *TransportError) Unwrap() error + type UnregisterOption func(*unregisterOptions) + func WithUnregisterReason(reason string) UnregisterOption + type ValidationError struct + func (e *ValidationError) Error() string + func (e *ValidationError) Is(target error) bool