<commit_before>package erede

import (
	"encoding/xml"
)

const (
	RStatSuccess                       = 1
	RStatSocketWriteError              = 2
	RStatTimeout                       = 3
	RStatEditError                     = 5
	RStatCommsError                    = 6
	RStatUnauthorized                  = 7
	RStatCurrencyError                 = 9
	RStatAuthError                     = 10
	RStatInvalidAuthCode               = 12
	RStatTypeFieldMissing              = 13
	RStatDBServerError                 = 14
	RStatInvalidType                   = 15
	RStatCannotFulfillTransaction      = 19
	RStatDuplicateTransactionReference = 20
	RStatInvalidCardType               = 21
	RStatInvalidReference              = 22
	RStatExpiryDateInvalid             = 23
	RStatCardExpired                   = 24
	RStatCardNumberInvalid             = 25
	RStatCardNumberWrongLength         = 26
	RStatIssueNumberError              = 27
	RStatStartDateError                = 28
	RStatCardNotValidYet               = 29
	RStatStartDateAfterExpiryDate      = 30
	//TODO: fill more errors
	RStatCurrencyNotSupportedByCard = 59
	RStatInvalidXML                 = 60
	//TODO: fill more errors
	// 3DS
	RStat3DSPayerVerificationRequired = 150
	RStat3DSInvalidTransactionType    = 151
	RStat3DSManualAuthNotSupported    = 152
	RStat3DSVerifyElmtMissing         = 153
	RStat3DSInvalidVerifyValue        = 154
	RStat3DSFieldMissing              = 155
	RStat3DSInvalidBrowserDeviceCateg = 156
	RStat3DSMerchantNotEnabled        = 157
	RStat3DSSchemeNotSupported        = 158
	RStat3DSVerificationFailed        = 159
	RStat3DSInvalidIssuerResponse     = 160
	RStat3DSAuthFailedCallCentre      = 161
	RStat3DSCardNotEnrolled           = 162
	//TODO: fill more errors
	RStatPaymentGatewayBusy = 440
	//TODO: fill more errors
	RStat3DSRequired               = 471
	RStatInvalidTransactionType    = 473
	RStatInvalidValueForMerchantID = 480
)

const (
	RRejectedServiceUnauthorized = 51
	//TODO: fill more errors
	RRejectedInvalidVendor   = 57
	RRejectedUnauthorized    = 58
	RRejectedInvalidPassword = 65
	//TODO: fill more errors
)

type TransactionResponse struct {
	XMLName         xml.Name        `xml:"Response"`
	Card            TrRespCard      `xml:"Card"`
	CardTxn         TrRespCardTxn   `xml:"CardTxn"`
	BoletoTxn       TrRespBoletoTxn `xml:"BoletoTxn"`
	Acquirer        string          `xml:"acquirer"`
	AuthHostRef     int             `xml:"auth_host_reference"`
	GatewayRef      string          `xml:"gateway_reference"`
	ExtendedRespMsg string          `xml:"extended_response_message"`
	ExtendedStatus  string          `xml:"extended_status"`
	MerchantRef     string          `xml:"merchant_reference"`
	MID             string          `xml:"mid"`
	Mode            string          `xml:"mode"`
	Reason          string          `xml:"reason"`
	Status          int             `xml:"status"`
	Time            int64           `xml:"time"`
}

type QueryResponse struct {
	XMLName        xml.Name `xml:"Response"`
	QueryTxnResult QueryResponseTxnResult
}

type QueryResponseTxnResult struct {
	BoletoTxn   TrRespBoletoTxn
	CardTxn     TrRespCardTxn
	GatewayRef  string `xml:"gateway_reference"`
	MerchantRef string `xml:"merchantreference"`
	Reason      string `xml:"reason"`
	Status      string `xml:"status"`
}

//TODO: CHECK xid, aav, caavAlgorithm, eci
type TrRespThreeDSecure struct {
	AcsURL        string `xml:"acs_url"`
	PareqMessage  string `xml:"pareq_message"`
	XID           string `xml:"xid"`
	AAV           string `xml:"aav"`
	CAVVAlgorithm string `xml:"cavvAlgorithm"`
	ECI           string `xml:"eci"`
}<commit_msg>added query response vars<commit_after>package erede

import (
	"encoding/xml"
)

