acquiring

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFailedToParsePEMBlock failed to parse PEM block containing the open-api key
	ErrFailedToParsePEMBlock = errors.New("failed to parse PEM block containing the open-api key")

	// ErrFailedToParsePublicKey failed to parse open-api key
	ErrFailedToParsePublicKey = errors.New("failed to parse open-api key")
)

Functions

This section is empty.

Types

type Acquiring

type Acquiring struct {
	// contains filtered or unexported fields
}

func NewAcquiring

func NewAcquiring(opts Opts) *Acquiring

NewAcquiring Створює новий екземпляр класу

func (*Acquiring) CancelInvoice

func (a *Acquiring) CancelInvoice(ctx context.Context, req *InvoiceCancelRequest) (*InvoiceCancelResponse, error)

CancelInvoice Скасування рахунку

func (*Acquiring) CreateInvoice

func (a *Acquiring) CreateInvoice(ctx context.Context, req *InvoiceCreateRequest) (*InvoiceCreateResponse, error)

CreateInvoice Створення рахунку для оплати

func (*Acquiring) CreateInvoicePaymentDirect

func (a *Acquiring) CreateInvoicePaymentDirect(ctx context.Context, req *InvoicePaymentDirectRequest) (*InvoicePaymentDirectResponse, error)

CreateInvoicePaymentDirect Створення рахунку для оплати

func (*Acquiring) FinalizeInvoice

FinalizeInvoice Завершення рахунку

func (*Acquiring) GetInvoiceInfo

func (a *Acquiring) GetInvoiceInfo(ctx context.Context, invoiceID string) (*InvoiceInfoResponse, error)

GetInvoiceInfo Дані про успішну оплату, якщо вона була здійснена

func (*Acquiring) GetInvoiceStatus

func (a *Acquiring) GetInvoiceStatus(ctx context.Context, invoiceID string) (*InvoiceStatusResponse, error)

GetInvoiceStatus Отримати статус рахунку

func (*Acquiring) InvoiceFiscal

func (a *Acquiring) InvoiceFiscal(ctx context.Context, invoiceID string) (*FiscalResponse, error)

InvoiceFiscal фіскалізація чека

func (*Acquiring) InvoiceStatement

InvoiceStatement відповідь на запит статусу рахунку

func (*Acquiring) MerchantDeleteTokenizeCard

func (a *Acquiring) MerchantDeleteTokenizeCard(ctx context.Context, cardToken string) error

MerchantDeleteTokenizeCard видалення токенізованої картки

func (*Acquiring) MerchantDetails

func (a *Acquiring) MerchantDetails(ctx context.Context) (*MerchantDetailsResponse, error)

MerchantDetails отримання деталей мерчанта

func (*Acquiring) MerchantSubMerchant

func (a *Acquiring) MerchantSubMerchant(ctx context.Context) (*SubMerchantResponse, error)

MerchantSubMerchant отримання субмерчантів

func (*Acquiring) MerchantWalletPayment

MerchantWalletPayment запит оплати за токеном картки

func (*Acquiring) MerchantWallets

func (a *Acquiring) MerchantWallets(ctx context.Context, walletID string) (*MerchantWalletsResponse, error)

MerchantWallets отримання списку токенізованих карток

func (*Acquiring) NewDefaultInvoiceCancelRequest

func (a *Acquiring) NewDefaultInvoiceCancelRequest() *InvoiceCancelRequest

NewDefaultInvoiceCancelRequest створення стандартного запиту на скасування рахунку

func (*Acquiring) NewDefaultInvoiceCreateRequest

func (a *Acquiring) NewDefaultInvoiceCreateRequest() *InvoiceCreateRequest

NewDefaultInvoiceCreateRequest створення стандартного запиту на створення рахунку

func (*Acquiring) PubKey

func (a *Acquiring) PubKey(ctx context.Context) (*PubKeyResponse, error)

PubKey отримання публічного ключа

func (*Acquiring) QrDetails

func (a *Acquiring) QrDetails(ctx context.Context, qrID string) (*QrDetailsResponse, error)

QrDetails Інформація про QR-касу, лише для активованих QR-кас

func (*Acquiring) QrList

func (a *Acquiring) QrList(ctx context.Context) (*QrListResponse, error)

QrList список QR-кас

func (*Acquiring) QrResetAmount

QrResetAmount запит на скидання суми

func (*Acquiring) RemoveInvoice

func (a *Acquiring) RemoveInvoice(ctx context.Context, req *InvoiceRemoveRequest) error

RemoveInvoice Скасування рахунку

func (*Acquiring) SetCMS

func (a *Acquiring) SetCMS(cms string) *Acquiring

SetCMS Встановлює назву CMS

func (*Acquiring) SetCMSVersion

