45 lines
2.6 KiB
Go
45 lines
2.6 KiB
Go
package yandex
|
|
|
|
// Payment description https://yookassa.ru/developers/api#payment_object
|
|
type Payment struct {
|
|
ID string `json:"id" bson:"id"`
|
|
Status PaymentStatus `json:"status" bson:"status"`
|
|
Amount Amount `json:"amount" bson:"amount"`
|
|
Confirmation *ConfirmationRedirect `json:"confirmation" bson:"confirmation"`
|
|
IncomeAmount *Amount `json:"income_amount,omitempty" bson:"income_amount,omitempty"`
|
|
Description string `json:"description,omitempty" bson:"description,omitempty"`
|
|
PaymentMethod any `json:"payment_method,omitempty" bson:"payment_method,omitempty"`
|
|
Recipient Recipient `json:"recipient" bson:"recipient"`
|
|
CapturedAt string `json:"captured_at,omitempty" bson:"captured_at,omitempty"`
|
|
ExpiresAt string `json:"expires_at,omitempty" bson:"expires_at,omitempty"`
|
|
CreatedAt string `json:"created_at" bson:"created_at"`
|
|
IsTest bool `json:"test" bson:"test"`
|
|
RefundedAmount *Amount `json:"refunded_amount,omitempty" bson:"refunded_amount,omitempty"`
|
|
IsPaid bool `json:"paid" bson:"paid"`
|
|
IsRefundable bool `json:"refundable" bson:"refundable"`
|
|
ReceiptRegistration string `json:"receipt_registration,omitempty" bson:"receipt_registration,omitempty"`
|
|
Metadata any `json:"metadata,omitempty" bson:"metadata,omitempty"`
|
|
CancellationDetails any `json:"cancellation_details,omitempty" bson:"cancellation_details,omitempty"`
|
|
AuthorizationDetails any `json:"authorization_details,omitempty" bson:"authorization_details,omitempty"`
|
|
Transfers []any `json:"transfers,omitempty" bson:"transfers,omitempty"`
|
|
Deal any `json:"deal,omitempty" bson:"deal,omitempty"`
|
|
MerchantCustomerID string `json:"merchant_customer_id,omitempty" bson:"merchant_customer_id,omitempty"`
|
|
}
|
|
|
|
type Recipient struct {
|
|
AccountID string `json:"account_id" bson:"account_id"`
|
|
GatewayID string `json:"gateway_id" bson:"gateway_id"`
|
|
}
|
|
|
|
type Confirmation struct {
|
|
}
|
|
|
|
type PaymentStatus string
|
|
|
|
const (
|
|
PaymentStatusPending PaymentStatus = "pending"
|
|
PaymentStatusWaiting PaymentStatus = "waiting_for_capture"
|
|
PaymentStatusSuccessfully PaymentStatus = "succeeded"
|
|
PaymentStatusCanceled PaymentStatus = "canceled"
|
|
)
|