paymill

package module
v0.0.0-...-971e526 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2014 License: MIT Imports: 10 Imported by: 0

README

paymill-go

Description

Wrapper for the Paymill API version 2.

Supported endpoints

  • Clients
  • Payments

Changelog

Click here to view the changelog.

Maintainers

License

MIT License. Copyright 2013 Tobias Haar.

Documentation

Overview

TODO check if that file can be removed

Index

Constants

View Source
const APIBase string = "api.paymill.com"
View Source
const APIScheme string = "https"
View Source
const APIVersion string = "v2"

Variables

This section is empty.

Functions

func Empty

func Empty(s string) bool

func IsError

func IsError(r *http.Response) bool

func NewErrorResponse

func NewErrorResponse(resp *http.Response, body []byte) error

func UrlFor

func UrlFor(entity string, data url.Values) url.URL

Types

type ApiClient

type ApiClient struct {
	Token string
}

func NewApiClient

func NewApiClient(token string) (c *ApiClient)

func (*ApiClient) ClientDetails

func (c *ApiClient) ClientDetails(id string) (*Client, error)

func (*ApiClient) ClientUpdate

func (c *ApiClient) ClientUpdate(id string, email string, description string) (*Client, error)

func (*ApiClient) CreateClient

func (c *ApiClient) CreateClient(email string, description string) (*Client, error)

func (*ApiClient) CreatePayment

func (c *ApiClient) CreatePayment(token string, client *string) (*Payment, error)

func (*ApiClient) CreateTransaction

func (c *ApiClient) CreateTransaction(transactionPayload TransactionPayload) (*Transaction, error)

func (*ApiClient) DeletePayment

func (c *ApiClient) DeletePayment(id string) (ok bool, err error)

func (*ApiClient) ListClients

func (c *ApiClient) ListClients(order string, filter map[string]string) (payments []Client, err error)

func (*ApiClient) ListPayments

func (c *ApiClient) ListPayments(order string, filter string) (payments []Payment, err error)

func (*ApiClient) PaymentDetails

func (c *ApiClient) PaymentDetails(id string) (*Payment, error)

func (*ApiClient) RemoveClient

func (c *ApiClient) RemoveClient(id string) (ok bool, err error)

type Client

type Client struct {
	Id          string
	Email       string
	Description string
	Created     string `json: "created_at"`
	Updated     string `json: "updated_at"`
	Payment     []string
	/* Subscription []Subscription */
	AppId string
}

func (*Client) CreatedAt

func (c *Client) CreatedAt() time.Time

func (*Client) UpdatedAt

func (c *Client) UpdatedAt() time.Time

type ClientResponse

type ClientResponse struct {
	Data *Client
	Mode string
}

func NewClientResponse

func NewClientResponse(resp *http.Response, body []byte) (r *ClientResponse, e error)

type DeletePaymentResponse

type DeletePaymentResponse struct {
	Data []interface{}
}

func NewDeletePaymentResponse

func NewDeletePaymentResponse(resp *http.Response, body []byte) (r *DeletePaymentResponse, e error)

type ErrorResponse

type ErrorResponse struct {
	Error     string
	Exception string
}

type ListClientsResponse

type ListClientsResponse struct {
	Data      []Client
	DataCount int
	Mode      string
}

func NewListClientsResponse

func NewListClientsResponse(resp *http.Response, body []byte) (r *ListClientsResponse, e error)

type ListPaymentResponse

type ListPaymentResponse struct {
	Data      []Payment
	DataCount int
	Mode      string
}

func NewListPaymentResponse

func NewListPaymentResponse(resp *http.Response, body []byte) (r *ListPaymentResponse, e error)

type Payment

type Payment struct {
	Id          string  `json:"id"`
	Type        string  `json:"type"`
	Client      *string `json:"client"`
	CardType    string  `json:"card_type"`
	Code        string  `json:"code"`
	Account     string  `json:"account"`
	Country     string  `json:"country"`
	ExpireMonth string  `json:"expire_month"`
	ExpireYear  string  `json:"expire_year"`
	Holder      string  `json:"holder"`
	CardHolder  *string `json:"card_holder"`
	Last4       string  `json:"last4"`
	Created     int64   `json:"created_at"`
	Updated     int64   `json:"updated_at"`
	AppId       *string `json:"app_id"`
}

Object for direct debit payments

func (*Payment) CreatedAt

func (p *Payment) CreatedAt() time.Time

func (*Payment) UpdatedAt

func (p *Payment) UpdatedAt() time.Time

type PaymentResponse

type PaymentResponse struct {
	Data *Payment
	Mode string
}

func NewPaymentResponse

func NewPaymentResponse(resp *http.Response, body []byte) (r *PaymentResponse, e error)

type Transaction

type Transaction struct {
	Id           string
	Amount       string
	OriginAmount int `json:"origin_amount"`
	Status       string
	Description  *string
	LiveMode     bool `json:"livemode"`
	IsFraud      bool `json:"is_fraud"`
	//Refunds []Refund
	Currency     string
	Created      int64  `json:"created_at"`
	Updated      int64  `json:"updated_at"`
	ResponseCode int    `json:"response_code"`
	ShortId      string `json:"short_id"`
	//Invoices []string
	Payment Payment
	Client  Client
	//Preauthorization Preauthorization
	//Fees []string
	AppId *string `json: "app_id"`
}

func (*Transaction) CreatedAt

func (t *Transaction) CreatedAt() time.Time

func (*Transaction) UpdatedAt

func (t *Transaction) UpdatedAt() time.Time

type TransactionPayload

type TransactionPayload struct {
	PaymentId   string
	Amount      string
	Currency    string
	Description string
}

type TransactionResponse

type TransactionResponse struct {
	Data *Transaction
	Mode string
}

Jump to

Keyboard shortcuts

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