-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_credit_card.go
32 lines (27 loc) · 1.07 KB
/
get_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 GetCreditCardRequest struct {
ClientID string `json:"clientID"`
DeveloperApiKey string `json:"developerAPIKey"`
AccountID string `json:"accountId"`
}
type GetCreditCardResponse struct {
StatusCode string `json:"statusCode"`
StatusDesc string `json:"statusDesc"`
CreditcardDetails creditcardDetails `json:"creditcardDetails"`
}
type creditcardDetails struct {
AccountID string `json:"accountId"`
CreditCardName string `json:"creditCardName"`
CreditCardNumber string `json:"creditCardNumber"`
ExpirationDate string `json:"expirationDate"`
CvvNumber string `json:"cvvNumber"`
}
// This method is used to retrieve the credit card information that was previously saved to a specific account.
//
// Reference: https://transactapi.readme.io/reference/getcreditcard
func (c *Client) GetCreditCard(req *GetCreditCardRequest) (*GetCreditCardResponse, error) {
return request[GetCreditCardRequest, GetCreditCardResponse](c, http.MethodPost, EndpointGetCreditCard, req)
}