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:
@@ -30,7 +30,7 @@ const orderTypeSber = "sber"
|
||||
|
||||
const paymentReturningColumns = `id, order_id, order_number, payment_period, exchange_rate_usd, exchange_rate_rub, amount_tmt,
|
||||
bank_fee_tmt, gbus_fee_tmt, tveb_fee_usd, tveb_fee_tmt, total_amount_tmt,
|
||||
gateway_status, gateway_reference, created_at, updated_at`
|
||||
gateway_status, gateway_reference, gateway_response, created_at, updated_at`
|
||||
|
||||
type repository struct {
|
||||
client postgresql.Client
|
||||
@@ -685,10 +685,13 @@ func scanPayment(row pgx.Row) (visamasterpay.PaymentResultDTO, error) {
|
||||
if err := row.Scan(
|
||||
&item.Id, &item.OrderId, &item.OrderNumber, &item.PaymentPeriod, &item.ExchangeRateUsd, &item.ExchangeRateRub, &item.AmountTmt,
|
||||
&item.BankFeeTmt, &item.GbusFeeTmt, &item.TvebFeeUsd, &item.TvebFeeTmt, &item.TotalAmountTmt,
|
||||
&item.GatewayStatus, &item.GatewayReference, &item.CreatedAt, &item.UpdatedAt,
|
||||
&item.GatewayStatus, &item.GatewayReference, &item.GatewayResponse, &item.CreatedAt, &item.UpdatedAt,
|
||||
); err != nil {
|
||||
return visamasterpay.PaymentResultDTO{}, err
|
||||
}
|
||||
if len(item.GatewayResponse) == 0 {
|
||||
item.GatewayResponse = json.RawMessage("null")
|
||||
}
|
||||
return item, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user