customer/internal/models/payment.go

51 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package models
type GetPaymentLinkBody struct {
Type PaymentType `json:"type"`
Currency string `json:"currency"`
Amount int64 `json:"amount"`
ReturnURL string `json:"returnUrl,omitempty"`
PhoneNumber string `json:"phoneNumber,omitempty"`
Login string `json:"login,omitempty"`
BankCard *BankCard `json:"bankCard,omitempty"`
}
type GetPaymentLinkRequest struct {
Body *GetPaymentLinkBody
ClientIP string
UserID string
}
type GetPaymentLinkResponse struct {
Link string `json:"link"`
}
type BankCard struct {
Number string `json:"number"`
ExpiryYear string `json:"expiryYear"`
ExpiryMonth string `json:"expiryMonth"`
CSC *string `json:"csc,omitempty"`
CardHolderName *string `json:"cardholder,omitempty"`
}
type PaymentType string
const (
PaymentTypeBankCard PaymentType = "bank_сard"
PaymentTypeTinkoff PaymentType = "tinkoffBank"
PaymentTypeSberPay PaymentType = "sberbank"
PaymentTypeYoomoney PaymentType = "yoomoney"
PaymentTypeSBP PaymentType = "sbp"
PaymentTypeSberB2B PaymentType = "b2bSberbank"
)
type PaymentEvent struct {
Key string
Message string
PaymentID string
UserID string
Currency string
Type string
Amount int64
}