func (a *Acquiring) SetCMSVersion(version string) *Acquiring

SetCMSVersion Встановлює версію CMS

func (*Acquiring) VerificationWebhook

func (a *Acquiring) VerificationWebhook(pubKey, xSign string, bodyBytes []byte) (bool, error)

type BasketOrder

type BasketOrder struct {
	Name      string      `json:"name"`
	Qty       float64     `json:"qty"`
	Sum       int64       `json:"sum"`
	Icon      string      `json:"icon"`
	Unit      string      `json:"unit"`
	Code      string      `json:"code"`
	Barcode   string      `json:"barcode"`
	Header    string      `json:"header"`
	Footer    string      `json:"footer"`
	Tax       []int       `json:"tax"`
	UKTZED    string      `json:"uktzed"`
	Discounts []*Discount `json:"discounts"`
}

BasketOrder - товари в чеку

type CancelList

type CancelList struct {
	Status       string    `json:"status"`
	Amount       int       `json:"amount"`
	Ccy          int       `json:"ccy"`
	CreatedDate  time.Time `json:"createdDate"`
	ModifiedDate time.Time `json:"modifiedDate"`
	ApprovalCode string    `json:"approvalCode"`
	RRN          string    `json:"rrn"`
	ExtRef       string    `json:"extRef"`
}

CancelList Список прийнятих заявок на скасування

type CardData

type CardData struct {
	Pan string `json:"pan"`
	Exp string `json:"exp"`
	CVV int    `json:"cvv"`
}

type Discount

type Discount struct {
	Type  DiscountType `json:"type"`
	Mode  DiscountMode `json:"mode"`
	Value float64      `json:"value"`
}

type DiscountMode

type DiscountMode string
const (
	// DiscountModePercent - відсоток
	DiscountModePercent DiscountMode = "PERCENT"

	// DiscountModeValue - сума
	DiscountModeValue DiscountMode = "VALUE"
)

type DiscountType

type DiscountType string
const (
	// DiscountTypeDiscount - знижка
	DiscountTypeDiscount DiscountType = "DISCOUNT"

	// DiscountTypeExtraCharge - надбавка
	DiscountTypeExtraCharge DiscountType = "EXTRA_CHARGE"
)

type ErrorBody

type ErrorBody struct {
	ErrCode string `json:"errCode"`
	ErrText string `json:"errText"`
}

func (ErrorBody) Error

func (e ErrorBody) Error() string

type Fiscal

type Fiscal struct {
	ID                  string `json:"id"`
	Type                string `json:"type"`
	Status              string `json:"status"`
	StatusDescription   string `json:"statusDescription"`
	TaxURL              string `json:"taxUrl"`
	File                string `json:"file"`
	FiscalizationSource string `json:"fiscalizationSource"`
}

Fiscal обʼєкт фіскалізації

type FiscalResponse

type FiscalResponse struct {
	Checks []*Fiscal `json:"checks"`
}

FiscalResponse відповідь на запит фіскалізації

type InvoiceCancelRequest

type InvoiceCancelRequest struct {
	InvoiceID string `json:"invoiceId"`
	ExtRef    string `json:"extRef"`
	Amount    int64  `json:"amount"`
}

InvoiceCancelRequest тіло запиту на скасування рахунку

type InvoiceCancelResponse

type InvoiceCancelResponse struct {
	// Status Статус запиту - Enum: "processing" "success" "failure"
	Status       string    `json:"status"`
	CreatedDate  time.Time `json:"createdDate"`
	ModifiedDate time.Time `json:"modifiedDate"`
}

InvoiceCancelResponse тіло відповіді на скасування рахунку

type InvoiceCreateRequest

type InvoiceCreateRequest struct {
	Amount           int64             `json:"amount"`
	CCY              iso.ISO4217       `json:"ccy"`
	MerchantPaymInfo *MerchantPaymInfo `json:"merchantPaymInfo"`
	RedirectURL      string            `json:"redirectUrl"`
	WebHookURL       string            `json:"webHookUrl"`
	Validity         int               `json:"validity"`
	PaymentType      PaymentType       `json:"paymentType"`
	QrID             string            `json:"qrId"`
	Code             string            `json:"code"`
	SaveCardData     *SaveCardData     `json:"saveCardData"`
}

InvoiceCreateRequest тіло запиту на створення рахунку

type InvoiceCreateResponse

type InvoiceCreateResponse struct {
	InvoiceID string `json:"invoiceId"`
	PageURL   string `json:"pageUrl"`
}

InvoiceCreateResponse тіло відповіді на створення рахунку

type InvoiceFinalizeRequest

type InvoiceFinalizeRequest struct {
	InvoiceID string `json:"invoiceId"`
	Amount    int64  `json:"amount"`
}

InvoiceFinalizeRequest тіло запиту на завершення рахунку

