Documentation
¶
Index ¶
- type Create
- type Customer
- type CustomersService
- func (s *CustomersService) Create(ctx context.Context, body Create) (*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 Update) (*Customer, error)
- type ListPaymentInstruments200Response
- type PaymentInstrumentResponse
- type PaymentInstrumentResponseCard
- type PaymentInstrumentResponseType
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Create ¶ added in v0.12.0
type Create struct {
// Unique ID of the customer.
CustomerID string `json:"customer_id"`
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}
Create 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 ¶
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
Deactivates an identified card payment instrument resource for a customer.
func (*CustomersService) Get ¶
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)
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 Update) (*Customer, error)
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"`
}
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"`
}
Details of the payment card.
type PaymentInstrumentResponseType ¶
type PaymentInstrumentResponseType string
Type of the payment instrument.
const (
PaymentInstrumentResponseTypeCard PaymentInstrumentResponseType = "card"
)
type Update ¶ added in v0.12.0
type Update struct {
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}
Update is a schema definition.