Documentation ¶
Index ¶
- type Address
- type BankAccount
- type BankAccountType
- type Billing
- type Card
- type Config
- type CountryCode
- type Customer
- type CustomerType
- type Document
- type DocumentType
- type Float64String
- type Int64String
- type Item
- type MMYY
- type NCard
- type Payable
- type PayableStatus
- type PayableType
- type PaymentMethod
- type Perror
- type Querier
- type QueryBuilder
- type QueryInt
- type QueryOp
- type QueryString
- type QueryTime
- type Response
- type ResponseCode
- type Shipping
- type SplitRule
- type TrStatus
- type Transaction
- type UnixMS
- type YYYYMMDD
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Object string `json:"object,omitempty" form:"object,omitempty"` ID int64 `json:"id,omitempty" form:"id,omitempty"` Street string `json:"street" form:"street"` StreetNumber string `json:"street_number" form:"street_number"` // CEP. Para endereço brasileiro, deve conter uma numeração de 8 dígitos Zipcode string `json:"zipcode" form:"zipcode"` // Obrigatório. País. Duas letras minúsculas. Deve seguir o padão ISO 3166-1 alpha-2 Country CountryCode `json:"country" form:"country"` State string `json:"state" form:"state"` City string `json:"city" form:"city"` Neighborhood string `json:"neighborhood,omitempty" form:"neighborhood,omitempty"` Complementary string `json:"complementary,omitempty" form:"complementary,omitempty"` }
Address TBD
type BankAccount ¶ added in v0.0.7
type BankAccount struct { BankAccountID string `json:"bank_account_id,omitempty"` BankCode string `json:"bank_code,omitempty"` Agencia string `json:"agencia,omitempty"` AgenciaDV string `json:"agencia_dv,omitempty"` Conta string `json:"conta,omitempty"` ContaDV string `json:"conta_dv,omitempty"` DocumentNumber string `json:"document_number,omitempty"` LegalName string `json:"legal_name,omitempty"` Type BankAccountType `json:"type,omitempty"` }
type BankAccountType ¶
type BankAccountType string
const ( BnkAccContaCorrente BankAccountType = "conta_corrente" BnkAccContaPoupanca BankAccountType = "conta_poupanca" BnkAccContaCorrenteConjunta BankAccountType = "conta_corrente_conjunta" BnkAccContaPoupancaConjunta BankAccountType = "conta_poupanca_conjunta" )
type Card ¶
type Card struct { Object string `json:"object,omitempty" form:"object,omitempty"` ID string `json:"id,omitempty" form:"id,omitempty"` DateCreated time.Time `json:"date_created,omitempty" form:"date_created,omitempty"` DateUpdated time.Time `json:"date_updated,omitempty" form:"date_updated,omitempty"` Brand string `json:"brand,omitempty" form:"brand,omitempty"` HolderName string `json:"holder_name,omitempty" form:"holder_name,omitempty"` FirstDigits string `json:"first_digits,omitempty" form:"first_digits,omitempty"` LastDigits string `json:"last_digits,omitempty" form:"last_digits,omitempty"` Country string `json:"country,omitempty" form:"country,omitempty"` Fingerprint string `json:"fingerprint,omitempty" form:"fingerprint,omitempty"` Valid bool `json:"valid,omitempty" form:"valid,omitempty"` ExpirationDate MMYY `json:"expiration_date,omitempty" form:"expiration_date,omitempty"` }
type Config ¶
type Config struct { Apikey string Cryptokey string Client *http.Client Trace bool Logger *zap.Logger }
Config holds the config of pagarme
type CountryCode ¶
type CountryCode string
const (
Brazil CountryCode = "br"
)
func (CountryCode) IsValid ¶
func (cc CountryCode) IsValid() bool
type Customer ¶
type Customer struct { Object string `json:"object,omitempty" form:"object,omitempty"` ID int64 `json:"id,omitempty" form:"id,omitempty"` ExternalID string `json:"external_id,omitempty" form:"external_id,omitempty"` Type CustomerType `json:"type" form:"type"` Name string `json:"name,omitempty" form:"name,omitempty"` Email string `json:"email,omitempty" form:"email,omitempty"` Country CountryCode `json:"country,omitempty" form:"country,omitempty"` Birthday YYYYMMDD `json:"birthday,omitempty" form:"birthday,omitempty"` Gender string `json:"gender,omitempty" form:"gender,omitempty"` Documents []*Document `json:"documents,omitempty" form:"documents,omitempty"` PhoneNumbers []string `json:"phone_numbers,omitempty" form:"phone_numbers,omitempty"` }
Customer TODO: godoc
type CustomerType ¶
type CustomerType string
const ( CustomerIndividual CustomerType = "individual" CustomerCorporation CustomerType = "corporation" )
type Document ¶
type Document struct { Object string `json:"object,omitempty" form:"object,omitempty"` ID string `json:"id,omitempty" form:"id,omitempty"` Type DocumentType `json:"type,omitempty" form:"type,omitempty"` Number string `json:"number,omitempty" form:"number,omitempty"` }
Document TBD
type DocumentType ¶
type DocumentType string
const ( DocCPF DocumentType = "cpf" DocCNPJ DocumentType = "cnpj" DocPassport DocumentType = "passport" )
type Float64String ¶ added in v0.0.2
type Float64String float64
func (*Float64String) MarshalJSON ¶ added in v0.0.2
func (n *Float64String) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*Float64String) Scan ¶ added in v0.0.2
func (n *Float64String) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*Float64String) UnmarshalJSON ¶ added in v0.0.2
func (n *Float64String) UnmarshalJSON(v []byte) error
UnmarshalJSON implements json.Unmarshaler
type Int64String ¶ added in v0.0.9
type Int64String int64
func (*Int64String) MarshalJSON ¶ added in v0.0.9
func (n *Int64String) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*Int64String) Scan ¶ added in v0.0.9
func (n *Int64String) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*Int64String) UnmarshalJSON ¶ added in v0.0.9
func (n *Int64String) UnmarshalJSON(v []byte) error
UnmarshalJSON implements json.Unmarshaler
type Item ¶
type Item struct { ID string `json:"id,omitempty" form:"id,omitempty"` Object string `json:"object,omitempty" form:"object,omitempty"` Title string `json:"title,omitempty" form:"title,omitempty"` UnitPrice int `json:"unit_price,omitempty" form:"unit_price,omitempty"` Quantity int `json:"quantity,omitempty" form:"quantity,omitempty"` Category string `json:"category,omitempty" form:"category,omitempty"` Tangible bool `json:"tangible,omitempty" form:"tangible,omitempty"` Venue string `json:"venue,omitempty" form:"venue,omitempty"` Date string `json:"date,omitempty" form:"date,omitempty"` }
Item TODO: godoc
type MMYY ¶
type MMYY string
MMYY represents a two digit MM (month) and YY (last two digits of the year) combined
type Payable ¶ added in v0.0.5
type Payable struct { Object string `json:"object"` ID int `json:"id"` Status PayableStatus `json:"status"` Amount int `json:"amount"` Fee int `json:"fee"` AnticipationFee int `json:"anticipation_fee"` FraudCoverageFee int `json:"fraud_coverage_fee"` Installment int `json:"installment"` TransactionID int `json:"transaction_id"` SplitRuleID string `json:"split_rule_id,omitempty"` //TODO: bulk_anticipation_id RecipientID string `json:"recipient_id,omitempty"` PaymentDate time.Time `json:"payment_date"` OriginalPaymentDate time.Time `json:"original_payment_date,omitempty"` Type PayableType `json:"type"` PaymentMethod PaymentMethod `json:"payment_method"` AccrualDate time.Time `json:"accrual_date,omitempty"` DateCreated time.Time `json:"date_created"` }
Payable -> Objeto-resposta Recebível
Objeto contendo os dados de um recebível. O recebível (payable) é gerado automaticamente após uma transação ser paga. Para cada parcela de uma transação é gerado um recebível, que também pode ser dividido por recebedor (no caso de um split ter sido feito).
type PayableStatus ¶ added in v0.0.5
type PayableStatus string
const ( PbsPaid PayableStatus = "paid" PbsWaitingFunds PayableStatus = "waiting_funds" )
type PayableType ¶ added in v0.0.5
type PayableType string
const ( PtChargeback PayableType = "chargeback" PtRefund PayableType = "refund" PtChargebackRefund PayableType = "chargeback_refund" PtCredit PayableType = "credit" )
type PaymentMethod ¶
type PaymentMethod string
const ( PaymentCreditCard PaymentMethod = "credit_card" PaymentBoleto PaymentMethod = "boleto" )
type QueryBuilder ¶ added in v0.0.5
type QueryBuilder struct {
// contains filtered or unexported fields
}
func (*QueryBuilder) Get ¶ added in v0.1.2
func (b *QueryBuilder) Get(name string) Querier
Get a querier item
type QueryInt ¶ added in v0.0.5
QueryInt is used on integer queries
type QueryOp ¶ added in v0.0.5
type QueryOp string
QueryOp is the operator of a query item
const ( // QueryOpEquals = QueryOpEquals QueryOp = "=" // QueryOpGreaterThan > QueryOpGreaterThan QueryOp = "=%3E" // QueryOpLessThan < QueryOpLessThan QueryOp = "=%3C" // QueryOpGreaterOrEqualThan >= QueryOpGreaterOrEqualThan QueryOp = "=%3E%3D" // QueryOpLessOrEqualThan <= QueryOpLessOrEqualThan QueryOp = "=%3C%3D" )
type QueryString ¶ added in v0.0.5
QueryString is used on string queries
func (*QueryString) Format ¶ added in v0.0.5
func (qt *QueryString) Format() string
Format to pagarme query
func (*QueryString) PName ¶ added in v0.1.1
func (qt *QueryString) PName() string
PName of the query param
type QueryTime ¶ added in v0.0.5
QueryTime is used on datetime queries
type Response ¶
type Response struct { Code ResponseCode `json:"code,omitempty" form:"code,omitempty"` Errors []Perror `json:"errors,omitempty" form:"errors,omitempty"` URL string `json:"url,omitempty" form:"url,omitempty"` Method string `json:"method,omitempty" form:"method,omitempty"` }
type ResponseCode ¶
type ResponseCode int
const ( // ResponseCodeOk 200 - Tudo ocorreu como deveria e sua requisição foi processada com sucesso. ResponseCodeOk ResponseCode = 200 // ResponseCodeMissingParameter 400 - Algum parâmetro obrigatório não foi passado, ou os parâmetros passados não estão corretos. ResponseCodeMissingParameter ResponseCode = 400 ResponseCodeAuthError ResponseCode = 401 ResponseCodeNotFound ResponseCode = 404 ResponseCodeInternalError ResponseCode = 500 )
type Shipping ¶
type Shipping struct { Address *Address `json:"address,omitempty" form:"address,omitempty"` Object string `json:"object,omitempty" form:"object,omitempty"` ID int64 `json:"id,omitempty" form:"id,omitempty"` Name string `json:"name,omitempty" form:"name,omitempty"` Fee int `json:"fee" form:"fee"` DeliveryDate YYYYMMDD `json:"delivery_date,omitempty" form:"delivery_date,omitempty"` Expedited bool `json:"expedited,omitempty" form:"expedited,omitempty"` }
type SplitRule ¶
type SplitRule struct { Object string `json:"object,omitempty" form:"object,omitempty"` ID string `json:"id,omitempty" form:"id,omitempty"` Liable bool `json:"liable" form:"liable"` ChargeProcessingFee bool `json:"charge_processing_fee" form:"charge_processing_fee"` Percentage Float64String `json:"percentage,omitempty" form:"percentage,omitempty"` Amount Int64String `json:"amount,omitempty" form:"amount,omitempty"` ChargeRemainderFee bool `json:"charge_remainder_fee" form:"charge_remainder_fee"` RecipientID string `json:"recipient_id" form:"recipient_id"` DateCreated time.Time `json:"date_created" form:"date_created"` DateUpdated time.Time `json:"date_updated" form:"date_updated"` BlockID string `json:"block_id" form:"block_id"` }
SplitRule TBD
type Transaction ¶
type Transaction struct { Amount int `json:"amount" form:"amount"` CardHash string `json:"card_hash,omitempty" form:"card_hash,omitempty"` CardID string `json:"card_id,omitempty" form:"card_id,omitempty"` CardHolderName string `json:"card_holder_name,omitempty" form:"card_holder_name,omitempty"` CardExpirationDate MMYY `json:"card_expiration_date,omitempty" form:"card_expiration_date,omitempty"` CardNumber string `json:"card_number,omitempty" form:"card_number,omitempty"` CardCVV string `json:"card_cvv,omitempty" form:"card_cvv,omitempty"` PaymentMethod PaymentMethod `json:"payment_method,omitempty" form:"payment_method,omitempty"` PostbackURL string `json:"postback_url,omitempty" form:"postback_url,omitempty"` Async bool `json:"async,omitempty" form:"async,omitempty"` Installments int `json:"installments,omitempty" form:"installments,omitempty"` BoletoExpirationDate string `json:"boleto_expiration_date,omitempty" form:"boleto_expiration_date,omitempty"` SoftDescriptor string `json:"soft_descriptor,omitempty" form:"soft_descriptor,omitempty"` Capture string `json:"capture,omitempty" form:"capture,omitempty"` BoletoInstructions string `json:"boleto_instructions,omitempty" form:"boleto_instructions,omitempty"` SplitRules []*SplitRule `json:"split_rules,omitempty" form:"split_rules,omitempty"` Customer *Customer `json:"customer" form:"customer"` Billing *Billing `json:"billing" form:"billing"` Shipping *Shipping `json:"shipping" form:"shipping"` Items []*Item `json:"items,omitempty" form:"items,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty" form:"metadata,omitempty"` Session string `json:"session,omitempty" form:"session,omitempty"` LocalTime *time.Time `json:"local_time,omitempty" form:"local_time,omitempty"` // // Data returned by pagar-me // Object string `json:"object,omitempty" form:"object,omitempty"` Status TrStatus `json:"status,omitempty" form:"status,omitempty"` RefuseReason string `json:"refuse_reason,omitempty" form:"refuse_reason,omitempty"` StatusReason string `json:"status_reason,omitempty" form:"status_reason,omitempty"` AcquirerResponseCode string `json:"acquirer_response_code,omitempty" form:"acquirer_response_code,omitempty"` AcquirerName string `json:"acquirer_name,omitempty" form:"acquirer_name,omitempty"` AcquirerID string `json:"acquirer_id,omitempty" form:"acquirer_id,omitempty"` AuthorizationCode string `json:"authorization_code,omitempty" form:"authorization_code,omitempty"` TID int `json:"tid,omitempty" form:"tid,omitempty"` NSU int `json:"nsu,omitempty" form:"nsu,omitempty"` DateCreated *time.Time `json:"date_created,omitempty" form:"date_created,omitempty"` DateUpdated *time.Time `json:"date_updated,omitempty" form:"date_updated,omitempty"` AuthorizedAmount int `json:"authorized_amount,omitempty" form:"authorized_amount,omitempty"` PaidAmount int `json:"paid_amount,omitempty" form:"paid_amount,omitempty"` RefundedAmount int `json:"refunded_amount,omitempty" form:"refunded_amount,omitempty"` ID int64 `json:"id,omitempty" form:"id,omitempty"` Cost int `json:"cost,omitempty" form:"cost,omitempty"` CardFirstDigits string `json:"card_first_digits,omitempty" form:"card_first_digits,omitempty"` CardLastDigits string `json:"card_last_digits,omitempty" form:"card_last_digits,omitempty"` CardBrand string `json:"card_brand,omitempty" form:"card_brand,omitempty"` Card *Card `json:"card,omitempty" form:"card,omitempty"` CaptureMethod string `json:"capture_method,omitempty" form:"capture_method,omitempty"` CardPinMode string `json:"card_pin_mode,omitempty" form:"card_pin_mode,omitempty"` // card_magstripe_fallback AntifraudScore float64 `json:"antifraud_score,omitempty" form:"antifraud_score,omitempty"` BoletoURL string `json:"boleto_url,omitempty" form:"boleto_url,omitempty"` BoletoBarcode string `json:"boleto_barcode,omitempty" form:"boleto_barcode,omitempty"` Referer string `json:"referer,omitempty" form:"referer,omitempty"` IP string `json:"ip,omitempty" form:"ip,omitempty"` SubscriptionID string `json:"subscription_id,omitempty" form:"subscription_id,omitempty"` // phone // address AntifraudMetadata map[string]interface{} `json:"antifraud_metadata,omitempty" form:"antifraud_metadata,omitempty"` // reference_key // device // local_transaction_id // fraud_covered // order_id RiskLevel string `json:"risk_level,omitempty" form:"risk_level,omitempty"` }