Generate yookassa client via openapi tool ogen
This commit is contained in:
316
internal/service/yookassa/gen/oas_server_gen.go
Normal file
316
internal/service/yookassa/gen/oas_server_gen.go
Normal file
@@ -0,0 +1,316 @@
|
||||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// Handler handles operations described by OpenAPI v3 specification.
|
||||
type Handler interface {
|
||||
// DealsDealIDGet implements GET /deals/{deal_id} operation.
|
||||
//
|
||||
// Запрос позволяет получить информацию о текущем
|
||||
// состоянии сделки по ее уникальному идентификатору.
|
||||
//
|
||||
// GET /deals/{deal_id}
|
||||
DealsDealIDGet(ctx context.Context, params DealsDealIDGetParams) (DealsDealIDGetRes, error)
|
||||
// DealsGet implements GET /deals operation.
|
||||
//
|
||||
// Запрос позволяет получить список сделок,
|
||||
// отфильтрованный по заданным критериям. Подробнее о
|
||||
// работе со списками: https://yookassa.ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /deals
|
||||
DealsGet(ctx context.Context, params DealsGetParams) (DealsGetRes, error)
|
||||
// DealsPost implements POST /deals operation.
|
||||
//
|
||||
// Запрос позволяет создать сделку, в рамках которой
|
||||
// необходимо принять оплату от покупателя и
|
||||
// перечислить ее продавцу.
|
||||
//
|
||||
// POST /deals
|
||||
DealsPost(ctx context.Context, req *SafeDealRequest, params DealsPostParams) (DealsPostRes, error)
|
||||
// MeGet implements GET /me operation.
|
||||
//
|
||||
// С помощью этого запроса вы можете получить
|
||||
// информацию о магазине или шлюзе: * Для Сплитования
|
||||
// платежей: https://yookassa.ru/developers/solutions-for-platforms/split-payments/basics: в
|
||||
// запросе необходимо передать параметр on_behalf_of с
|
||||
// идентификатором магазина продавца и ваши данные для
|
||||
// аутентификации: https://yookassa.ru/developers/using-api/interaction-format#auth
|
||||
// (идентификатор и секретный ключ вашей платформы). *
|
||||
// Для партнеров: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/partners-api/basics: в запросе необходимо
|
||||
// передать OAuth-токен магазина. * Для выплат: https://yookassa.
|
||||
// ru/developers/payouts/overview: в запросе необходимо передать ваши
|
||||
// данные для аутентификации: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth (идентификатор и секретный
|
||||
// ключ вашего шлюза).
|
||||
//
|
||||
// GET /me
|
||||
MeGet(ctx context.Context, params MeGetParams) (MeGetRes, error)
|
||||
// PaymentMethodsPaymentMethodIDGet implements GET /payment_methods/{payment_method_id} operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы получить информацию о
|
||||
// текущем состоянии способа оплаты по его уникальному
|
||||
// идентификатору.
|
||||
//
|
||||
// GET /payment_methods/{payment_method_id}
|
||||
PaymentMethodsPaymentMethodIDGet(ctx context.Context, params PaymentMethodsPaymentMethodIDGetParams) (PaymentMethodsPaymentMethodIDGetRes, error)
|
||||
// PaymentMethodsPost implements POST /payment_methods operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы создать в ЮKassa объект
|
||||
// способа оплаты: https://yookassa.ru/developers/api#payment_method_object. В
|
||||
// запросе необходимо передать код способа оплаты,
|
||||
// который вы хотите сохранить, и при необходимости
|
||||
// дополнительные параметры, связанные с той
|
||||
// функциональностью, которую вы хотите использовать.
|
||||
// Идентификатор созданного способа оплаты вы можете
|
||||
// использовать при проведении автоплатежей: https://yookassa.
|
||||
// ru/developers/payment-acceptance/scenario-extensions/recurring-payments/create-recurring или
|
||||
// выплат: https://yookassa.ru/developers/payouts/scenario-extensions/multipurpose-token.
|
||||
//
|
||||
// POST /payment_methods
|
||||
PaymentMethodsPost(ctx context.Context, req PaymentMethodsPostReq, params PaymentMethodsPostParams) (PaymentMethodsPostRes, error)
|
||||
// PaymentsGet implements GET /payments operation.
|
||||
//
|
||||
// Use this request to get a list of payments. You can download payments created over the last 3
|
||||
// years. You can filter the list by specified criteria. More about working with lists:
|
||||
// https://yookassa.ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /payments
|
||||
PaymentsGet(ctx context.Context, params PaymentsGetParams) (PaymentsGetRes, error)
|
||||
// PaymentsPaymentIDCancelPost implements POST /payments/{payment_id}/cancel operation.
|
||||
//
|
||||
// Cancel payments with the waiting_for_capture status. Payment cancelation means you are not ready
|
||||
// to dispatch a product or to provide a service to the user. Once you cancel the payment, we will
|
||||
// start returning the money to the payer’s account. If the payment was made from a bank card, a
|
||||
// YooMoney wallet, or via SberPay, the money will be refunded instantly. If the payment was made
|
||||
// using other payment methods, the process can take up to several days. More about capturing and
|
||||
// canceling payments: https://yookassa.
|
||||
// ru/developers/payment-acceptance/getting-started/payment-process#capture-and-cancel.
|
||||
//
|
||||
// POST /payments/{payment_id}/cancel
|
||||
PaymentsPaymentIDCancelPost(ctx context.Context, params PaymentsPaymentIDCancelPostParams) (PaymentsPaymentIDCancelPostRes, error)
|
||||
// PaymentsPaymentIDCapturePost implements POST /payments/{payment_id}/capture operation.
|
||||
//
|
||||
// Confirm you’re ready to accept the payment. Once the payment is captured, the status will change
|
||||
// to succeeded. After that, you can provide the customer with the product or service. You can only
|
||||
// capture payments with the waiting_for_capture status, and only for a certain amount of time
|
||||
// (depending on the payment method). If you do not capture the payment within the allotted time, the
|
||||
// status will change to canceled, and the money will be returned to the user. More about capturing
|
||||
// and canceling payments: https://yookassa.
|
||||
// ru/developers/payment-acceptance/getting-started/payment-process#capture-and-cancel.
|
||||
//
|
||||
// POST /payments/{payment_id}/capture
|
||||
PaymentsPaymentIDCapturePost(ctx context.Context, req *PaymentsPaymentIDCapturePostReq, params PaymentsPaymentIDCapturePostParams) (PaymentsPaymentIDCapturePostRes, error)
|
||||
// PaymentsPaymentIDGet implements GET /payments/{payment_id} operation.
|
||||
//
|
||||
// This request allows you to get the information about the current payment status by its unique ID.
|
||||
//
|
||||
// GET /payments/{payment_id}
|
||||
PaymentsPaymentIDGet(ctx context.Context, params PaymentsPaymentIDGetParams) (PaymentsPaymentIDGetRes, error)
|
||||
// PaymentsPost implements POST /payments operation.
|
||||
//
|
||||
// To accept a payment, you need to create a payment object: https://yookassa.
|
||||
// ru/developers/api#payment_object, Payment. It contains all the necessary payment information
|
||||
// (amount, currency, and status). Payments have a linear life cycle, going from one status to the
|
||||
// next sequentially.
|
||||
//
|
||||
// POST /payments
|
||||
PaymentsPost(ctx context.Context, req *PaymentsPostReq, params PaymentsPostParams) (PaymentsPostRes, error)
|
||||
// PayoutsGet implements GET /payouts operation.
|
||||
//
|
||||
// Use this request to get a list of payouts. You can download payments created over the last 3 years.
|
||||
// You can filter the list by specified criteria. Request authentication details: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth depend on which payment solution you are using:
|
||||
// basic payouts: https://yookassa.ru/developers/payouts/overview or payouts within the Safe Deal:
|
||||
// https://yookassa.ru/developers/solutions-for-platforms/safe-deal/basics. More about working with
|
||||
// lists: https://yookassa.ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /payouts
|
||||
PayoutsGet(ctx context.Context, params PayoutsGetParams) (PayoutsGetRes, error)
|
||||
// PayoutsPayoutIDGet implements GET /payouts/{payout_id} operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы получить информацию о
|
||||
// текущем состоянии выплаты по ее уникальному
|
||||
// идентификатору. Данные для аутентификации: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth запросов зависят от того,
|
||||
// какое платежное решение вы используете — обычные
|
||||
// выплаты: https://yookassa.ru/developers/payouts/overview или выплаты в
|
||||
// рамках Безопасной сделки: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/safe-deal/basics.
|
||||
//
|
||||
// GET /payouts/{payout_id}
|
||||
PayoutsPayoutIDGet(ctx context.Context, params PayoutsPayoutIDGetParams) (PayoutsPayoutIDGetRes, error)
|
||||
// PayoutsPost implements POST /payouts operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы создать в ЮKassa объект
|
||||
// выплаты: https://yookassa.ru/developers/api#payout_object. В запросе
|
||||
// необходимо передать сумму выплаты, данные о способе
|
||||
// получения выплаты (например, номер кошелька ЮMoney),
|
||||
// описание выплаты и при необходимости дополнительные
|
||||
// параметры, связанные с той функциональностью,
|
||||
// которую вы хотите использовать. Передаваемые
|
||||
// параметры и данные для аутентификации: https://yookassa.
|
||||
// ru/developers/using-api/interaction-format#auth запросов зависят от того,
|
||||
// какое платежное решение вы используете — обычные
|
||||
// выплаты: https://yookassa.ru/developers/payouts/overview или выплаты в
|
||||
// рамках Безопасной сделки: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/safe-deal/basics.
|
||||
//
|
||||
// POST /payouts
|
||||
PayoutsPost(ctx context.Context, req *PayoutRequest, params PayoutsPostParams) (PayoutsPostRes, error)
|
||||
// PayoutsSearchGet implements GET /payouts/search operation.
|
||||
//
|
||||
// Use this request to search for payouts by the specified criteria. Available only for payouts
|
||||
// created over the last 3 months. At this time, only search by the metadata parameter is available.
|
||||
// You can also specify the date and time when the payout was created (the created_at parameter).
|
||||
// Request authentication details: https://yookassa.ru/developers/using-api/interaction-format#auth
|
||||
// depend on which payment solution you are using: basic payouts: https://yookassa.
|
||||
// ru/developers/payouts/overview or payouts within the Safe Deal: https://yookassa.
|
||||
// ru/developers/solutions-for-platforms/safe-deal/basics.
|
||||
//
|
||||
// GET /payouts/search
|
||||
PayoutsSearchGet(ctx context.Context, params PayoutsSearchGetParams) (PayoutsSearchGetRes, error)
|
||||
// PersonalDataPersonalDataIDGet implements GET /personal_data/{personal_data_id} operation.
|
||||
//
|
||||
// С помощью этого запроса вы можете получить
|
||||
// информацию о текущем статусе объекта персональных
|
||||
// данных по его уникальному идентификатору.
|
||||
//
|
||||
// GET /personal_data/{personal_data_id}
|
||||
PersonalDataPersonalDataIDGet(ctx context.Context, params PersonalDataPersonalDataIDGetParams) (PersonalDataPersonalDataIDGetRes, error)
|
||||
// PersonalDataPost implements POST /personal_data operation.
|
||||
//
|
||||
// Используйте этот запрос, чтобы создать в ЮKassa объект
|
||||
// персональных данных: https://yookassa.ru/developers/api#personal_data_object. В
|
||||
// запросе необходимо указать тип данных (с какой целью
|
||||
// они будут использоваться) и передать информацию о
|
||||
// пользователе: фамилию, имя, отчество и другие — в
|
||||
// зависимости от выбранного типа. Идентификатор
|
||||
// созданного объекта персональных данных необходимо
|
||||
// использовать в запросе на создание выплаты: https://yookassa.
|
||||
// ru/developers/api#create_payout.
|
||||
//
|
||||
// POST /personal_data
|
||||
PersonalDataPost(ctx context.Context, req PersonalDataPostReq, params PersonalDataPostParams) (PersonalDataPostRes, error)
|
||||
// ReceiptsGet implements GET /receipts operation.
|
||||
//
|
||||
// Запрос позволяет получить список чеков,
|
||||
// отфильтрованный по заданным критериям. Можно
|
||||
// запросить чеки по конкретному платежу, чеки по
|
||||
// конкретному возврату или все чеки магазина.
|
||||
// Подробнее о работе со списками: https://yookassa.
|
||||
// ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /receipts
|
||||
ReceiptsGet(ctx context.Context, params ReceiptsGetParams) (ReceiptsGetRes, error)
|
||||
// ReceiptsPost implements POST /receipts operation.
|
||||
//
|
||||
// Используйте этот запрос при оплате с соблюдением
|
||||
// требований 54-ФЗ: https://yookassa.
|
||||
// ru/developers/payment-acceptance/receipts/54fz/basics, чтобы создать чек
|
||||
// зачета предоплаты. Если вы работаете по сценарию
|
||||
// Сначала платеж, потом чек: https://yookassa.
|
||||
// ru/developers/payment-acceptance/receipts/54fz/other-services/basics#receipt-after-payment, в
|
||||
// запросе также нужно передавать данные для
|
||||
// формирования чека прихода и чека возврата прихода.
|
||||
//
|
||||
// POST /receipts
|
||||
ReceiptsPost(ctx context.Context, req PostReceiptData, params ReceiptsPostParams) (ReceiptsPostRes, error)
|
||||
// ReceiptsReceiptIDGet implements GET /receipts/{receipt_id} operation.
|
||||
//
|
||||
// Запрос позволяет получить информацию о текущем
|
||||
// состоянии чека по его уникальному идентификатору.
|
||||
//
|
||||
// GET /receipts/{receipt_id}
|
||||
ReceiptsReceiptIDGet(ctx context.Context, params ReceiptsReceiptIDGetParams) (ReceiptsReceiptIDGetRes, error)
|
||||
// RefundsGet implements GET /refunds operation.
|
||||
//
|
||||
// Use this request to get a list of refunds. You can download refunds created over the last 3 years.
|
||||
// You can filter the list by specified criteria. More about working with lists: https://yookassa.
|
||||
// ru/developers/using-api/lists.
|
||||
//
|
||||
// GET /refunds
|
||||
RefundsGet(ctx context.Context, params RefundsGetParams) (RefundsGetRes, error)
|
||||
// RefundsPost implements POST /refunds operation.
|
||||
//
|
||||
// Создает возврат успешного платежа на указанную сумму.
|
||||
// Платеж можно вернуть только в течение трех лет с
|
||||
// момента его создания: https://yookassa.ru/developers/api#create_payment.
|
||||
// Комиссия ЮKassa за проведение платежа не возвращается.
|
||||
//
|
||||
// POST /refunds
|
||||
RefundsPost(ctx context.Context, req *RefundsPostReq, params RefundsPostParams) (RefundsPostRes, error)
|
||||
// RefundsRefundIDGet implements GET /refunds/{refund_id} operation.
|
||||
//
|
||||
// Запрос позволяет получить информацию о текущем
|
||||
// состоянии возврата по его уникальному
|
||||
// идентификатору.
|
||||
//
|
||||
// GET /refunds/{refund_id}
|
||||
RefundsRefundIDGet(ctx context.Context, params RefundsRefundIDGetParams) (RefundsRefundIDGetRes, error)
|
||||
// SbpBanksGet implements GET /sbp_banks operation.
|
||||
//
|
||||
// С помощью этого запроса вы можете получить
|
||||
// актуальный список всех участников СБП. Список нужно
|
||||
// вывести получателю выплаты, идентификатор
|
||||
// выбранного участника СБП необходимо использовать в
|
||||
// запросе на создание выплаты: https://yookassa.
|
||||
// ru/developers/api#create_payout. Подробнее о выплатах через СБП:
|
||||
// https://yookassa.ru/developers/payouts/making-payouts/sbp.
|
||||
//
|
||||
// GET /sbp_banks
|
||||
SbpBanksGet(ctx context.Context) (SbpBanksGetRes, error)
|
||||
// WebhooksGet implements GET /webhooks operation.
|
||||
//
|
||||
// Запрос позволяет узнать, какие webhook есть для
|
||||
// переданного OAuth-токена.
|
||||
//
|
||||
// GET /webhooks
|
||||
WebhooksGet(ctx context.Context) (WebhooksGetRes, error)
|
||||
// WebhooksPost implements POST /webhooks operation.
|
||||
//
|
||||
// Запрос позволяет подписаться на уведомления о
|
||||
// событиях: https://yookassa.ru/developers/using-api/webhooks#events (например,
|
||||
// переход платежа в статус succeeded). C помощью webhook можно
|
||||
// подписаться только на события платежей и возвратов.
|
||||
// Если вы хотите получать уведомления о нескольких
|
||||
// событиях, вам нужно для каждого из них создать свой
|
||||
// webhook. Для каждого OAuth-токена нужно создавать свой
|
||||
// набор webhook.
|
||||
//
|
||||
// POST /webhooks
|
||||
WebhooksPost(ctx context.Context, req *WebhooksPostReq, params WebhooksPostParams) (WebhooksPostRes, error)
|
||||
// WebhooksWebhookIDDelete implements DELETE /webhooks/{webhook_id} operation.
|
||||
//
|
||||
// Запрос позволяет отписаться от уведомлений о событии
|
||||
// для переданного OAuth-токена. Чтобы удалить webhook, вам
|
||||
// нужно передать в запросе его идентификатор.
|
||||
//
|
||||
// DELETE /webhooks/{webhook_id}
|
||||
WebhooksWebhookIDDelete(ctx context.Context, params WebhooksWebhookIDDeleteParams) (WebhooksWebhookIDDeleteRes, error)
|
||||
}
|
||||
|
||||
// Server implements http server based on OpenAPI v3 specification and
|
||||
// calls Handler to handle requests.
|
||||
type Server struct {
|
||||
h Handler
|
||||
sec SecurityHandler
|
||||
baseServer
|
||||
}
|
||||
|
||||
// NewServer creates new Server.
|
||||
func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error) {
|
||||
s, err := newServerConfig(opts...).baseServer()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Server{
|
||||
h: h,
|
||||
sec: sec,
|
||||
baseServer: s,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user