type InvoiceFinalizeResponse

type InvoiceFinalizeResponse struct {
	Status string `json:"status"`
}

InvoiceFinalizeResponse тіло відповіді на завершення рахунку

type InvoiceInfoResponse

type InvoiceInfoResponse struct {
	MaskedPan     string        `json:"maskedPan"`
	ApprovalCode  string        `json:"approvalCode"`
	RRN           string        `json:"rrn"`
	Amount        int           `json:"amount"`
	Ccy           int           `json:"ccy"`
	FinalAmount   int           `json:"finalAmount"`
	CreatedDate   time.Time     `json:"createdDate"`
	Terminal      string        `json:"terminal"`
	PaymentScheme string        `json:"paymentScheme"`
	PaymentMethod string        `json:"paymentMethod"`
	Fee           int           `json:"fee"`
	DomesticCard  bool          `json:"domesticCard"`
	Country       string        `json:"country"`
	CancelList    []*CancelList `json:"cancelList"`
}

type InvoicePaymentDirectRequest

type InvoicePaymentDirectRequest struct {
	Amount           int               `json:"amount"`
	Ccy              int               `json:"ccy"`
	CardData         *CardData         `json:"cardData"`
	MerchantPaymInfo *MerchantPaymInfo `json:"merchantPaymInfo"`
	WebHookURL       string            `json:"webHookUrl"`
	RedirectURL      string            `json:"redirectUrl"`
	PaymentType      PaymentType       `json:"paymentType"`
	SaveCardData     *SaveCardData     `json:"saveCardData"`
	InitiationKind   string            `json:"initiationKind"`
	TDS              bool              `json:"tds"`
}

InvoicePaymentDirectRequest тіло запиту на створення рахунку

type InvoicePaymentDirectResponse

type InvoicePaymentDirectResponse struct {
	InvoiceID     string    `json:"invoiceId"`
	TdsURL        string    `json:"tdsUrl"`
	Status        string    `json:"status"`
	FailureReason string    `json:"failureReason"`
	Amount        int       `json:"amount"`
	Ccy           int       `json:"ccy"`
	CreatedDate   time.Time `json:"createdDate"`
	ModifiedDate  time.Time `json:"modifiedDate"`
}

InvoicePaymentDirectResponse тіло відповіді на створення рахунку

type InvoiceRemoveRequest

type InvoiceRemoveRequest struct {
	InvoiceID string `json:"invoiceId"`
}

InvoiceRemoveRequest тіло запиту на скасування рахунку

type InvoiceStatement

type InvoiceStatement struct {
	InvoiceID     string        `json:"invoiceId"`
	Status        string        `json:"status"`
	MaskedPan     string        `json:"maskedPan"`
	Date          time.Time     `json:"date"`
	PaymentScheme string        `json:"paymentScheme"`
	Amount        int           `json:"amount"`
	ProfitAmount  int           `json:"profitAmount"`
	Ccy           int           `json:"ccy"`
	ApprovalCode  string        `json:"approvalCode"`
	Rrn           string        `json:"rrn"`
	Reference     string        `json:"reference"`
	ShortQrID     string        `json:"shortQrId"`
	CancelList    []*CancelList `json:"cancelList"`
}

InvoiceStatement відповідь на запит статусу рахунку

type InvoiceStatementRequest

type InvoiceStatementRequest struct {
	// From - початкова дата в форматі UTC Unix Timestamp
	From int64
	// To - кінцева дата в форматі UTC Unix Timestamp
	To int64
}

InvoiceStatementRequest відповідь на запит статусу рахунку

type InvoiceStatementResponse

type InvoiceStatementResponse struct {
	List []*InvoiceStatement `json:"list"`
}

InvoiceStatementResponse відповідь на запит статусу рахунку

type InvoiceStatusResponse

type InvoiceStatusResponse struct {
	InvoiceID     string        `json:"invoiceId"`
	Status        string        `json:"status"`
	FailureReason string        `json:"failureReason"`
	ErrCode       string        `json:"errCode"`
	Amount        int           `json:"amount"`
	Ccy           int           `json:"ccy"`
	FinalAmount   int           `json:"finalAmount"`
	CreatedDate   time.Time     `json:"createdDate"`
	ModifiedDate  time.Time     `json:"modifiedDate"`
	Reference     string        `json:"reference"`
	CancelList    []*CancelList `json:"cancelList"`
	WalletData    *WalletData   `json:"walletData"`
}

InvoiceStatusResponse Відповідь на запит статусу рахунку

type InvoiceWebhook

type InvoiceWebhook InvoiceStatusResponse

type ItemCancel

