2025-05-17 11:36:26 -04:00

41 lines
1.4 KiB
Go

package api2
import (
"encoding/xml"
)
// TransactionRequest es la solicitud para procesar una transacción
type TransactionRequest struct {
XMLName xml.Name `xml:"TransactionRequest"`
Namespace string `xml:"xmlns,attr,omitempty"`
TransactionID string `xml:"TransactionId,omitempty"`
AccountID string `xml:"AccountId,omitempty"`
Amount float64 `xml:"Amount,omitempty"`
Currency string `xml:"Currency,omitempty"`
Description string `xml:"Description,omitempty"`
// Otros campos según sea necesario
}
// TransactionResponse es la respuesta para una solicitud de transacción
type TransactionResponse struct {
XMLName xml.Name `xml:"TransactionResponse"`
ResultCode string `xml:"ResultCode,omitempty"`
ResultMessage string `xml:"ResultMessage,omitempty"`
TransactionID string `xml:"TransactionId,omitempty"`
ConfirmationCode string `xml:"ConfirmationCode,omitempty"`
Timestamp string `xml:"Timestamp,omitempty"`
// Otros campos según sea necesario
}
// TransactionSoapRequest envuelve la solicitud para SOAP
type TransactionSoapRequest struct {
XMLName xml.Name `xml:"api2:ProcessTransaction"`
Request TransactionRequest `xml:",omitempty"`
}
// TransactionSoapResponse envuelve la respuesta para SOAP
type TransactionSoapResponse struct {
XMLName xml.Name `xml:"ProcessTransactionResponse"`
Response TransactionResponse `xml:",omitempty"`
}