diff --git a/api/account.go b/api/account.go index e3d7b07..5fd134a 100644 --- a/api/account.go +++ b/api/account.go @@ -54,15 +54,3 @@ func (c *Call) GetVirtualAccountTransaction(ctx context.Context, txID string) (* } return response, err } - -// GetAccunts makes the request to get a virtual account transaction on by its ID -func (c *Call) GetAccounts(ctx context.Context, txID string) (*model.Transaction, error) { - response := &model.Transaction{} - - //path := fmt.Sprintf("/virtual-accounts/transactions/%s", txID) - err := c.makeRequest(ctx, http.MethodGet, "/accounts\n", nil, response) - if err != nil { - return nil, err - } - return response, err -} diff --git a/main.go b/main.go index 240186f..8f5ecb7 100644 --- a/main.go +++ b/main.go @@ -63,6 +63,7 @@ func main() { //logger.Info().Interface("response", vendors).Msg("success") /* + // ---------------GetBillVendorByID--------------- vendor, err := api.GetBillVendorByID(ctx, "f46c9b9f-ddc1-4466-9cf2-dda59d18b84f") if err != nil { @@ -74,6 +75,7 @@ func main() { */ /* + // ---------------GetBillProducts--------------- products, err := api.GetBillProducts(ctx, "", "") if err != nil { @@ -153,11 +155,21 @@ func main() { // //Start: "2021-01-01", // //End: "2023-07-23" //}) - //if err != nil { // logger.Err(err).Msg("failed") // return //} //logger.Info().Interface("response", bills).Msg("success") + // + //fmt.Printf("-----------%v--------", len(bills)) + // ---------------GetVirtualAccountTransaction--------------- + /* + virtualAccTrx, err := api.GetVirtualAccountTransaction(context.Background(), "72754087-7caa-4a57-9e77-d8b22c89e799") + if err != nil { + logger.Err(err).Msg("failed") + return + } + logger.Info().Interface("response", virtualAccTrx).Msg("success") + */ } diff --git a/model/account.go b/model/account.go index bcc4d9a..c0f66f0 100644 --- a/model/account.go +++ b/model/account.go @@ -48,8 +48,8 @@ type ( const ( // VirtualAccountTypeStatic string representation of static virtual account VirtualAccountTypeStatic VirtualAccountType = "Static Virtual Account" - // DynamicAccountTypeStatic string representation of dynamic virtual account - DynamicAccountTypeStatic VirtualAccountType = "Dynamic Virtual Account" + // VirtualAccountTypeDynamic string representation of dynamic virtual account + VirtualAccountTypeDynamic VirtualAccountType = "Dynamic Virtual Account" // StatusActive string StatusActive = "active" diff --git a/model/transaction.go b/model/transaction.go index 6c6393b..d3b44fd 100644 --- a/model/transaction.go +++ b/model/transaction.go @@ -3,21 +3,21 @@ package model type ( // Transaction object schema Transaction struct { - ID string `json:"id"` - Amount string `json:"amount"` - Fee string `json:"fee"` - Narration string `json:"narration"` - Type string `json:"type"` - InitiatedAt *string `json:"initiatedAt,omitempty"` - CompletedAt *string `json:"completedAt,omitempty"` - FailedAt *string `json:"failedAt,omitempty"` - AccountID string `json:"accountId"` - Details *BankAccount `json:"details,omitempty"` - VirtualAccount *VirtualAccount `json:"virtualAccount,omitempty"` - Status string `json:"status"` - ReasonForFailure string `json:"reasonForFailure"` - ClientReference string `json:"clientReference"` - TransactionReference string `json:"transactionReference"` - NipSessionID *string `json:"nipSessionId,omitempty"` + ID string `json:"id" mapstructure:""` + TransactionAmount string `json:"transactionAmount" mapstructure:""` + Fee string `json:"fee" mapstructure:""` + StampDuty string `json:"stampDuty" mapstructure:""` + SettledAmount string `json:"settledAmount" mapstructure:""` + Currency string `json:"currency" mapstructure:""` + Type string `json:"type" mapstructure:""` + Status string `json:"status" mapstructure:""` + Narration string `json:"narration" mapstructure:""` + Details BankAccount `json:"details" mapstructure:""` + VirtualAccount VirtualAccount `json:"virtualAccount" mapstructure:""` + AccountReference string `json:"accountReference" mapstructure:""` + SettledAccountID string `json:"settledAccountId" mapstructure:""` + Datetime string `json:"datetime" mapstructure:""` + NipSessionID string `json:"nipSessionId" mapstructure:""` + TransactionReference string `json:"transactionReference" mapstructure:""` } )