type ItemCancel struct {
	Name    string  `json:"name"`
	Qty     float64 `json:"qty"`
	Sum     int64   `json:"sum"`
	Code    string  `json:"code"`
	Barcode string  `json:"barcode"`
	Header  string  `json:"header"`
	Footer  string  `json:"footer"`
	Tax     []int   `json:"tax"`
	UKTZED  string  `json:"uktzed"`
}

ItemCancel Список товарів для створення чеку повернення, поле обов'язкове у випадку активованої опції фіскалізації

type MerchantDeleteTokenizeCardResponse

type MerchantDeleteTokenizeCardResponse struct{}

type MerchantDetailsResponse

type MerchantDetailsResponse struct {
	MerchantID   string `json:"merchantId"`
	MerchantName string `json:"merchantName"`
	EDRPOU       string `json:"edrpou"`
}

MerchantDetailsResponse відповідь на запит деталей мерчанта

type MerchantPaymInfo

type MerchantPaymInfo struct {
	Reference      string         `json:"reference"`
	Destination    string         `json:"destination"`
	Comment        string         `json:"comment"`
	CustomerEmails []string       `json:"customerEmails"`
	BasketOrder    []*BasketOrder `json:"basketOrder"`
}

MerchantPaymInfo - інформація про платіж

type MerchantWallet

type MerchantWallet struct {
	CardToken string `json:"cardToken"`
	MaskedPan string `json:"maskedPan"`
	Country   string `json:"country"`
}

type MerchantWalletPaymentRequest

type MerchantWalletPaymentRequest struct {
	CardToken        string            `json:"cardToken"`
	Amount           int               `json:"amount"`
	Ccy              int               `json:"ccy"`
	Tds              bool              `json:"tds"`
	RedirectURL      string            `json:"redirectUrl"`
	WebHookURL       string            `json:"webHookUrl"`
	InitiationKind   string            `json:"initiationKind"`
	MerchantPaymInfo *MerchantPaymInfo `json:"merchantPaymInfo"`
}

MerchantWalletPaymentRequest запит оплати за токеном картки

type MerchantWalletPaymentResponse

type MerchantWalletPaymentResponse struct {
	InvoiceID     string    `json:"invoiceId"`
	TdsURL        string    `json:"tdsUrl"`
	Status        string    `json:"status"`
	FailureReason string    `json:"failureReason"`
	Amount        int       `json:"amount"`
	Ccy           int       `json:"ccy"`
	CreatedDate   time.Time `json:"createdDate"`
	ModifiedDate  time.Time `json:"modifiedDate"`
}

MerchantWalletPaymentResponse відповідь на запит оплати за токеном картки

type MerchantWalletsResponse

type MerchantWalletsResponse struct {
	Wallets []*MerchantWallet `json:"wallets"`
}

type Opts

type Opts struct {
	Token  string
	Client *http.Client
}

Opts Налаштування

type PaymentType

type PaymentType string
const (
	Debit PaymentType = "debit"
	Hold  PaymentType = "hold"
)

type PubKeyResponse

type PubKeyResponse struct {
	Key string `json:"key"`
}

PubKeyResponse відповідь на запит публічного ключа

type QrDetailsResponse

type QrDetailsResponse struct {
	ShortQrID string `json:"shortQrId"`
	InvoiceID string `json:"invoiceId"`
	Amount    int    `json:"amount"`
	Ccy       int    `json:"ccy"`
}

QrDetailsResponse Інформація про QR-касу, лише для активованих QR-кас

type QrListResponse

type QrListResponse struct {
	List []*QrObject `json:"list"`
}

QrListResponse список QR-кас

type QrObject

type QrObject struct {
	ShortQrID  string `json:"shortQrId"`
	QrID       string `json:"qrId"`
	AmountType string `json:"amountType"`
	PageURL    string `json:"pageUrl"`
}

QrObject QR-каса

type QrResetAmountRequest

type QrResetAmountRequest struct {
	QrID string `json:"qrId"`
}

QrResetAmountRequest запит на скидання суми

type QrResetAmountResponse

type QrResetAmountResponse struct{}

QrResetAmountResponse відповідь на запит на скидання суми

type SaveCardData

type SaveCardData struct {
	SaveCard bool   `json:"saveCard"`
	WalletID string `json:"walletId"`
}

type SubMerchant

type SubMerchant struct {
	Code   string `json:"code"`
	EDRPOU string `json:"edrpou"`
	IBAN   string `json:"iban"`
}

SubMerchant обʼект субмерчантів

type SubMerchantResponse

type SubMerchantResponse struct {
	List []*SubMerchant `json:"list"`
}

SubMerchantResponse відповідь на запит субмерчантів

type WalletData

type WalletData struct {
	CardToken string `json:"cardToken"`
	WalletID  string `json:"walletId"`
	Status    string `json:"status"`
}

WalletData Параметри картки

Jump to

Keyboard shortcuts

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