-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_credit_card.go
32 lines (28 loc) · 1.08 KB
/
add_credit_card.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
package transactapi
import (
"net/http"
)
type AddCreditCardRequest struct {
ClientID string `json:"clientID"`
DeveloperAPIKey string `json:"developerAPIKey"`
AccountID string `json:"accountId"`
CreditCardName string `json:"creditCardName"`
CreditCardNumber string `json:"creditCardNumber"`
ExpirationDate string `json:"expirationDate"`
CvvNumber string `json:"cvvNumber"`
CardType string `json:"cardType"`
CreatedIpAddress string `json:"createdIpAddress"`
}
type AddCreditCardResponse struct {
StatusCode string `json:"statusCode"`
StatusDesc string `json:"statusDesc"`
CreditCardDetails string `json:"creditcardDetails"`
}
// AddCreditCard is used to save a credit card to an Account (createAccount).
//
// Only one credit card can be added for each account.
//
// Reference: https://transactapi.readme.io/reference/addcreditcard
func (c *Client) AddCreditCard(req *AddCreditCardRequest) (*AddCreditCardResponse, error) {
return request[AddCreditCardRequest, AddCreditCardResponse](c, http.MethodPost, EndpointAddCreditCard, req)
}