visamasterpay: return gatewayResponse from GET /{id}/status
The status check now carries GBÜS's last stored response for the attempt alongside gatewayStatus - the fresh getOrderStatusExtended.do answer when it was just checked, the stored one when the attempt was already finalized, null if GBÜS never answered. The callback is unchanged: it is public and only reports paid plus a message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
570d4c6d20
commit
742e078090
6 files changed
+42
-26
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package visamasterpay
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"online-back/internal/shared"
|
||||
@@ -69,25 +70,28 @@ type CallbackResultDTO struct {
|
||||
// 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).
|
||||
// separately via GET /visa-master-payment-orders/:id). GatewayResponse is
|
||||
// the last GBÜS response stored for the attempt (null if GBÜS never
|
||||
// answered).
|
||||
type PaymentResultDTO struct {
|
||||
Id int64 `json:"id"`
|
||||
OrderId int64 `json:"orderId"`
|
||||
OrderNumber string `json:"orderNumber"`
|
||||
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"`
|
||||
Id int64 `json:"id"`
|
||||
OrderId int64 `json:"orderId"`
|
||||
OrderNumber string `json:"orderNumber"`
|
||||
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"`
|
||||
GatewayResponse json.RawMessage `json:"gatewayResponse" swaggertype:"object"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
Reference in new issue
Block a user