Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions transaction_reporting.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ func (r UnsettledTransactionListResponse) List() []Transaction {
}

func (r *GetTransactionListResponse) List() []Transaction {
return r.GetTransactionList.Transactions.Transaction
return r.Transactions
}

func (r *GetTransactionListResponse) Count() int {
return r.GetTransactionList.TotalNumInResultSet
return r.TotalNumInResultSet
}

func (r Range) Transactions() (*GetTransactionListResponse, error) {
Expand All @@ -77,7 +77,7 @@ func (r Range) Transactions() (*GetTransactionListResponse, error) {
}
response, err := SendRequest(jsoned)
var dat GetTransactionListResponse
json.Unmarshal(response, &dat)
err = json.Unmarshal(response, &dat)
return &dat, err
}

Expand Down Expand Up @@ -169,16 +169,14 @@ type GetTransactionList struct {
}

type GetTransactionListResponse struct {
GetTransactionList struct {
MessagesResponse
Transactions Transactions `json:"transactions"`
TotalNumInResultSet int `json:"totalNumInResultSet"`
} `json:"getTransactionListResponse"`
MessagesResponse
Transactions []Transaction `json:"transactions"`
TotalNumInResultSet int `json:"totalNumInResultSet"`
}

type Transactions struct {
Transaction []Transaction `json:"transaction"`
}
//type Transactions struct {
// Transaction []Transaction `json:"transaction"`
//}

type Transaction struct {
TransID string `json:"transId"`
Expand Down Expand Up @@ -216,6 +214,8 @@ type TransactionDetailsResponse struct {
}

type FullTransaction struct {
//artificially introduced. Never filled by AuthNet
PaymentType string
TransID string `json:"transId"`
SubmitTimeUTC time.Time `json:"submitTimeUTC"`
SubmitTimeLocal string `json:"submitTimeLocal"`
Expand All @@ -234,7 +234,8 @@ type FullTransaction struct {
SettlementState string `json:"settlementState"`
} `json:"batch"`
Order struct {
InvoiceNumber string `json:"invoiceNumber"`
InvoiceNumber string `json:"invoiceNumber"`
InvoiceDescription string `json:"description"`
} `json:"order"`
RequestedAmountSpecified bool `json:"requestedAmountSpecified"`
AuthAmount float64 `json:"authAmount"`
Expand All @@ -249,10 +250,15 @@ type FullTransaction struct {
RoutingNumber string `json:"routingNumber"`
AccountNumber string `json:"accountNumber"`
NameOnAccount string `json:"nameOnAccount"`
EcheckType int `json:"echeckType"`
EcheckType string `json:"echeckType"`
EcheckTypeSpecified bool `json:"echeckTypeSpecified"`
BankName interface{} `json:"bankName"`
} `json:"bankAccount"`
} `json:"bankAccount,omitempty"`
CreditCard struct {
CardNumber string `json:"cardNumber"`
ExpirationDate string `json:"expirationDate"`
CardType string `json:"cardType"`
} `json:"creditCard,omitempty"`
} `json:"payment"`
RecurringBilling bool `json:"recurringBilling"`
RecurringBillingSpecified bool `json:"recurringBillingSpecified"`
Expand All @@ -263,6 +269,14 @@ type FullTransaction struct {
Code string `json:"code"`
Description string `json:"description"`
} `json:"returnedItems"`
Customer struct {
Type string `json:"type"`
Id string `json:"id"`
Email string `json:"email"`
} `json:"customer"`
BillTo struct {
Company string `json:"company,omitempty"`
} `json:"billTo"`
}

type GetUnsettledBatchTransactionListRequest struct {
Expand Down