add pay
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

This commit is contained in:
guwandyk committed 2026-09-19 03:54:40 +05:00
1 parent 848a07324f
commit 6c7c402390
16 files changed
+891 -324

No files matched your search

+42 -26
View File
@@ -23,35 +23,51 @@ type PaymentQuoteDTO struct {
MaxAmountTmt float64 `json:"maxAmountTmt"`
}
// PayOrderDTO submits a payout for a visa/master/sber order. AmountTmt is
// optional: if omitted, the full requested amount (amount_usd * rate) is
// paid; if provided (the modal's amount field is editable, capped at the
// max), it's validated against that max instead. PaymentPeriod is
// optional too - only the Visa/Master modal shows a payment-month picker;
// Sber orders default to the current month when omitted.
// PayOrderDTO starts a payout attempt for a visa/master/sber order.
// AmountTmt is optional: if omitted, the full requested amount
// (amount_usd * rate) is used; if provided (the modal's amount field is
// editable, capped at the max), it's validated against that max instead.
// PaymentPeriod is optional too - only the Visa/Master modal shows a
// payment-month picker; Sber orders default to the current month when
// omitted.
type PayOrderDTO struct {
PaymentPeriod *shared.FlexibleTime `json:"paymentPeriod" swaggertype:"string" format:"date"`
AmountTmt *float64 `json:"amountTmt"`
CreatedBy *int64 `json:"-"`
}
// PaymentResultDTO is a flat, payment-focused view of the order's payout
// state — deliberately not the full order+branch+user DTO owned by
// cards/visamaster (fetch that separately via GET /visa-master-payment-orders/:id).
type PaymentResultDTO struct {
OrderId int64 `json:"orderId"`
Type string `json:"type"`
Paid bool `json:"paid"`
AmountUsd float64 `json:"amountUsd"`
ExchangeRateUsd float64 `json:"exchangeRateUsd"`
ExchangeRateRub *float64 `json:"exchangeRateRub,omitempty"`
AmountTmt float64 `json:"amountTmt"`
BankFeeTmt float64 `json:"bankFeeTmt"`
GbusFeeTmt *float64 `json:"gbusFeeTmt,omitempty"`
TvebFeeUsd *float64 `json:"tvebFeeUsd,omitempty"`
TvebFeeTmt *float64 `json:"tvebFeeTmt,omitempty"`
TotalAmountTmt float64 `json:"totalAmountTmt"`
PaymentPeriod *time.Time `json:"paymentPeriod,omitempty"`
GatewayStatus string `json:"gatewayStatus"`
GatewayReference *string `json:"gatewayReference,omitempty"`
PaidAt *time.Time `json:"paidAt,omitempty"`
// PaymentInitResultDTO is the immediate result of starting a payout:
// GBÜS only registers the payment and hands back a hosted-payment-page URL
// - the customer (or the operator, in-branch) must complete payment there.
// The definitive outcome only becomes known once GBÜS redirects back to
// our callback, which verifies and finalizes it - see PaymentResultDTO.
type PaymentInitResultDTO struct {
PaymentId int64 `json:"paymentId"`
FormUrl string `json:"formUrl"`
}
// PaymentResultDTO is one payout attempt's final, verified state, recorded
// as its own row in visa_master_order_payments (a full audit trail -
// failed attempts are kept, not overwritten by a retry) - deliberately not
// the full order+branch+user DTO owned by cards/visamaster (fetch that
// separately via GET /visa-master-payment-orders/:id).
type PaymentResultDTO struct {
Id int64 `json:"id"`
OrderId int64 `json:"orderId"`
Type string `json:"type"`
Paid bool `json:"paid"`
AmountUsd float64 `json:"amountUsd"`
ExchangeRateUsd float64 `json:"exchangeRateUsd"`
ExchangeRateRub *float64 `json:"exchangeRateRub,omitempty"`
AmountTmt float64 `json:"amountTmt"`
BankFeeTmt float64 `json:"bankFeeTmt"`
GbusFeeTmt *float64 `json:"gbusFeeTmt,omitempty"`
TvebFeeUsd *float64 `json:"tvebFeeUsd,omitempty"`
TvebFeeTmt *float64 `json:"tvebFeeTmt,omitempty"`
TotalAmountTmt float64 `json:"totalAmountTmt"`
PaymentPeriod time.Time `json:"paymentPeriod"`
GatewayStatus string `json:"gatewayStatus"`
GatewayReference *string `json:"gatewayReference,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}