Documentation
¶
Index ¶
- type CreateCustomerBody
- type Customer
- type CustomersService
- func (s *CustomersService) Create(ctx context.Context, body CreateCustomerBody) (*Customer, error)
- func (s *CustomersService) DeactivatePaymentInstrument(ctx context.Context, customerID string, token string) error
- func (s *CustomersService) Get(ctx context.Context, customerID string) (*Customer, error)
- func (s *CustomersService) ListPaymentInstruments(ctx context.Context, customerID string) (*ListPaymentInstruments200Response, error)
- func (s *CustomersService) Update(ctx context.Context, customerID string, body UpdateCustomerBody) (*Customer, error)
- type ListPaymentInstruments200Response
- type PaymentInstrumentResponse
- type PaymentInstrumentResponseCard
- type PaymentInstrumentResponseType
- type UpdateCustomerBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateCustomerBody ¶
type CreateCustomerBody struct {
// Unique ID of the customer.
CustomerID string `json:"customer_id"`
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}
CreateCustomerBody is a schema definition.
type Customer ¶
type Customer struct {
// Unique ID of the customer.
CustomerID string `json:"customer_id"`
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}
Customer is a schema definition.
type CustomersService ¶
type CustomersService struct {
// contains filtered or unexported fields
}
func NewCustomersService ¶
func NewCustomersService(c *client.Client) *CustomersService
func (*CustomersService) Create ¶
func (s *CustomersService) Create(ctx context.Context, body CreateCustomerBody) (*Customer, error)
Create: Create a customer Creates a new saved customer resource which you can later manipulate and save payment instruments to.
func (*CustomersService) DeactivatePaymentInstrument ¶
func (s *CustomersService) DeactivatePaymentInstrument(ctx context.Context, customerID string, token string) error
DeactivatePaymentInstrument: Deactivate a payment instrument Deactivates an identified card payment instrument resource for a customer.
func (*CustomersService) Get ¶
Get: Retrieve a customer Retrieves an identified saved customer resource through the unique `customer_id` parameter, generated upon customer creation.
func (*CustomersService) ListPaymentInstruments ¶
func (s *CustomersService) ListPaymentInstruments(ctx context.Context, customerID string) (*ListPaymentInstruments200Response, error)
ListPaymentInstruments: List payment instruments Lists all payment instrument resources that are saved for an identified customer.
func (*CustomersService) Update ¶
func (s *CustomersService) Update(ctx context.Context, customerID string, body UpdateCustomerBody) (*Customer, error)
Update: Update a customer Updates an identified saved customer resource's personal details.
The request only overwrites the parameters included in the request, all other parameters will remain with their initially assigned values.
type ListPaymentInstruments200Response ¶
type ListPaymentInstruments200Response []PaymentInstrumentResponse
ListPaymentInstruments200Response is a schema definition.
type PaymentInstrumentResponse ¶
type PaymentInstrumentResponse struct {
// Indicates whether the payment instrument is active and can be used for payments. To deactivate it, send a
// `DELETE` request to the resource endpoint.
// Read only
// Default: true
Active *bool `json:"active,omitempty"`
// Details of the payment card.
Card *PaymentInstrumentResponseCard `json:"card,omitempty"`
// Creation date of payment instrument. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
CreatedAt *time.Time `json:"created_at,omitempty"`
// Created mandate
Mandate *shared.MandateResponse `json:"mandate,omitempty"`
// Unique token identifying the saved payment card for a customer.
// Read only
Token *string `json:"token,omitempty"`
// Type of the payment instrument.
Type *PaymentInstrumentResponseType `json:"type,omitempty"`
}
PaymentInstrumentResponse: Payment Instrument Response
type PaymentInstrumentResponseCard ¶
type PaymentInstrumentResponseCard struct {
// Last 4 digits of the payment card number.
// Read only
// Min length: 4
// Max length: 4
Last4Digits *string `json:"last_4_digits,omitempty"`
// Issuing card network of the payment card used for the transaction.
Type *shared.CardType `json:"type,omitempty"`
}
PaymentInstrumentResponseCard: Details of the payment card.
type PaymentInstrumentResponseType ¶
type PaymentInstrumentResponseType string
PaymentInstrumentResponseType: Type of the payment instrument.
const (
PaymentInstrumentResponseTypeCard PaymentInstrumentResponseType = "card"
)
type UpdateCustomerBody ¶
type UpdateCustomerBody struct {
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}
UpdateCustomerBody is a schema definition.