customers

package
v0.0.1-beta.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	// City name from the address.
	City *string `json:"city,omitempty"`
	// Two letter country code formatted according to [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
	Country string `json:"country"`
	// First line of the address with details of the street name and number.
	Line1 *string `json:"line_1,omitempty"`
	// Second line of the address with details of the building, unit, apartment, and floor numbers.
	Line2 *string `json:"line_2,omitempty"`
	// Postal code from the address.
	PostalCode *string `json:"postal_code,omitempty"`
	// State name or abbreviation from the address.
	State *string `json:"state,omitempty"`
}

Address: Profile's personal address information.

type CreateCustomerBody

type CreateCustomerBody struct {
	// Unique ID of the customer.
	CustomerId string `json:"customer_id"`
	// Personal details for the customer.
	PersonalDetails *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 *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

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) (*DeactivatePaymentInstrument204Response, error)

DeactivatePaymentInstrument: Deactivate a payment instrument Deactivates an identified card payment instrument resource for a customer.

func (*CustomersService) Get

func (s *CustomersService) Get(ctx context.Context, customerId string) (*Customer, error)

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 DeactivatePaymentInstrument204Response

type DeactivatePaymentInstrument204Response struct {
}

DeactivatePaymentInstrument204Response is a schema definition.

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.
	// Read only
	Type *PaymentInstrumentResponseCardType `json:"type,omitempty"`
}

PaymentInstrumentResponseCard: Details of the payment card.

type PaymentInstrumentResponseCardType

type PaymentInstrumentResponseCardType string

PaymentInstrumentResponseCardType: Issuing card network of the payment card. Read only

const (
	PaymentInstrumentResponseCardTypeAmex         PaymentInstrumentResponseCardType = "AMEX"
	PaymentInstrumentResponseCardTypeCup          PaymentInstrumentResponseCardType = "CUP"
	PaymentInstrumentResponseCardTypeDiners       PaymentInstrumentResponseCardType = "DINERS"
	PaymentInstrumentResponseCardTypeDiscover     PaymentInstrumentResponseCardType = "DISCOVER"
	PaymentInstrumentResponseCardTypeElo          PaymentInstrumentResponseCardType = "ELO"
	PaymentInstrumentResponseCardTypeElv          PaymentInstrumentResponseCardType = "ELV"
	PaymentInstrumentResponseCardTypeHipercard    PaymentInstrumentResponseCardType = "HIPERCARD"
	PaymentInstrumentResponseCardTypeJcb          PaymentInstrumentResponseCardType = "JCB"
	PaymentInstrumentResponseCardTypeMaestro      PaymentInstrumentResponseCardType = "MAESTRO"
	PaymentInstrumentResponseCardTypeMastercard   PaymentInstrumentResponseCardType = "MASTERCARD"
	PaymentInstrumentResponseCardTypeUnknown      PaymentInstrumentResponseCardType = "UNKNOWN"
	PaymentInstrumentResponseCardTypeVisa         PaymentInstrumentResponseCardType = "VISA"
	PaymentInstrumentResponseCardTypeVisaElectron PaymentInstrumentResponseCardType = "VISA_ELECTRON"
	PaymentInstrumentResponseCardTypeVisaVpay     PaymentInstrumentResponseCardType = "VISA_VPAY"
)

type PaymentInstrumentResponseType

type PaymentInstrumentResponseType string

PaymentInstrumentResponseType: Type of the payment instrument.

const (
	PaymentInstrumentResponseTypeCard PaymentInstrumentResponseType = "card"
)

type PersonalDetails added in v0.13.0

type PersonalDetails struct {
	// Profile's personal address information.
	Address *Address `json:"address,omitempty"`
	// Date of birth of the customer.
	// Format: date
	Birthdate *shared.Date `json:"birthdate,omitempty"`
	// Email address of the customer.
	Email *string `json:"email,omitempty"`
	// First name of the customer.
	FirstName *string `json:"first_name,omitempty"`
	// Last name of the customer.
	LastName *string `json:"last_name,omitempty"`
	// Phone number of the customer.
	Phone *string `json:"phone,omitempty"`
}

PersonalDetails: Personal details for the customer.

type UpdateCustomerBody

type UpdateCustomerBody struct {
	// Personal details for the customer.
	PersonalDetails *PersonalDetails `json:"personal_details,omitempty"`
}

UpdateCustomerBody is a schema definition.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL