yookassa

package
v0.0.0-...-d4840ec Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package yookassa implements all the necessary methods for working with YooMoney.

Package yookassa implements all the necessary methods for working with YooMoney.

Package yookassa implements all the necessary methods for working with YooMoney.

Package yookassa implements all the necessary methods for working with YooMoney.

Index

Constants

View Source
const (
	PaymentEndpoint = "payments"
	CaptureEndpoint = "capture"
	CancelEndpoint  = "cancel"
)
View Source
const (
	SbpBanksEndpoint = "sbp_banks"
	PayoutsEndpoint  = "payouts"
)
View Source
const (
	BaseURL = "https://api.yookassa.ru/v3/"
)
View Source
const (
	MeEndpoint = "me"
)
View Source
const (
	RefundEndpoint = "refunds"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client works with YooMoney API.

func NewClient

func NewClient(accountId string, secretKey string) *Client

type PaymentHandler

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

PaymentHandler works with requests related to Payments.

func NewPaymentHandler

func NewPaymentHandler(client *Client) *PaymentHandler

func (*PaymentHandler) CancelPayment

func (p *PaymentHandler) CancelPayment(paymentId string) (*yoopayment.Payment, error)

CancelPayment cancel payment by ID.

func (*PaymentHandler) CapturePayment

func (p *PaymentHandler) CapturePayment(payment *yoopayment.Payment) (*yoopayment.Payment, error)

CapturePayment confirms payment, accepts and returns the Payment entity.

func (*PaymentHandler) CreatePayment

func (p *PaymentHandler) CreatePayment(payment *yoopayment.Payment) (*yoopayment.Payment, error)

CreatePayment creates a payment, accepts and returns the Payment entity.

func (p *PaymentHandler) CreatePaymentLink(payment *yoopayment.Payment) (string, error)

CreatePaymentLink creates a payment link, accepts Payment entity, returns the link.

func (*PaymentHandler) FindPayment

func (p *PaymentHandler) FindPayment(id string) (*yoopayment.Payment, error)

FindPayment find a payment by ID returns the Payment entity.

func (*PaymentHandler) FindPayments

func (p *PaymentHandler) FindPayments(
	filter *yoopayment.PaymentListFilter,
) (*yoopayment.PaymentList, error)

FindPayments find payments by filter and returns the list of payments.

func (p *PaymentHandler) ParsePaymentLink(payment *yoopayment.Payment) (string, error)

ParsePaymentLink retrieves a link to the Payment from the Payment entity.

func (PaymentHandler) WithIdempotencyKey

func (p PaymentHandler) WithIdempotencyKey(idempotencyKey string) *PaymentHandler

type PayoutHandler

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

PayoutHandler works with requests related to Payouts.

func NewPayoutHandler

func NewPayoutHandler(client *Client) *PayoutHandler

func (*PayoutHandler) CreatePayout

func (p *PayoutHandler) CreatePayout(payout *yoopayout.Payout) (*yoopayout.Payout, error)

TODO: support other payout types

func (*PayoutHandler) GetPayout

func (p *PayoutHandler) GetPayout(payoutId string) (*yoopayout.Payout, error)

func (*PayoutHandler) GetSbpBanks

func (p *PayoutHandler) GetSbpBanks() ([]yoopayout.SbpBank, error)

func (PayoutHandler) WithIdempotencyKey

func (p PayoutHandler) WithIdempotencyKey(idempotencyKey string) *PayoutHandler

type RefundHandler

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

RefundHandler works with requests related to Refunds.

func NewRefundHandler

func NewRefundHandler(client *Client) *RefundHandler

func (*RefundHandler) CreateRefund

func (r *RefundHandler) CreateRefund(refund *yoorefund.Refund) (*yoorefund.Refund, error)

CreateRefund creates a refund, accepts and returns the Refund entity.

func (*RefundHandler) FindRefund

func (r *RefundHandler) FindRefund(id string) (*yoorefund.Refund, error)

FindRefund find a refund by ID returns the Refund entity.

func (*RefundHandler) FindRefunds

func (r *RefundHandler) FindRefunds(
	filter *yoorefund.RefundListFilter,
) (*yoorefund.RefundList, error)

FindRefunds find refunds by filter and returns the list of refunds.

func (RefundHandler) WithIdempotencyKey

func (r RefundHandler) WithIdempotencyKey(idempotencyKey string) RefundHandler

type SettingsHandler

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

SettingsHandler works with client's account settings.

func NewSettingsHandler

func NewSettingsHandler(client *Client) *SettingsHandler

func (*SettingsHandler) GetAccountSettings

func (s *SettingsHandler) GetAccountSettings(OnBehalfOf *string) (*yoosettings.Settings, error)

GetAccountSettings gets the client account settings.

func (SettingsHandler) WithIdempotencyKey

func (r SettingsHandler) WithIdempotencyKey(idempotencyKey string) SettingsHandler

Directories

Path Synopsis
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayout describes all the necessary entities for working with YooMoney Payouts.
Package yoopayout describes all the necessary entities for working with YooMoney Payouts.
Package yoorefund describes all the necessary entities for working with YooMoney Refunds.
Package yoorefund describes all the necessary entities for working with YooMoney Refunds.
Package yoosettings describes all the necessary entities for working with YooMoney Settings.
Package yoosettings describes all the necessary entities for working with YooMoney Settings.

Jump to

Keyboard shortcuts

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