Documentation
¶
Index ¶
- type CardType
- type Client
- func (c *Client) Create(ctx context.Context, body Create) (*Customer, error)
- func (c *Client) DeactivatePaymentInstrument(ctx context.Context, customerID string, token string) error
- func (c *Client) Get(ctx context.Context, customerID string) (*Customer, error)
- func (c *Client) ListPaymentInstruments(ctx context.Context, customerID string) (*ListPaymentInstruments200Response, error)
- func (c *Client) Update(ctx context.Context, customerID string, body Update) (*Customer, error)
- type Create
- type Customer
- type ListPaymentInstruments200Response
- type MandateResponse
- type PaymentInstrumentResponse
- type PaymentInstrumentResponseCard
- type PaymentInstrumentResponseType
- type PersonalDetails
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.13.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Create ¶ added in v0.13.0
Creates a new saved customer resource which you can later manipulate and save payment instruments to.
func (*Client) DeactivatePaymentInstrument ¶ added in v0.13.0
func (c *Client) DeactivatePaymentInstrument(ctx context.Context, customerID string, token string) error
Deactivates an identified card payment instrument resource for a customer.
func (*Client) Get ¶ added in v0.13.0
Retrieves an identified saved customer resource through the unique `customer_id` parameter, generated upon customer creation.
func (*Client) ListPaymentInstruments ¶ added in v0.13.0
func (c *Client) ListPaymentInstruments(ctx context.Context, customerID string) (*ListPaymentInstruments200Response, error)
Lists all payment instrument resources that are saved for an identified customer.
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 ListPaymentInstruments200Response ¶
type ListPaymentInstruments200Response []PaymentInstrumentResponse
ListPaymentInstruments200Response is a schema definition.
type MandateResponse ¶ added in v0.13.0
type MandateResponse = shared.MandateResponse
Created mandate
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 PersonalDetails ¶ added in v0.13.0
type PersonalDetails = shared.PersonalDetails
Personal details for the customer.
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.