Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient is a concrete implmentation of an HTTP client which can communicate with the payments service
func NewHTTP ¶
func NewHTTP(baseURL string) *HTTPClient
func (*HTTPClient) HealthCheck ¶ added in v0.0.7
func (h *HTTPClient) HealthCheck() bool
HealthCheck checks whether the payments API is up
func (*HTTPClient) MakePayment ¶
func (h *HTTPClient) MakePayment(details *models.PaymentDetails) (*models.PaymentResponse, error)
MakePayment calls the payments api
type HealthCheckResponse ¶ added in v0.0.7
type HealthCheckResponse struct {
Status string `json:"status"`
}
type PaymentRequest ¶
type PaymentRequest struct { Name string `json:"name"` Type string `json:"type"` Number string `json:"number"` Expiry string `json:"expiry"` CVC string `json:"cvc"` // contains filtered or unexported fields }
PaymentRequest defines the JSON request for the Payments API
func (*PaymentRequest) FromModel ¶
func (pr *PaymentRequest) FromModel(m *models.PaymentDetails)
FromModel converts a graphql model into a payment request
type PaymentResponse ¶
type PaymentResponse struct { ID string `json:"id"` Message string `json:"message"` CardPlaintext string `json:"card_plaintext"` CardCiphertext string `json:"card_ciphertext"` }
func (*PaymentResponse) ToModel ¶
func (pr *PaymentResponse) ToModel(m *models.PaymentResponse)
ToModel converts a go Struct into a payment response model
Click to show internal directories.
Click to hide internal directories.