const (
	RStatSuccess                       = 1
	RStatSocketWriteError              = 2
	RStatTimeout                       = 3
	RStatEditError                     = 5
	RStatCommsError                    = 6
	RStatUnauthorized                  = 7
	RStatCurrencyError                 = 9
	RStatAuthError                     = 10
	RStatInvalidAuthCode               = 12
	RStatTypeFieldMissing              = 13
	RStatDBServerError                 = 14
	RStatInvalidType                   = 15
	RStatCannotFulfillTransaction      = 19
	RStatDuplicateTransactionReference = 20
	RStatInvalidCardType               = 21
	RStatInvalidReference              = 22
	RStatExpiryDateInvalid             = 23
	RStatCardExpired                   = 24
	RStatCardNumberInvalid             = 25
	RStatCardNumberWrongLength         = 26
	RStatIssueNumberError              = 27
	RStatStartDateError                = 28
	RStatCardNotValidYet               = 29
	RStatStartDateAfterExpiryDate      = 30
	//TODO: fill more errors
	RStatCurrencyNotSupportedByCard = 59
	RStatInvalidXML                 = 60
	//TODO: fill more errors
	// 3DS
	RStat3DSPayerVerificationRequired = 150
	RStat3DSInvalidTransactionType    = 151
	RStat3DSManualAuthNotSupported    = 152
	RStat3DSVerifyElmtMissing         = 153
	RStat3DSInvalidVerifyValue        = 154
	RStat3DSFieldMissing              = 155
	RStat3DSInvalidBrowserDeviceCateg = 156
	RStat3DSMerchantNotEnabled        = 157
	RStat3DSSchemeNotSupported        = 158
	RStat3DSVerificationFailed        = 159
	RStat3DSInvalidIssuerResponse     = 160
	RStat3DSAuthFailedCallCentre      = 161
	RStat3DSCardNotEnrolled           = 162
	//TODO: fill more errors
	RStatPaymentGatewayBusy = 440
	//TODO: fill more errors
	RStat3DSRequired               = 471
	RStatInvalidTransactionType    = 473
	RStatInvalidValueForMerchantID = 480
)

const (
	RRejectedServiceUnauthorized = 51
	//TODO: fill more errors
	RRejectedInvalidVendor   = 57
	RRejectedUnauthorized    = 58
	RRejectedInvalidPassword = 65
	//TODO: fill more errors
)

type TransactionResponse struct {
	XMLName         xml.Name        `xml:"Response"`
	Card            TrRespCard      `xml:"Card"`
	CardTxn         TrRespCardTxn   `xml:"CardTxn"`
	BoletoTxn       TrRespBoletoTxn `xml:"BoletoTxn"`
	Acquirer        string          `xml:"acquirer"`
	AuthHostRef     int             `xml:"auth_host_reference"`
	GatewayRef      string          `xml:"gateway_reference"`
	ExtendedRespMsg string          `xml:"extended_response_message"`
	ExtendedStatus  string          `xml:"extended_status"`
	MerchantRef     string          `xml:"merchant_reference"`
	MID             string          `xml:"mid"`
	Mode            string          `xml:"mode"`
	Reason          string          `xml:"reason"`
	Status          int             `xml:"status"`
	Time            int64           `xml:"time"`
}

type QueryResponse struct {
	XMLName        xml.Name `xml:"Response"`
	QueryTxnResult QueryResponseTxnResult
	Mode           string `xml:"mode"`
	Reason         string `xml:"reason"`
	Status         int    `xml:"status"`
	Time           int64  `xml:"time"`
}

type QueryResponseTxnResult struct {
	BoletoTxn   TrRespBoletoTxn
	CardTxn     TrRespCardTxn
	GatewayRef  string `xml:"gateway_reference"`
	MerchantRef string `xml:"merchantreference"`
	Reason      string `xml:"reason"`
	Status      string `xml:"status"`
}

//TODO: CHECK xid, aav, caavAlgorithm, eci
type TrRespThreeDSecure struct {
	AcsURL        string `xml:"acs_url"`
	PareqMessage  string `xml:"pareq_message"`
	XID           string `xml:"xid"`
	AAV           string `xml:"aav"`
	CAVVAlgorithm string `xml:"cavvAlgorithm"`
	ECI           string `xml:"eci"`
}
{'fraction_non_alphanumeric': 0.06368563685636856, 'fraction_numerical': 0.033062330623306234, 'mean_word_length': 2.162382176520994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 62}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3039838', 'n_tokens_mistral': 2444, 'n_tokens_neox': 2191, 'n_words': 469}