transactions

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Config *pagarme.Config
}

API is the /1/transactions API

func New

func New(cfg *pagarme.Config) *API

New /1/transactions API

func (*API) Get added in v0.0.2

func (api *API) Get(tid string) (*pagarme.Response, *pagarme.Transaction, error)

Get a transaction by ID

GET https://api.pagar.me/1/transactions/id

func (*API) Put

Put creates a new transaction

POST https://api.pagar.me/1/transactions

func (*API) PutDevBillet added in v0.0.3

func (api *API) PutDevBillet(tid string, status pagarme.TrStatus) (*pagarme.Response, *pagarme.Transaction, error)

PutDevBillet (Testando pagamento de Boletos)

Usado apenas em ambiente de Teste para simular o pagamento de um Boleto.

PUT https://api.pagar.me/1/transactions/transaction_id

func (*API) Query added in v0.0.10

func (api *API) Query(input QueryInput) (*pagarme.Response, []pagarme.Transaction, error)

Query transactions

func (*API) Refund

func (api *API) Refund(id int64, input *RefundInput) (*pagarme.Response, *pagarme.Transaction, error)

Refund refunds a transaction

POST https://api.pagar.me/1/transactions/transaction_id/refund

type QueryInput added in v0.0.10

type QueryInput struct {
	Count           int
	Page            int
	Filter          string
	Value           string
	Metadata        map[string]string
	DateCreatedFrom string // Unix timestamp WITH MILLISECONDS
	DateCreatedTo   string // Unix timestamp WITH MILLISECONDS
}

func (*QueryInput) Export added in v0.0.10

func (qi *QueryInput) Export() string

type RefundInput

type RefundInput struct {
	// O estorno parcial obedece as mesmas regras de um estorno total, e usa o parâmetro amount como
	// referência para o valor a ser estornado. É bom observar que o status da transação vai permanecer
	// paid até que o valor total da transação tenha sido estornado.
	Amount      int                    `json:"amount,omitempty"`
	SplitRules  []*pagarme.SplitRule   `json:"split_rules,omitempty"`
	Async       bool                   `json:"async,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	BankAccount *pagarme.BankAccount   `json:"bank_account,omitempty"`
}

RefundInput is the input data for Refund

Jump to

Keyboard shortcuts

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