-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_external_account.go
47 lines (41 loc) · 1.83 KB
/
create_external_account.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package transactapi
import (
"net/http"
)
type CreateExternalAccountRequest struct {
ClientID string `json:"clientID"`
DeveloperAPIKey string `json:"developerAPIKey"`
Types string `json:"types"`
AccountID string `json:"accountId"`
ExtAccountfullname string `json:"ExtAccountfullname"`
Extnickname string `json:"Extnickname"`
ExtRoutingnumber string `json:"ExtRoutingnumber"`
ExtAccountnumber string `json:"ExtAccountnumber"`
UpdatedIPAddress string `json:"updatedIpAddress"`
}
type CreateExternalAccountResponse struct {
StatusCode string `json:"statusCode"`
StatusDesc string `json:"statusDesc"`
ExternalAccountDetails []externalAccountDetailElement
}
type externalAccountDetailElement struct {
Bool *bool
ExternalAccountDetailClass *externalAccountDetailClass
}
type externalAccountDetailClass struct {
AccountID string `json:"accountId"`
EXTAccountfullname string `json:"ExtAccountfullname"`
Extnickname string `json:"Extnickname"`
ExtRoutingnumber string `json:"ExtRoutingnumber"`
ExtAccountnumber string `json:"ExtAccountnumber"`
AccountType string `json:"accountType"`
Types string `json:"types"`
}
// This method is used to add information to an Account (createAccount) for an external bank
// account which an ACH transfer can be initiated from. Only one external account can be created
// for an account. External accounts can have funds debited from them (externalFundMove).
//
// Reference: https://transactapi.readme.io/reference/createexternalaccount
func (c *Client) CreateExternalAccount(req *CreateExternalAccountRequest) (*CreateExternalAccountResponse, error) {
return request[CreateExternalAccountRequest, CreateExternalAccountResponse](c, http.MethodPost, EndpointCreateExternalAccount, req)
}