Documentation
¶
Index ¶
- type Customer
- type CustomerAPI
- func (api *CustomerAPI) Get(id string) (*Customer, error)
- func (api *CustomerAPI) List(offset, limit uint64) (*ListCustomersResponse, error)
- func (api *CustomerAPI) New(data NewCustomerData) (*Customer, error)
- func (api *CustomerAPI) NewPayment(id string, data PaymentData) (*PaymentReply, error)
- func (api *CustomerAPI) Payments(id string, offset uint64, limit uint64) ([]PaymentReply, error)
- type Issuer
- type IssuerAPI
- type Links
- type ListCustomersResponse
- type Method
- type MethodAPI
- type MethodAmount
- type MethodImage
- type Mollie
- type NewCustomerData
- type PaymentAPI
- type PaymentData
- type PaymentReply
- type PaymentStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Customer ¶
type Customer struct {
Resource string `json:"resource"`
ID string `json:"id"`
Mode string `json:"mode"`
Name string `json:"name"`
Email string `json:"email"`
Locale string `json:"locale"`
Metadata string `json:"metadata,omitempty"`
RecentlyUsedMethods []string `json:"recentlyUsedMethods"`
CreatedDatetime time.Time `json:"createdDatetime"`
}
type CustomerAPI ¶
type CustomerAPI struct {
// contains filtered or unexported fields
}
CustomerAPI is the part of the API which handles Mollie customers
func (*CustomerAPI) Get ¶
func (api *CustomerAPI) Get(id string) (*Customer, error)
Get retrieves customer information with the specified ID
func (*CustomerAPI) List ¶
func (api *CustomerAPI) List(offset, limit uint64) (*ListCustomersResponse, error)
List returns a list of customers
func (*CustomerAPI) New ¶
func (api *CustomerAPI) New(data NewCustomerData) (*Customer, error)
New creates a new customer
func (*CustomerAPI) NewPayment ¶
func (api *CustomerAPI) NewPayment(id string, data PaymentData) (*PaymentReply, error)
NewPayment creates a new payment for a customer with the specified ID
func (*CustomerAPI) Payments ¶
func (api *CustomerAPI) Payments(id string, offset uint64, limit uint64) ([]PaymentReply, error)
Payments returns a list of payments for a customer with the specified ID
type IssuerAPI ¶
type IssuerAPI struct {
// contains filtered or unexported fields
}
IssuerAPI type, holds reference to the core
type ListCustomersResponse ¶
type Method ¶
type Method struct {
ID string
Description string
Amount MethodAmount
Image MethodImage
Resource string
}
type MethodAmount ¶
type MethodImage ¶
type Mollie ¶
type Mollie struct {
// contains filtered or unexported fields
}
Mollie holds references to all sections of the API use the access functions to retrieve instances of this structure
func (Mollie) Customers ¶
func (m Mollie) Customers() *CustomerAPI
Customers returns a reference to the CustomerAPI
func (Mollie) Payments ¶
func (m Mollie) Payments() *PaymentAPI
Payments returns a reference to the PaymentAPI
type NewCustomerData ¶
type PaymentAPI ¶
type PaymentAPI struct {
// contains filtered or unexported fields
}
PaymentAPI structure holds a pointer to the core
func (*PaymentAPI) Delete ¶
func (a *PaymentAPI) Delete(id string) (*PaymentReply, error)
Delete a payment with the given ID
func (*PaymentAPI) Get ¶
func (a *PaymentAPI) Get(id string) (*PaymentReply, error)
Get retrieves a payment with the given ID
func (*PaymentAPI) List ¶
func (a *PaymentAPI) List(offset, limit uint64) ([]PaymentReply, error)
List returns a list of payments
func (*PaymentAPI) New ¶
func (a *PaymentAPI) New(data PaymentData) (*PaymentReply, error)
New Creates a new payment
type PaymentData ¶
type PaymentData struct {
Amount float64 `json:"amount,string"`
Description string `json:"description"`
RedirectURL string `json:"redirectUrl"`
WebhookURL string `json:"webhookUrl"`
Method string `json:"method,omitempty"`
Metadata interface{} `json:"metadata"`
// One of de_DE en_US es_ES fr_FR nl_BE fr_BE nl_NL
Locale string `json:"locale,omitempty"`
Issuer string `json:"issuer,omitempty"`
}
PaymentData needed for a payment request
type PaymentReply ¶
type PaymentReply struct {
ID string
Mode string
CreatedDatetime time.Time `json:"createdDatetime"`
ExpiredDatetime time.Time `json:"expiredDatetime"`
CancelledDatetime time.Time `json:"cancelledDatetime"`
PaidDatetime time.Time `json:"paidDatetime"`
Status PaymentStatus
ExpiryPeriod string `json:"expiryPeriod"`
Amount float64 `json:",string"`
AmountRefunded float64 `json:"amountRefunded,string,omitempty"`
AmountRemaining float64 `json:"amountRemaining,string,omitempty"`
Description string
Method string
Metadata interface{}
Details interface{} `json:",omitempty"`
ProfileID string `json:"profileId"`
Links map[string]string
}
PaymentReply for a payment
type PaymentStatus ¶
type PaymentStatus string
PaymentStatus for a payment
const ( // StatusOpen means a payment is open for payment StatusOpen PaymentStatus = "open" // StatusCancelled means a payment is cancelled by a user StatusCancelled PaymentStatus = "cancelled" // StatusExpired means a payment is expired and not accepting payments anymore StatusExpired PaymentStatus = "expired" // StatusFailed means a payment has failed StatusFailed PaymentStatus = "failed" // StatusPending means a payment is on hold and not confirmed (yet) StatusPending PaymentStatus = "pending" // StatusPaid informs you that a payment is marked as paid StatusPaid PaymentStatus = "paid" // StatusPaidout means ? StatusPaidout PaymentStatus = "paidout" // StatusRefunded means this payment is refunded StatusRefunded PaymentStatus = "refunded" // StatusChargedBack means a payment is charged back by the customer StatusChargedBack PaymentStatus = "charged_back" )