Documentation ¶
Index ¶
- Constants
- type Amount
- type Confirmation
- type ConfirmationResponse
- type Create
- type CreatePaymentRequest
- type ErrorResponse
- type PayloadAnswer
- type PayloadHandler
- type PayloadRequestKassa
- type PaymentAnswer
- type PaymentHandler
- type PaymentResponse
- type PayoutRequestEndpoint
- type Recipient
- type SaveCard
- type SaveCardHandler
- type SaveCardResponse
- type YooKassaPayloadModel
Constants ¶
View Source
const (
DefaultDescription = "From ImperatorOfDwelling for renting an apartment."
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Confirmation ¶
type Confirmation struct {
Type string `json:"type"`
}
type ConfirmationResponse ¶
type Create ¶
type CreatePaymentRequest ¶
type CreatePaymentRequest struct { Amount Amount `json:"amount"` Confirmation Confirmation `json:"confirmation"` Capture bool `json:"capture"` Description string `json:"description"` }
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
func NewErrorResponse ¶
func NewErrorResponse(message string) *ErrorResponse
type PayloadAnswer ¶
type PayloadAnswer struct { TransactionId uuid.UUID `json:"transaction_id"` Status metrics.Status `json:"status"` YouKassaModel *YooKassaPayloadModel `json:"you_kassa_payload_model"` }
PayloadAnswer AnswerToFrontend
func NewPayloadAnswer ¶
func NewPayloadAnswer(youKassaModel *YooKassaPayloadModel) *PayloadAnswer
type PayloadHandler ¶
type PayloadHandler struct {
// contains filtered or unexported fields
}
func NewPayloadHandler ¶
func NewPayloadHandler(log *slog.Logger, logWriter postgres.LogRepository) *PayloadHandler
func (*PayloadHandler) Payload ¶
func (h *PayloadHandler) Payload(w http.ResponseWriter, r *http.Request)
type PayloadRequestKassa ¶
type PayloadRequestKassa struct { Amount Amount `json:"amount"` CardSynonym string `json:"card_synonym"` Description string `json:"description"` }
PayloadRequestKassa provided json paraments of payout request https://yookassa.ru/developers/payouts/making-payouts/bank-card/using-payout-widget/making-payouts-with-synonym
type PaymentAnswer ¶
type PaymentAnswer struct { TransactionId uuid.UUID `json:"transaction_id"` Status metrics.Status `json:"status"` YouKassaModel *PaymentResponse `json:"you_kassa_model"` }
PaymentAnswer response (answer) to frontend
func NewPaymentAnswer ¶
func NewPaymentAnswer(youKassaModel *PaymentResponse) *PaymentAnswer
type PaymentHandler ¶
type PaymentHandler struct {
// contains filtered or unexported fields
}
func NewPaymentHandler ¶
func NewPaymentHandler(log *slog.Logger, db postgres.LogRepository) *PaymentHandler
func (*PaymentHandler) Payment ¶
func (h *PaymentHandler) Payment(w http.ResponseWriter, r *http.Request)
type PaymentResponse ¶
type PaymentResponse struct { ID string `json:"id"` Status metrics.Status `json:"status"` Paid bool `json:"paid"` Amount Amount `json:"amount"` Confirmation ConfirmationResponse `json:"confirmation"` CreatedAt string `json:"created_at"` Description string `json:"description"` Metadata interface{} `json:"metadata"` Recipient Recipient `json:"recipient"` Refundable bool `json:"refundable"` Test bool `json:"test"` }
PaymentResponse response from youkassa
type PayoutRequestEndpoint ¶
type PayoutRequestEndpoint struct { ToUserId string `json:"user_id"` Amount Amount `json:"amount"` }
PayoutRequestEndpoint endpoint parameters
type SaveCard ¶
type SaveCard struct { UserId string `json:"user_id"` Synonym string `json:"synonym"` FirstSix string `json:"first_six"` LastFour string `json:"last_four"` }
SaveCard accepted structure from frontend
type SaveCardHandler ¶
type SaveCardHandler struct {
// contains filtered or unexported fields
}
func NewSaveCardHandler ¶
func NewSaveCardHandler(log *slog.Logger, db postgres.LogRepository) *SaveCardHandler
func (SaveCardHandler) SaveCard ¶
func (h SaveCardHandler) SaveCard(w http.ResponseWriter, r *http.Request)
type SaveCardResponse ¶
SaveCardResponse response to frontend
type YooKassaPayloadModel ¶
type YooKassaPayloadModel struct { ID string `json:"id"` Amount Amount `json:"amount"` Status metrics.Status `json:"status"` Description string `json:"description"` CreatedAt time.Time `json:"created_at"` Test bool `json:"test"` }
YooKassaPayloadModel YooKassa payload model
Click to show internal directories.
Click to hide internal directories.