Documentation
¶
Index ¶
- Constants
- func ParseWebhookObject(body []byte, entity interface{}) error
- type Account
- type AdditionalInformation
- type Address
- type AntifraudResponse
- type Authentication
- type Balance
- type BalanceOperation
- type BalanceOperationPtr
- type BalanceOperations
- type BalancePtr
- type BalanceQuery
- type BankAccount
- type BankAccountType
- type BankCode
- type BillingAddress
- type BillingType
- type Boleto
- type BoletoType
- type CancelPendingInvoices
- type Card
- type CardId
- type CardPtr
- type CardType
- type Cards
- type Charge
- type ChargePaymentConfirm
- type ChargePtr
- type ChargeQuery
- type ChargeStatus
- type ChargeUpdate
- type Charges
- type Checkout
- type Content
- type CreditCard
- type Currency
- type Customer
- type CustomerPtr
- type CustomerQuery
- type CustomerType
- type Customers
- type Cycle
- type CycleCount
- type Discount
- type DocumentType
- type ErrorResponse
- type Fine
- type GatewayResponse
- type Gender
- type Increment
- type Interest
- type Interval
- type IntervalCount
- type Invoice
- type InvoiceItem
- type InvoicePtr
- type InvoiceQuery
- type InvoiceStatus
- type Invoices
- type LastTransaction
- type LastTransactionPtr
- type MovementObject
- type OperationType
- type Order
- func (this *Order) AddItem() *OrderItem
- func (this *Order) AddPayment(amount int64, method PaymentMethod) *Order
- func (this *Order) GetChargeId() string
- func (this *Order) GetLastCharge() *optional.Optional[ChargePtr]
- func (this *Order) GetLastTransaction() *optional.Optional[LastTransactionPtr]
- func (this *Order) GetPayZenSOAPStatus() api.TransactionStatus
- func (this *Order) GetPayment() *Payment
- func (this *Order) GetStatus() api.PagarmeV5Status
- func (this *Order) GetTranscationId() string
- func (this *Order) HasCardIdOrToken() bool
- func (this *Order) IsCreditCard() bool
- func (this *Order) WithBoleto(cb func(*Boleto)) *Order
- func (this *Order) WithCreditCard(cb func(*CreditCard)) *Order
- func (this *Order) WithPix(cb func(*Pix)) *Order
- type OrderItem
- type OrderPtr
- type OrderQuery
- type Orders
- type Pagarme
- type PagarmeApi
- type PagarmeCard
- func (this *PagarmeCard) Create(customerId string, card CardPtr) *either.Either[*ErrorResponse, SuccessCard]
- func (this *PagarmeCard) Delete(customerId string, cardId string) *either.Either[*ErrorResponse, SuccessBool]
- func (this *PagarmeCard) Get(customerId string, cardId string) *either.Either[*ErrorResponse, SuccessCard]
- func (this *PagarmeCard) List(customerId string) *either.Either[*ErrorResponse, SuccessCards]
- func (this *PagarmeCard) Renew(customerId string, cardId string) *either.Either[*ErrorResponse, SuccessBool]
- func (this *PagarmeCard) Update(customerId string, card CardPtr) *either.Either[*ErrorResponse, SuccessCard]
- type PagarmeCharge
- func (this *PagarmeCharge) Cancel(chargeId string) *either.Either[*ErrorResponse, SuccessCharge]
- func (this *PagarmeCharge) Capture(id string, code string) *either.Either[*ErrorResponse, SuccessCharge]
- func (this *PagarmeCharge) ConfirmPayment(chargeId string, opts ...*ChargePaymentConfirm) *either.Either[*ErrorResponse, SuccessCharge]
- func (this *PagarmeCharge) Get(chargeId string) *either.Either[*ErrorResponse, SuccessCharge]
- func (this *PagarmeCharge) List(query *ChargeQuery) *either.Either[*ErrorResponse, SuccessCharges]
- func (this *PagarmeCharge) ListPending(orderId string, size int) *either.Either[*ErrorResponse, SuccessCharges]
- func (this *PagarmeCharge) Retry(chargeId string) *either.Either[*ErrorResponse, SuccessCharge]
- func (this *PagarmeCharge) UpdateCard(chargeId string, updateData ChargeUpdate) *either.Either[*ErrorResponse, SuccessCharge]
- func (this *PagarmeCharge) UpdateDueDate(chargeId string, dueDate time.Time) *either.Either[*ErrorResponse, SuccessCharge]
- type PagarmeCustomer
- func (this *PagarmeCustomer) Create(customer CustomerPtr) *either.Either[*ErrorResponse, SuccessCustomer]
- func (this *PagarmeCustomer) Get(customerId string) *either.Either[*ErrorResponse, SuccessCustomer]
- func (this *PagarmeCustomer) List(query *CustomerQuery) *either.Either[*ErrorResponse, SuccessCustomers]
- func (this *PagarmeCustomer) Update(customer CustomerPtr) *either.Either[*ErrorResponse, SuccessCustomer]
- type PagarmeInvoice
- type PagarmeOrder
- type PagarmePlan
- func (this *PagarmePlan) Create(plan *Plan) *either.Either[*ErrorResponse, SuccessPlan]
- func (this *PagarmePlan) Delete(id string) *either.Either[*ErrorResponse, SuccessBool]
- func (this *PagarmePlan) Get(id string) *either.Either[*ErrorResponse, SuccessPlan]
- func (this *PagarmePlan) List(query *PlanQuery) *either.Either[*ErrorResponse, SuccessPlans]
- func (this *PagarmePlan) Update(plan PlanPtr) *either.Either[*ErrorResponse, SuccessPlan]
- type PagarmeRecipient
- func (this *PagarmeRecipient) Balance(recipientId string) *either.Either[*ErrorResponse, SuccessBalance]
- func (this *PagarmeRecipient) BalanceOperations(recipientId string, query *BalanceQuery) *either.Either[*ErrorResponse, SuccessBalanceOperations]
- func (this *PagarmeRecipient) Create(recipient *Recipient) *either.Either[*ErrorResponse, SuccessRecipient]
- func (this *PagarmeRecipient) CreateTransfer(recipientId string, amount int64) *either.Either[*ErrorResponse, SuccessTransfer]
- func (this *PagarmeRecipient) GetTransfer(recipientId string, transferId string) *either.Either[*ErrorResponse, SuccessTransfer]
- func (this *PagarmeRecipient) Gt(id string) *either.Either[*ErrorResponse, SuccessRecipient]
- func (this *PagarmeRecipient) List() *either.Either[*ErrorResponse, SuccessRecipients]
- func (this *PagarmeRecipient) ListTransfers(recipientId string, query *TransferQuery) *either.Either[*ErrorResponse, SuccessTransfers]
- func (this *PagarmeRecipient) Update(id string, recipient *RecipientUpdate) *either.Either[*ErrorResponse, SuccessRecipient]
- func (this *PagarmeRecipient) UpdateBankAccount(id string, account BankAccount) *either.Either[*ErrorResponse, SuccessBool]
- func (this *PagarmeRecipient) UpdateTransferSettings(id string, settings *TransferSettings) *either.Either[*ErrorResponse, SuccessBool]
- type PagarmeSubscription
- func (this *PagarmeSubscription) Cancel(id string, cancelPendingInvoices CancelPendingInvoices) *either.Either[*ErrorResponse, SuccessBool]
- func (this *PagarmeSubscription) Create(subscription SubscriptionPtr) *either.Either[*ErrorResponse, SuccessSubscription]
- func (this *PagarmeSubscription) Get(id string) *either.Either[*ErrorResponse, SuccessSubscription]
- func (this *PagarmeSubscription) List(query *SubscriptionQuery) *either.Either[*ErrorResponse, SuccessSubscriptions]
- func (this *PagarmeSubscription) ListItems(id string) *either.Either[*ErrorResponse, SuccessSubscriptionItems]
- func (this *PagarmeSubscription) UpdateCard(updateData *SubscriptionUpdate) *either.Either[*ErrorResponse, SuccessBool]
- func (this *PagarmeSubscription) UpdateItem(subscriptionId string, itemId string, item SubscriptionItemPtr) *either.Either[*ErrorResponse, SuccessSubscriptionItem]
- func (this *PagarmeSubscription) UpdatePaymentMethod(updateData *SubscriptionUpdate) *either.Either[*ErrorResponse, SuccessBool]
- type Paging
- type Payment
- type PaymentMethod
- type Phone
- type Phones
- type Pix
- type Plan
- func (this *Plan) AddPaymentMethod(methods ...PaymentMethod) *Plan
- func (this *Plan) AddPlanItem(items ...*PlanItem) *Plan
- func (this *Plan) GetAmount() int64
- func (this *Plan) GetIntervalRule() api.SubscriptionCycle
- func (this *Plan) SetIntervalRule(interval Interval, count IntervalCount) *Plan
- func (this *Plan) SetPricingScheme(scheme *PricingScheme) *Plan
- type PlanItem
- type PlanPtr
- type PlanQuery
- type Plans
- type PricingScheme
- type Quantity
- type Recipient
- type RecipientPtr
- type RecipientUpdate
- type Recipients
- type Response
- type ResponseParser
- type SchemeType
- type ServiceRefererName
- type Status
- type Subscription
- func (this *Subscription) AddItem(items ...*SubscriptionItem) *Subscription
- func (this *Subscription) HasCardIdOrToken() bool
- func (this *Subscription) SetIntervalRule(interval Interval, intervalCount IntervalCount) *Subscription
- func (this *Subscription) SetPricingScheme(scheme *PricingScheme) *Subscription
- func (this *Subscription) SetStartAt(date time.Time) *Subscription
- func (this *Subscription) WithCard(card CardPtr) *Subscription
- func (this *Subscription) WithCustomer(customer CustomerPtr) *Subscription
- func (this *Subscription) WithPlanId(planId string) *Subscription
- type SubscriptionItem
- type SubscriptionItemPtr
- type SubscriptionItems
- type SubscriptionPtr
- type SubscriptionQuery
- type SubscriptionUpdate
- type Subscriptions
- type Success
- type SuccessBalance
- type SuccessBalanceOperations
- type SuccessBool
- type SuccessCard
- type SuccessCards
- type SuccessCharge
- type SuccessCharges
- type SuccessCustomer
- type SuccessCustomers
- type SuccessInvoice
- type SuccessInvoices
- type SuccessOrder
- type SuccessOrders
- type SuccessPlan
- type SuccessPlans
- type SuccessRecipient
- type SuccessRecipients
- type SuccessSubscription
- type SuccessSubscriptionItem
- type SuccessSubscriptionItems
- type SuccessSubscriptions
- type SuccessTransfer
- type SuccessTransfers
- type Transfer
- type TransferInterval
- type TransferPtr
- type TransferQuery
- type TransferSettings
- type Transfers
- type Webhook
- type WebhookData
- type WebhookEvent
- type WebhookObject
- type WebhookStatus
Constants ¶
View Source
const ( BRL Currency = "BRL" DateLayout = "2006-01-02" DateTimeLayout = "2006-01-02T15:04:05" )
View Source
const (
BrasilCode = "BR"
)
View Source
const (
PAGARME_URL = "https://api.pagar.me/core/v5"
)
Variables ¶
This section is empty.
Functions ¶
func ParseWebhookObject ¶
Types ¶
type AdditionalInformation ¶
type Address ¶
type Address struct { Id string `json:"id,omitempty"` Country string `json:"country" valid:"Required;MaxSize(2)"` State string `json:"state" valid:"Required;MaxSize(2)"` City string `json:"city" valid:"Required;MaxSize(64)"` ZipCode string `json:"zip_code" valid:"Required;MaxSize(8)"` Line1 string `json:"line_1" valid:"Required"` Line2 string `json:"line_2" valid:""` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` }
func NewAddress ¶
func NewAddress() *Address
type AntifraudResponse ¶
type Authentication ¶
func NewAuthentication ¶
func NewAuthentication(secretKey string, publicKey string) *Authentication
func (*Authentication) Basic ¶
func (this *Authentication) Basic() string
type BalanceOperation ¶
type BalanceOperationPtr ¶
type BalanceOperationPtr = *BalanceOperation
type BalanceOperations ¶
type BalanceOperations = []BalanceOperationPtr
type BalancePtr ¶
type BalancePtr = *Balance
type BalanceQuery ¶
type BalanceQuery struct { Status ChargeStatus `jsonp:"status,omitempty"` CreatedSince time.Time `jsonp:"created_since,date,omitempty"` CreatedUntil time.Time `jsonp:"created_until,date,omitempty"` RecipientId string `jsonp:"recipient_id"` Page int `jsonp:"page,omitempty"` Size int `jsonp:"size,omitempty"` }
func NewBalanceQuery ¶
func NewBalanceQuery() *BalanceQuery
func (*BalanceQuery) UrlQuery ¶
func (this *BalanceQuery) UrlQuery() string
type BankAccount ¶
type BankAccount struct { HolderName string `json:"holder_name" valid:"Required;MaxSize(30)"` Bank string `json:"bank" valid:"Required;MaxSize(3)"` BranchNumber string `json:"branch_number" valid:"Required;MaxSize(4)"` BranchCheckDigit string `json:"branch_check_digit" valid:"Required;MaxSize(1)"` AccountNumber string `json:"account_number" valid:"Required;MaxSize(13)"` AccountCheckDigit string `json:"account_check_digit" valid:"Required;MaxSize(2)"` HolderType CustomerType `json:"holder_type" valid:"Required"` HolderDocument string `json:"holder_document" valid:"Required"` Type BankAccountType `json:"type" valid:"Required"` }
type BankAccountType ¶
type BankAccountType string
const ( Checking BankAccountType = "checking" // corrente Savings BankAccountType = "savings" // poupança )
type BillingAddress ¶
type BillingAddress struct { Country string `json:"country" valid:"Required;MaxSize(2)"` State string `json:"state" valid:"Required;MaxSize(2)"` City string `json:"city" valid:"Required;MaxSize(64)"` ZipCode string `json:"zip_code" valid:"Required;MaxSize(8)"` Line1 string `json:"line_1" valid:"Required"` Line2 string `json:"line_2" valid:""` }
type BillingType ¶
type BillingType string
const ( PrePaid BillingType = "prepaid" PostPaid BillingType = "postpaid" ExactDay BillingType = "exact_day" )
type Boleto ¶
type Boleto struct { Bank BankCode `json:"bank,omitempty" valid:""` Instructions string `json:"instructions" valid:"MaxSize(256)"` DueAt string `json:"due_at"` NossoNumero string `json:"nosso_numero,omitempty"` Type BoletoType `json:"type,omitempty"` DocumentNumber string `json:"document_number,omitempty" valid:"MaxSize(16)"` // Identificador do boleto Interest *Interest `json:"interest,omitempty"` Fine *Fine `json:"fine,omitempty"` }
type CancelPendingInvoices ¶
type CancelPendingInvoices bool
const ( CancelPendingInvoicesYes CancelPendingInvoices = true CancelPendingInvoicesNo CancelPendingInvoices = false )
type Card ¶
type Card struct { Number string `json:"number,omitempty" valid:""` HolderName string `json:"holder_name,omitempty" valid:""` HolderDocument string `json:"holder_document,omitempty" valid:""` ExpMonth int64 `json:"exp_month,omitempty" valid:""` // Value between 1 and 12 (included) ExpYear int64 `json:"exp_year,omitempty" valid:""` // Formatos yy ou yyyy. Ex: 23 ou 2023 Cvv string `json:"cvv,omitempty" valid:""` Brand string `json:"brand,omitempty" valid:""` Label string `json:"label,omitempty" valid:""` CardId string `json:"card_id,omitempty"` //CardToken string `json:"card_token,omitempty"` BillingAddressId string `json:"billing_address_id,omitempty"` BillingAddress *BillingAddress `json:"billing_address,omitempty"` Id string `json:"id,omitempty"` FirstSixDigits string `json:"first_six_digits,omitempty"` LastFourDigits string `json:"last_four_digits,omitempty"` Status Status `json:"status,omitempty"` PrivateLabel bool `json:"private_label,omitempty"` Type CardType `json:"type,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` DeletedAt string `json:"deleted_at,omitempty"` Customer *Customer `json:"customer,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` }
type Charge ¶
type Charge struct { Id string `json:"id"` Code string `json:"code"` GatewayId string `json:"gateway_id"` Amount int64 `json:"amount"` PaidAmount int64 `json:"paid_amount"` Status ChargeStatus `json:"status"` Currency Currency `json:"currency"` PaymentMethod PaymentMethod `json:"payment_method"` DueAt string `json:"due_at"` PaidAt string `json:"paid_at"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Invoice *Invoice `json:"invoice"` Customer *Customer `json:"customer"` LastTransaction *LastTransaction `json:"last_transaction"` }
func (*Charge) ToPaymentStatus ¶
func (this *Charge) ToPaymentStatus() api.PaymentStatus
type ChargePaymentConfirm ¶
type ChargeQuery ¶
type ChargeQuery struct { Code string `jsonp:"code,omitempty"` Status ChargeStatus `jsonp:"status,omitempty"` PaymentMethod PaymentMethod `jsonp:"payment_method,omitempty"` CustomerId string `jsonp:"customer_id,omitempty"` OrderId string `jsonp:"order_id,omitempty"` CreatedSince time.Time `jsonp:"created_since,date,omitempty"` CreatedUntil time.Time `jsonp:"created_until,date,omitempty"` Page int `jsonp:"page,omitempty"` Size int `jsonp:"size,omitempty"` }
func NewChargeQuery ¶
func NewChargeQuery() *ChargeQuery
func (*ChargeQuery) UrlQuery ¶
func (this *ChargeQuery) UrlQuery() string
type ChargeStatus ¶
type ChargeStatus string
const ( ChargePending ChargeStatus = "pending" ChargePaid ChargeStatus = "paid" ChargeCanceled ChargeStatus = "canceled" ChargeProcessing ChargeStatus = "processing" ChargeFailed ChargeStatus = "failed" ChargeOverpaid ChargeStatus = "overpaid" ChargeUnderpaid ChargeStatus = "underpaid" )
type ChargeUpdate ¶
type CreditCard ¶
type CreditCard struct { OperationType OperationType `json:"operation_type" valid:"Required"` Installments int64 `json:"installments"` StatementDescriptor string `json:"statement_descriptor" valid:"Required;MaxSize(13)"` Card *Card `json:"card,omitempty"` CardId string `json:"card_id,omitempty"` CardToken string `json:"card_token,omitempty"` }
func NewCreditCard ¶
func NewCreditCard() *CreditCard
type Customer ¶
type Customer struct { Id string `json:"id,omitempty"` Name string `json:"name" valid:"Required;MaxSize(64)"` Type CustomerType `json:"type" valid:"Required"` Email string `json:"email" valid:"Required;Email"` Code string `json:"code" valid:"MaxSize(52)"` // código na plataforma Document string `json:"document" valid:"MaxSize(50)"` DocumentType DocumentType `json:"document_type"` Gender Gender `json:"gender"` Delinquent bool `json:"delinquent"` Address *Address `json:"address"` Phones *Phones `json:"phones"` Birthdate string `json:"birthdate"` Metadata map[string]string `json:"metadata"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` }
func NewCustomer ¶
func NewCustomer() *Customer
type CustomerPtr ¶
type CustomerPtr = *Customer
type CustomerQuery ¶
type CustomerQuery struct { Name string `jsonp:"name,omitempty"` Document string `jsonp:"document,omitempty"` Email string `jsonp:"email,omitempty"` Code string `jsonp:"code,omitempty"` Gender Gender `jsonp:"gender,omitempty"` Page int `jsonp:"page,omitempty"` Size int `jsonp:"size,omitempty"` }
func NewCustomerQuery ¶
func NewCustomerQuery() *CustomerQuery
func (*CustomerQuery) UrlQuery ¶
func (this *CustomerQuery) UrlQuery() string
func (*CustomerQuery) WithDocument ¶
func (this *CustomerQuery) WithDocument(doc string) *CustomerQuery
type CustomerType ¶
type CustomerType string
const ( Individual CustomerType = "individual" Company CustomerType = "company" )
type Customers ¶
type Customers = []CustomerPtr
type Cycle ¶
type Cycle struct { Id string `json:"id"` BillingAt string `json:"billing_at"` Cycle int64 `json:"cycle"` StartAt string `json:"start_at"` EndAt string `json:"end_at"` Duration int64 `json:"duration"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Status string `json:"status"` }
type Discount ¶
type Discount struct { Value int64 `json":"value"` Cycles int64 `json":"cycles"` IncrementType OperationType `json:"increment_type,omitempty"` }
type DocumentType ¶
type DocumentType string
const ( CPF DocumentType = "CPF" CNPJ DocumentType = "CNPJ" PASSPORT DocumentType = "PASSPORT" )
type ErrorResponse ¶
type ErrorResponse struct { Message string `json:"message"` Errors map[string][]string `json:"errors"` StatusCode int64 }
func NewErrorResponse ¶
func NewErrorResponse(msg string) *ErrorResponse
func NewErrorResponseWithErrors ¶
func NewErrorResponseWithErrors(msg string, errors map[string][]string) *ErrorResponse
func (*ErrorResponse) Error ¶
func (this *ErrorResponse) Error() string
func (*ErrorResponse) String ¶
func (this *ErrorResponse) String() string
func (*ErrorResponse) ToMapOfString ¶
func (this *ErrorResponse) ToMapOfString() map[string]string
type Fine ¶
type Fine struct { Days int64 `json:"days" valid:"Required"` Type OperationType `json:"type" valid:"Required"` Amount int64 `json:"amount" valid:"Required"` // Valor em porcentagem ou em centavos da taxa de juros que será cobrada ao mês. }
type GatewayResponse ¶
type Increment ¶
type Increment struct { Value int64 `json":"value"` Cycles int64 `json":"cycles"` IncrementType OperationType `json:"increment_type,omitempty"` }
type Interest ¶
type Interest struct { Days int64 `json:"days" valid:"Required"` Type OperationType `json:"type" valid:"Required"` Amount int64 `json:"amount" valid:"Required"` // Valor em porcentagem ou em centavos da taxa de juros que será cobrada ao mês. }
type IntervalCount ¶
type IntervalCount int64
/Ex .: monthly plan = interval_count (1) and interval month /quarterly plan = interval_count (3) and interval month /Semi-annual plan = interval_count (6) and interval month
type Invoice ¶
type Invoice struct { Id string `json:"id,omitempty"` Url string `json:"url,omitempty"` Code string `json:"code,omitempty"` Amount int64 `json:"amount"` PaymentMethod PaymentMethod `json:"payment_method"` Installments int64 `json:"installments"` Status InvoiceStatus `json:"status"` BillingAt string `json:"billing_at"` DueAt string `json:"due_at"` SeenAt string `json:"seen_at"` CreatedAt string `json:"created_at"` CanceledAt string `json:"canceled_at"` TotalDiscounts int64 `json:"total_discounts"` TotalIncrements int64 `json:"total_increments"` SubscriptionId string `json:"subscriptionId"` Items []*InvoiceItem `json:"items"` Customer *Customer `json:"customer"` Subscription *Subscription `json:"subscription"` Cycle *Cycle `json:"cycle"` Charge *Charge `json:"charge"` }
func (*Invoice) ToPaymentStatus ¶
func (this *Invoice) ToPaymentStatus() api.PaymentStatus
type InvoiceItem ¶
type InvoiceItem struct { Name string `json:"name"` Amount int64 `json:"amount"` Quantity int64 `json:"quantity"` Description string `json:"description"` }
The object invoice representa os documentos gerados automaticamente ao final de cada ciclo de uma assinatura, discriminando todos os valores referentes à assinatura, como itens e descontos, para realização da cobrança do assinante.
type InvoicePtr ¶
type InvoicePtr = *Invoice
type InvoiceQuery ¶
type InvoiceQuery struct { Status InvoiceStatus `jsonp:"status,omitempty"` CustomerId string `jsonp:"customer_id,omitempty"` SubscriptionId string `jsonp:"subscription_id,omitempty"` DueSince time.Time `jsonp:"due_since,date,omitempty"` DueUntil time.Time `jsonp:"due_until,date,omitempty"` CreatedSince time.Time `jsonp:"created_since,date,omitempty"` CreatedUntil time.Time `jsonp:"created_until,date,omitempty"` Page int `jsonp:"page,omitempty"` Size int `jsonp:"size,omitempty"` }
func NewInvoiceQuery ¶
func NewInvoiceQuery() *InvoiceQuery
func (*InvoiceQuery) UrlQuery ¶
func (this *InvoiceQuery) UrlQuery() string
type InvoiceStatus ¶
type InvoiceStatus string
const ( InvoicePending InvoiceStatus = "pending" InvoicePaid InvoiceStatus = "paid" InvoiceCanceled InvoiceStatus = "canceled" InvoiceScheduled InvoiceStatus = "scheduled" InvoiceFailed InvoiceStatus = "failed" )
type Invoices ¶
type Invoices = []InvoicePtr
type LastTransaction ¶
type LastTransaction struct { Id string `json:"id"` TransactionType string `json:"transaction_type"` GatewayId string `json:"gateway_id"` Amount int64 `json:"amount"` PaidAmount int64 `json:"paid_amount"` Status api.PagarmeV5Status `json:"status"` Success bool `json:"success"` Installments int64 `json:"installments"` StatementDescriptor string `json:"statement_descriptor"` AcquirerName string `json:"acquirer_name"` AcquirerTID string `json:"acquirer_tid"` AcquirerNSU string `json:"acquirer_nsu"` AcquirerAuthCode string `json:"acquirer_auth_code"` AcquirerMessage string `json:"acquirer_message"` AcquirerReturnCode string `json:"acquirer_return_code"` OperationType string `json:"operation_type"` Card *Card `json:"card"` FundingSource string `json:"funding_source"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` DueAt string `json:"due_at"` GatewayResponse *GatewayResponse `json:"gateway_response"` AntifraudResponse *AntifraudResponse `json:"antifraud_response"` Metadata map[string]string `json:"metadata"` Url string `json:"url,omitempty"` Pdf string `json:"pdf,omitempty"` Line string `json:"line,omitempty"` Barcode string `json:"barcode,omitempty"` QrCode string `json:"qr_code,omitempty"` QrCodeUrl string `json:"qr_code_url,omitempty"` ExpiresAt string `json:"expires_at,omitempty"` NossoNumero string `json:"nosso_numero,omitempty"` }
func (*LastTransaction) GetPayZenSOAPStatus ¶
func (this *LastTransaction) GetPayZenSOAPStatus() api.TransactionStatus
type LastTransactionPtr ¶
type LastTransactionPtr = *LastTransaction
type MovementObject ¶
type MovementObject struct { Fee int64 `json:"fee"` AnticipationFee int64 `json:"anticipation_fee"` FraudCoverageFee int64 `json:"fraud_coverage_fee"` RecipientId string `json:"recipient_id"` OriginatorModel string `json:"originator_model"` OriginatorModelId string `json:"originator_model_id"` PaymentDate string `json:"payment_date"` PaymentMethod string `json:"payment_method"` Object string `json:"object"` Id string `json:"id"` Status string `json:"status"` Amount int64 `json:"amount"` CreatedAt string `json:"created_at"` Type string `json:"type"` GatewayId string `json:"gateway_id"` }
type OperationType ¶
type OperationType string
const ( Percentage OperationType = "percentage" Flat OperationType = "flat" )
const ( AuthAndCapture OperationType = "auth_and_capture" AuthOnly OperationType = "auth_only" PreAuth OperationType = "pre_auth" )
type Order ¶
type Order struct { Code string `json:"code" valid:"Required;MaxSize(64)"` Customer *Customer `json:"customer"` CustomerId string `json:"customer_id,omitempty"` Items []*OrderItem `json:"items"` Payments []*Payment `json:"payments"` Closed bool `json:"closed"` // Informa se o pedido será criado aberto ou fechado. Ip string `json:"ip" valid:"Required"` SessionId string `json:"session_id"` AntifraudEnabled bool `json:"antifraud_enabled"` Id string `json:"id,omitempty"` Amount int64 `json:"amount,omitempty"` Status string `json:"status,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` Charges []*Charge `json:"charges,omitempty"` Checkouts []*Checkout `json:"checkouts,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` }
func (*Order) AddPayment ¶
func (this *Order) AddPayment(amount int64, method PaymentMethod) *Order
func (*Order) GetChargeId ¶
func (*Order) GetLastTransaction ¶
func (this *Order) GetLastTransaction() *optional.Optional[LastTransactionPtr]
func (*Order) GetPayZenSOAPStatus ¶
func (this *Order) GetPayZenSOAPStatus() api.TransactionStatus
func (*Order) GetPayment ¶
func (*Order) GetStatus ¶
func (this *Order) GetStatus() api.PagarmeV5Status
func (*Order) GetTranscationId ¶
func (*Order) HasCardIdOrToken ¶
func (*Order) IsCreditCard ¶
func (*Order) WithBoleto ¶
func (*Order) WithCreditCard ¶
func (this *Order) WithCreditCard(cb func(*CreditCard)) *Order
type OrderItem ¶
type OrderItem struct { Id string `json:"id,omitempty"` Type string `json:"type,omitempty"` Amount int64 `json:"amount"` Description string `json:"description"` Quantity int64 `json:"quantity"` Code string `json:"code" valid:"Required"` // // código na plataforma Status string `json:"status,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` }
type OrderQuery ¶
type OrderQuery struct { Code string `jsonp:"code,omitempty"` CustomerId string `jsonp:"customer_id,omitempty"` Status Status `jsonp:"status,omitempty"` CreatedSince time.Time `jsonp:"created_since,date,omitempty"` CreatedUntil time.Time `jsonp:"created_until,date,omitempty"` Page int `jsonp:"page,omitempty"` Size int `jsonp:"size,omitempty"` }
func NewOrderQuery ¶
func NewOrderQuery() *OrderQuery
func (*OrderQuery) UrlQuery ¶
func (this *OrderQuery) UrlQuery() string
type Pagarme ¶
type Pagarme struct { Auth *Authentication Lang string EntityValidator *validator.EntityValidator EntityValidatorResult *validator.EntityValidatorResult ValidationErrors map[string]string HasValidationError bool Debug bool ServiceRefererName ServiceRefererName }
func NewPagarme ¶
func NewPagarme(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *Pagarme
func (*Pagarme) SetValidationError ¶
type PagarmeApi ¶
type PagarmeApi struct { Card *PagarmeCard Customer *PagarmeCustomer Order *PagarmeOrder Plan *PagarmePlan Subscription *PagarmeSubscription Invoice *PagarmeInvoice Charge *PagarmeCharge Recipient *PagarmeRecipient ServiceRefererName ServiceRefererName }
func NewPagarmeApi ¶
func NewPagarmeApi(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *PagarmeApi
func (*PagarmeApi) DebugOn ¶
func (this *PagarmeApi) DebugOn()
type PagarmeCard ¶
type PagarmeCard struct {
Pagarme
}
func NewPagarmeCard ¶
func NewPagarmeCard(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *PagarmeCard
func (*PagarmeCard) Create ¶
func (this *PagarmeCard) Create(customerId string, card CardPtr) *either.Either[*ErrorResponse, SuccessCard]
func (*PagarmeCard) Delete ¶
func (this *PagarmeCard) Delete(customerId string, cardId string) *either.Either[*ErrorResponse, SuccessBool]
func (*PagarmeCard) Get ¶
func (this *PagarmeCard) Get(customerId string, cardId string) *either.Either[*ErrorResponse, SuccessCard]
func (*PagarmeCard) List ¶
func (this *PagarmeCard) List(customerId string) *either.Either[*ErrorResponse, SuccessCards]
func (*PagarmeCard) Renew ¶
func (this *PagarmeCard) Renew(customerId string, cardId string) *either.Either[*ErrorResponse, SuccessBool]
func (*PagarmeCard) Update ¶
func (this *PagarmeCard) Update(customerId string, card CardPtr) *either.Either[*ErrorResponse, SuccessCard]
type PagarmeCharge ¶
type PagarmeCharge struct {
Pagarme
}
func NewPagarmeCharge ¶
func NewPagarmeCharge(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *PagarmeCharge
func (*PagarmeCharge) Cancel ¶
func (this *PagarmeCharge) Cancel(chargeId string) *either.Either[*ErrorResponse, SuccessCharge]
func (*PagarmeCharge) Capture ¶
func (this *PagarmeCharge) Capture(id string, code string) *either.Either[*ErrorResponse, SuccessCharge]
func (*PagarmeCharge) ConfirmPayment ¶
func (this *PagarmeCharge) ConfirmPayment(chargeId string, opts ...*ChargePaymentConfirm) *either.Either[*ErrorResponse, SuccessCharge]
func (*PagarmeCharge) Get ¶
func (this *PagarmeCharge) Get(chargeId string) *either.Either[*ErrorResponse, SuccessCharge]
func (*PagarmeCharge) List ¶
func (this *PagarmeCharge) List(query *ChargeQuery) *either.Either[*ErrorResponse, SuccessCharges]
func (*PagarmeCharge) ListPending ¶
func (this *PagarmeCharge) ListPending(orderId string, size int) *either.Either[*ErrorResponse, SuccessCharges]
func (*PagarmeCharge) Retry ¶
func (this *PagarmeCharge) Retry(chargeId string) *either.Either[*ErrorResponse, SuccessCharge]
func (*PagarmeCharge) UpdateCard ¶
func (this *PagarmeCharge) UpdateCard(chargeId string, updateData ChargeUpdate) *either.Either[*ErrorResponse, SuccessCharge]
func (*PagarmeCharge) UpdateDueDate ¶
func (this *PagarmeCharge) UpdateDueDate(chargeId string, dueDate time.Time) *either.Either[*ErrorResponse, SuccessCharge]
type PagarmeCustomer ¶
type PagarmeCustomer struct {
Pagarme
}
func NewPagarmeCustomer ¶
func NewPagarmeCustomer(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *PagarmeCustomer
func (*PagarmeCustomer) Create ¶
func (this *PagarmeCustomer) Create(customer CustomerPtr) *either.Either[*ErrorResponse, SuccessCustomer]
func (*PagarmeCustomer) Get ¶
func (this *PagarmeCustomer) Get(customerId string) *either.Either[*ErrorResponse, SuccessCustomer]
func (*PagarmeCustomer) List ¶
func (this *PagarmeCustomer) List(query *CustomerQuery) *either.Either[*ErrorResponse, SuccessCustomers]
func (*PagarmeCustomer) Update ¶
func (this *PagarmeCustomer) Update(customer CustomerPtr) *either.Either[*ErrorResponse, SuccessCustomer]
type PagarmeInvoice ¶
type PagarmeInvoice struct {
Pagarme
}
func NewPagarmeInvoice ¶
func NewPagarmeInvoice(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *PagarmeInvoice
func (*PagarmeInvoice) Cancel ¶
func (this *PagarmeInvoice) Cancel(id string) *either.Either[*ErrorResponse, SuccessBool]
func (*PagarmeInvoice) Get ¶
func (this *PagarmeInvoice) Get(id string) *either.Either[*ErrorResponse, SuccessInvoice]
func (*PagarmeInvoice) List ¶
func (this *PagarmeInvoice) List(query *InvoiceQuery) *either.Either[*ErrorResponse, SuccessInvoices]
type PagarmeOrder ¶
type PagarmeOrder struct {
Pagarme
}
func NewPagarmeOrder ¶
func NewPagarmeOrder(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *PagarmeOrder
func (*PagarmeOrder) Create ¶
func (this *PagarmeOrder) Create(order OrderPtr) *either.Either[*ErrorResponse, SuccessOrder]
func (*PagarmeOrder) Get ¶
func (this *PagarmeOrder) Get(orderId string) *either.Either[*ErrorResponse, SuccessOrder]
func (*PagarmeOrder) List ¶
func (this *PagarmeOrder) List(query *OrderQuery) *either.Either[*ErrorResponse, SuccessOrders]
type PagarmePlan ¶
type PagarmePlan struct {
Pagarme
}
func NewPagarmePlan ¶
func NewPagarmePlan(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *PagarmePlan
func (*PagarmePlan) Create ¶
func (this *PagarmePlan) Create(plan *Plan) *either.Either[*ErrorResponse, SuccessPlan]
func (*PagarmePlan) Delete ¶
func (this *PagarmePlan) Delete(id string) *either.Either[*ErrorResponse, SuccessBool]
func (*PagarmePlan) Get ¶
func (this *PagarmePlan) Get(id string) *either.Either[*ErrorResponse, SuccessPlan]
func (*PagarmePlan) List ¶
func (this *PagarmePlan) List(query *PlanQuery) *either.Either[*ErrorResponse, SuccessPlans]
func (*PagarmePlan) Update ¶
func (this *PagarmePlan) Update(plan PlanPtr) *either.Either[*ErrorResponse, SuccessPlan]
type PagarmeRecipient ¶
type PagarmeRecipient struct {
Pagarme
}
func NewPagarmeRecipient ¶
func NewPagarmeRecipient(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *PagarmeRecipient
func (*PagarmeRecipient) Balance ¶
func (this *PagarmeRecipient) Balance(recipientId string) *either.Either[*ErrorResponse, SuccessBalance]
func (*PagarmeRecipient) BalanceOperations ¶
func (this *PagarmeRecipient) BalanceOperations(recipientId string, query *BalanceQuery) *either.Either[*ErrorResponse, SuccessBalanceOperations]
func (*PagarmeRecipient) Create ¶
func (this *PagarmeRecipient) Create(recipient *Recipient) *either.Either[*ErrorResponse, SuccessRecipient]
func (*PagarmeRecipient) CreateTransfer ¶
func (this *PagarmeRecipient) CreateTransfer(recipientId string, amount int64) *either.Either[*ErrorResponse, SuccessTransfer]
func (*PagarmeRecipient) GetTransfer ¶
func (this *PagarmeRecipient) GetTransfer(recipientId string, transferId string) *either.Either[*ErrorResponse, SuccessTransfer]
func (*PagarmeRecipient) Gt ¶
func (this *PagarmeRecipient) Gt(id string) *either.Either[*ErrorResponse, SuccessRecipient]
func (*PagarmeRecipient) List ¶
func (this *PagarmeRecipient) List() *either.Either[*ErrorResponse, SuccessRecipients]
func (*PagarmeRecipient) ListTransfers ¶
func (this *PagarmeRecipient) ListTransfers(recipientId string, query *TransferQuery) *either.Either[*ErrorResponse, SuccessTransfers]
func (*PagarmeRecipient) Update ¶
func (this *PagarmeRecipient) Update(id string, recipient *RecipientUpdate) *either.Either[*ErrorResponse, SuccessRecipient]
func (*PagarmeRecipient) UpdateBankAccount ¶
func (this *PagarmeRecipient) UpdateBankAccount(id string, account BankAccount) *either.Either[*ErrorResponse, SuccessBool]
func (*PagarmeRecipient) UpdateTransferSettings ¶
func (this *PagarmeRecipient) UpdateTransferSettings(id string, settings *TransferSettings) *either.Either[*ErrorResponse, SuccessBool]
type PagarmeSubscription ¶
type PagarmeSubscription struct {
Pagarme
}
func NewPagarmeSubscription ¶
func NewPagarmeSubscription(lang string, auth *Authentication, serviceRefererName ServiceRefererName) *PagarmeSubscription
func (*PagarmeSubscription) Cancel ¶
func (this *PagarmeSubscription) Cancel(id string, cancelPendingInvoices CancelPendingInvoices) *either.Either[*ErrorResponse, SuccessBool]
func (*PagarmeSubscription) Create ¶
func (this *PagarmeSubscription) Create(subscription SubscriptionPtr) *either.Either[*ErrorResponse, SuccessSubscription]
func (*PagarmeSubscription) Get ¶
func (this *PagarmeSubscription) Get(id string) *either.Either[*ErrorResponse, SuccessSubscription]
func (*PagarmeSubscription) List ¶
func (this *PagarmeSubscription) List(query *SubscriptionQuery) *either.Either[*ErrorResponse, SuccessSubscriptions]
func (*PagarmeSubscription) ListItems ¶
func (this *PagarmeSubscription) ListItems(id string) *either.Either[*ErrorResponse, SuccessSubscriptionItems]
func (*PagarmeSubscription) UpdateCard ¶
func (this *PagarmeSubscription) UpdateCard(updateData *SubscriptionUpdate) *either.Either[*ErrorResponse, SuccessBool]
func (*PagarmeSubscription) UpdateItem ¶
func (this *PagarmeSubscription) UpdateItem(subscriptionId string, itemId string, item SubscriptionItemPtr) *either.Either[*ErrorResponse, SuccessSubscriptionItem]
func (*PagarmeSubscription) UpdatePaymentMethod ¶
func (this *PagarmeSubscription) UpdatePaymentMethod(updateData *SubscriptionUpdate) *either.Either[*ErrorResponse, SuccessBool]
type Payment ¶
type Payment struct { PaymentMethod PaymentMethod `json:"payment_method"` CreditCard *CreditCard `json:"credit_card,omitempty"` Boleto *Boleto `json:"boleto,omitempty"` Pix *Pix `json:"pix,omitempty"` Amount int64 `json:"amount" valid:"Required"` }
func NewPayment ¶
func NewPayment(amount int64, method PaymentMethod) *Payment
func (*Payment) HasCardIdOrToken ¶
func (*Payment) IsCreditCard ¶
type PaymentMethod ¶
type PaymentMethod string
const ( MethodCreditCard PaymentMethod = "credit_card" MethodBoleto PaymentMethod = "boleto" MethodPix PaymentMethod = "pix" )
type Phone ¶
type Pix ¶
type Pix struct { ExpiresIn int64 `json:"expires_in,omitempty" ` //Data de expiração do Pix em segundos. ExpiresAt string `json:"expires_at,omitempty"` // Data de expiração do Pix [Formato: YYYY-MM-DDThh:mm:ss] UTC AdditionalInformation *AdditionalInformation `json:"additional_information,omitempty"` }
type Plan ¶
type Plan struct { Id string `json:"id"` Name string `json:"name" valid:"Required;MaxSize(64)"` Description string `json:"description" valid:""` Shippable bool `json:"shippable"` PaymentMethods []PaymentMethod `json:"payment_methods"` // Opções de parcelamento disponíveis para assinaturas criadas a partir do plano. Installments []int64 `json:"installments,omitempty"` MinimumPrice int64 `json:"int64,omitempty"` StatementDescriptor string `json:"statement_descriptor" valid:"MaxSize(13)"` Currency Currency `json:"currency"` Interval Interval `json:"interval"` /** Número de intervalos de acordo com a propriedade interval entre cada cobrança da assinatura. Ex.: plano mensal = interval_count (1) e interval (month) plano trimestral = interval_count (3) e interval (month) plano semestral = interval_count (6) e interval (month) */ IntervalCount IntervalCount `json:"interval_count"` TrialPeriodDays int64 `json:"trial_period_days,omitempty"` BillingType BillingType `json:"billing_type" valid:"Required"` /** Dias disponíveis para cobrança das assinaturas criadas a partir do plano. Deve ser maior ou igual a 1 e menor ou igual a 28. Obrigatório, caso o billing_type seja igual a exact_day. */ BillingDays []int64 `json:"billing_days,omitempty"` Items []*PlanItem `json:"items"` Metadata map[string]string `json:"metadata,omitempty"` PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` /** Quantidade para o pricing_scheme. Obrigatório quando o pricing_scheme.scheme_type for igual a unit. */ Quantity Quantity `json:"quantity"` Status Status `json:"status,omitempty"` }
func (*Plan) AddPaymentMethod ¶
func (this *Plan) AddPaymentMethod(methods ...PaymentMethod) *Plan
func (*Plan) AddPlanItem ¶
func (*Plan) GetIntervalRule ¶
func (this *Plan) GetIntervalRule() api.SubscriptionCycle
func (*Plan) SetIntervalRule ¶
func (this *Plan) SetIntervalRule(interval Interval, count IntervalCount) *Plan
func (*Plan) SetPricingScheme ¶
func (this *Plan) SetPricingScheme(scheme *PricingScheme) *Plan
type PlanItem ¶
type PlanItem struct { Id string `json:"id"` Name string `json:"name"` Description string `json:"description"` // Quantidade de itens. Quantity Quantity `json:"quantity"` //Indicates how many times the item will be charged. /** Número de ciclos durante o qual o item será cobrado. Ex: Um item com cycles = 1 representa que um item será cobrado apenas uma vez. Caso não seja informado, o item será cobrado até que seja desativado. */ Cycles CycleCount `json:"cycles,omitempty"` Interval Interval `json:"interval,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` DeletedAt string `json:"deleted_at,omitempty"` PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` Status Status `json:"status,omitempty"` Plan *Plan `json:"plan"` }
func NewPlanItem ¶
func NewPlanItem(name string, quantity Quantity, cycles CycleCount, price int64) *PlanItem
type PlanQuery ¶
type PlanQuery struct { Name string `jsonp:"name,omitempty"` Status Status `jsonp:"status,omitempty"` CreatedSince time.Time `jsonp:"created_since,date,omitempty"` CreatedUntil time.Time `jsonp:"created_until,date,omitempty"` Page int `jsonp:"page,omitempty"` Size int `jsonp:"size,omitempty"` }
func NewPlanQuery ¶
func NewPlanQuery() *PlanQuery
type PricingScheme ¶
type PricingScheme struct { Price int64 `json:"price"` MininumPrice int64 `json:"mininum_price,omitempty"` SchemeType SchemeType `json:"scheme_type,omitempty"` }
func NewPricingScheme ¶
func NewPricingScheme(price int64) *PricingScheme
type Recipient ¶
type Recipient struct { Id string `json:"id,omitempty"` Name string `json:"name" valid:"Required;MaxSize(128)"` Email string `json:"email" valid:"Required;MaxSize(64)"` Description string `json:"description" valid:"Required;MaxSize(256)"` Document string `json:"document" valid:"Required;MaxSize(16)"` Type CustomerType `json:"type" valid:"Required"` Code string `json:"code" valid:"Required"` TransferSettings *TransferSettings `json:"transfer_settings" valid:"Required"` DefaultBankAccount BankAccount `json:"default_bank_account" valid:"Required"` Metadata map[string]string `json:"metadata"` }
The object recipient represents a receiver, which will receive part of the sale made.
type RecipientPtr ¶
type RecipientPtr = *Recipient
type RecipientUpdate ¶
type RecipientUpdate struct { Email string `json:"email" valid:"Required;MaxSize(64)"` Description string `json:"description" valid:"Required;MaxSize(256)"` Type CustomerType `json:"type" valid:"Required"` }
type Recipients ¶
type Recipients = []RecipientPtr
type Response ¶
type Response struct { Error *ErrorResponse Content interface{} RawResponse string RawRequest string StatusCode int }
func NewResponse ¶
func NewResponse() *Response
func (*Response) GetMessage ¶
type ResponseParser ¶
type SchemeType ¶
type SchemeType string
const ( Unit SchemeType = "unit" Package SchemeType = "package" Volume SchemeType = "volume" Tier SchemeType = "tier" )
type ServiceRefererName ¶
type ServiceRefererName string
type Subscription ¶
type Subscription struct { Id string `json:"id,omitempty"` Code string `json:"code,omitempty" valid:"MaxSize(52)"` PlanId string `json:"plan_id,omitempty"` Status Status `json:"status,omitempty"` PaymentMethod PaymentMethod `json:"payment_method" valid:"Required"` Currency Currency `json:"currency"` StartAt string `json:"start_at" valid:"Required"` Interval Interval `json:"interval" valid:"Required"` MinimumPrice int64 `json:"minimum_price" valid:""` IntervalCount IntervalCount `json:"interval_count" valid:"Required"` BillingType BillingType `json:"billing_type" valid:"Required"` BillingDay int64 `json:"billing_day,omitempty" valid:""` Installments int64 `json:"installments" valid:""` StatementDescriptor string `json:"statement_descriptor" valid:"Required;MaxSize(13)"` Customer *Customer `json:"customer,omitempty"` CustomerId string `json:"customer_id,omitempty"` Discounts []*Discount `json:"discounts,omitempty"` Increments []*Increment `json:"increments,omitempty"` Items []*SubscriptionItem `json:"items"` Card *Card `json:"card"` CardId string `json:"card_id"` CardToken string `json:"card_token"` BoletoDueDays int64 `json:"boleto_due_days"` Metadata map[string]string `json:"metadata"` Description string `json:"description"` PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` Quantity Quantity `json:"quantity"` Boleto *Boleto `json:"boleto,omitempty"` }
func NewSubscription ¶
func NewSubscription() *Subscription
func (*Subscription) AddItem ¶
func (this *Subscription) AddItem(items ...*SubscriptionItem) *Subscription
func (*Subscription) HasCardIdOrToken ¶
func (this *Subscription) HasCardIdOrToken() bool
func (*Subscription) SetIntervalRule ¶
func (this *Subscription) SetIntervalRule(interval Interval, intervalCount IntervalCount) *Subscription
func (*Subscription) SetPricingScheme ¶
func (this *Subscription) SetPricingScheme(scheme *PricingScheme) *Subscription
func (*Subscription) SetStartAt ¶
func (this *Subscription) SetStartAt(date time.Time) *Subscription
func (*Subscription) WithCard ¶
func (this *Subscription) WithCard(card CardPtr) *Subscription
func (*Subscription) WithCustomer ¶
func (this *Subscription) WithCustomer(customer CustomerPtr) *Subscription
func (*Subscription) WithPlanId ¶
func (this *Subscription) WithPlanId(planId string) *Subscription
type SubscriptionItem ¶
type SubscriptionItem struct { Id string `json:"id,omitempty"` Description string `json:"description,omitempty"` Cycles CycleCount `json:"cycles,omitempty"` Quantity Quantity `json:"quantity"` Status Status `json:"status,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` DeletedAt string `json:"deleted_at,omitempty"` Discounts []*Discount `json:"discounts,omitempty"` Increments []*Increment `json:"increments,omitempty"` PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` Name string `json:"name"` }
func NewSubscriptionItem ¶
func NewSubscriptionItem(description string, quantity Quantity, cycles CycleCount) *SubscriptionItem
func (*SubscriptionItem) SetPricingScheme ¶
func (this *SubscriptionItem) SetPricingScheme(scheme *PricingScheme) *SubscriptionItem
type SubscriptionItemPtr ¶
type SubscriptionItemPtr = *SubscriptionItem
type SubscriptionItems ¶
type SubscriptionItems = []SubscriptionItemPtr
type SubscriptionPtr ¶
type SubscriptionPtr = *Subscription
type SubscriptionQuery ¶
type SubscriptionQuery struct { Status Status `jsonp:"status,omitempty"` Code string `jsonp:"code,omitempty"` BillingType BillingType `jsonp:"billing_type,omitempty"` CustomerId string `jsonp:"customer_id,omitempty"` PlanId string `jsonp:"plan_id,omitempty"` CardId string `jsonp:"card_id,omitempty"` NextBillingSince time.Time `jsonp:"next_billing_since,date,omitempty"` NextBillingUntil time.Time `jsonp:"next_billing_until,date,omitempty"` CreatedSince time.Time `jsonp:"created_since,date,omitempty"` CreatedUntil time.Time `jsonp:"created_until,date,omitempty"` Page int `jsonp:"page,omitempty"` Size int `jsonp:"size,omitempty"` }
func NewSubscriptionQuery ¶
func NewSubscriptionQuery() *SubscriptionQuery
func (*SubscriptionQuery) UrlQuery ¶
func (this *SubscriptionQuery) UrlQuery() string
type SubscriptionUpdate ¶
type SubscriptionUpdate struct { Id string Card *Card `json:"card,omitempty"` CardId string `json:"card_id,omitempty"` CardToken string `json:"card_token,omitempty"` PaymentMethod PaymentMethod `json:"payment_method,omitempty"` }
func NewSubscriptionUpdate ¶
func NewSubscriptionUpdate(id string) *SubscriptionUpdate
type Subscriptions ¶
type Subscriptions = []SubscriptionPtr
type SuccessBalance ¶
type SuccessBalance = *Success[BalancePtr]
type SuccessBalanceOperations ¶
type SuccessBalanceOperations = *Success[BalanceOperations]
type SuccessBool ¶
type SuccessCard ¶
type SuccessCards ¶
type SuccessCharge ¶
type SuccessCharges ¶
type SuccessCustomer ¶
type SuccessCustomer = *Success[CustomerPtr]
type SuccessCustomers ¶
type SuccessInvoice ¶
type SuccessInvoice = *Success[InvoicePtr]
type SuccessInvoices ¶
type SuccessOrder ¶
type SuccessOrders ¶
type SuccessPlan ¶
type SuccessPlans ¶
type SuccessRecipient ¶
type SuccessRecipient = *Success[RecipientPtr]
type SuccessRecipients ¶
type SuccessRecipients = *Success[Recipients]
type SuccessSubscription ¶
type SuccessSubscription = *Success[SubscriptionPtr]
type SuccessSubscriptionItem ¶
type SuccessSubscriptionItem = *Success[SubscriptionItemPtr]
type SuccessSubscriptionItems ¶
type SuccessSubscriptionItems = *Success[SubscriptionItems]
type SuccessSubscriptions ¶
type SuccessSubscriptions = *Success[Subscriptions]
type SuccessTransfer ¶
type SuccessTransfer = *Success[TransferPtr]
type SuccessTransfers ¶
type TransferInterval ¶
type TransferInterval string
const ( Daily TransferInterval = "daily" Weekly TransferInterval = "weekly" Monthly TransferInterval = "monthly" )
type TransferPtr ¶
type TransferPtr = *Transfer
type TransferQuery ¶
type TransferQuery struct { Status ChargeStatus `jsonp:"status,omitempty"` CreatedSince time.Time `jsonp:"created_since,date,omitempty"` CreatedUntil time.Time `jsonp:"created_until,date,omitempty"` Page int `jsonp:"page,omitempty"` Size int `jsonp:"size,omitempty"` }
func NewTransferQuery ¶
func NewTransferQuery() *TransferQuery
func (*TransferQuery) UrlQuery ¶
func (this *TransferQuery) UrlQuery() string
type TransferSettings ¶
type TransferSettings struct { TransferEnabled bool `json:"transfer_enabled"` TransferInterval TransferInterval `json:"transfer_interval"` TransferDay int64 `json:"transfer_day,omitempty"` }
type Transfers ¶
type Transfers = []TransferPtr
type Webhook ¶
type Webhook struct { JsonParser *support.JsonParser Debug bool EntityValidator *validator.EntityValidator ValidationErrors map[string]string HasValidationError bool }
func NewDefaultWebhook ¶
func NewDefaultWebhook() *Webhook
func NewWebhook ¶
type WebhookData ¶
type WebhookData struct { Id string `json:"id" valid:"Required"` Event WebhookEvent `json:"event" valid:"Required"` Status string `json:"status" valid:""` Raw string `json:"raw" valid:"Required"` PayloadMap map[string]interface{} }
func NewWebhookData ¶
func NewWebhookData() *WebhookData
func (*WebhookData) IsCharge ¶
func (this *WebhookData) IsCharge() bool
func (*WebhookData) IsOrder ¶
func (this *WebhookData) IsOrder() bool
func (*WebhookData) IsSubscription ¶
func (this *WebhookData) IsSubscription() bool
func (*WebhookData) IsSubscriptionItem ¶
func (this *WebhookData) IsSubscriptionItem() bool
type WebhookEvent ¶
type WebhookEvent string
const ( EventCustomerCreated WebhookEvent = "customer.created" // Occurs whenever a customer is created. EventCustomerUpdated WebhookEvent = "customer.updated" // Occurs whenever a customer is updated. EventCardCreated WebhookEvent = "card.created" // Occurs whenever a card is created. EventCardUpdated WebhookEvent = "card.updated" // Occurs whenever a card is updated. EventCardDeleted WebhookEvent = "card.deleted" // Occurs whenever a card is deleted. EventAddressCreated WebhookEvent = "address.created" // Occurs whenever an address is created. EventAddressUpdated WebhookEvent = "address.updated" // Occurs whenever an address is updated. EventAddressDeleted WebhookEvent = "address.deleted" // Occurs whenever an address is deleted. EventCardExpired WebhookEvent = "card.expired" // Occurs whenever a card expires by the expiration date. EventPlanCreated WebhookEvent = "plan.created" // Occurs whenever a plan is created. EventPlanUpdated WebhookEvent = "plan.updated" // Occurs whenever a plan is updated. EventPlanDeleted WebhookEvent = "plan.deleted" // Occurs whenever a plan is deleted. EventPlanItemCreated WebhookEvent = "plan_item.created" // Occurs whenever a plan item is created. EventPlanItemUpdated WebhookEvent = "plan_item.updated" // Occurs whenever a plan item is updated. EventPlanItemDeleted WebhookEvent = "plan_item.deleted" // Occurs whenever a plan item is deleted. EventSubscriptionCreated WebhookEvent = "subscription.created" // Occurs whenever a subscription is created. EventSubscriptionCanceled WebhookEvent = "subscription.canceled" // Occurs whenever the subscription is canceled. EventSubscriptionItemCreated WebhookEvent = "subscription_item.created" // Occurs whenever a subscription item is created. EventSubscriptionItemUpdated WebhookEvent = "subscription_item.updated" // Occurs whenever a subscription item is updated. EventSubscriptionItemDeleted WebhookEvent = "subscription_item.deleted" // Occurs whenever a subscription item is deleted. EventDiscountCreated WebhookEvent = "discount.created" // Occurs whenever a discount is created. EventDiscountDeleted WebhookEvent = "discount.deleted" // Occurs whenever a discount is deleted. EventIncrementCreated WebhookEvent = "increment.created" // Occurs whenever an increment is created. EventIncrementDeleted WebhookEvent = "increment.deleted" // Occurs whenever an increment is deleted. EventOrderPaid WebhookEvent = "order.paid" // Occurs whenever an order is paid. EventOrderPaymentFailed WebhookEvent = "order.payment_failed" // Occurs whenever payment for an order fails. EventOrderCreated WebhookEvent = "order.created" // Occurs whenever a order is created. EventOrderCanceled WebhookEvent = "order.canceled" // Occurs whenever an order is canceled. EventOrderItemCreated WebhookEvent = "order_item.created" // Occurs whenever an order item is created. EventOrderItemUpdated WebhookEvent = "order_item.updated" // Occurs whenever an order item is updated. EventOrderItemDeleted WebhookEvent = "order_item.deleted" // Occurs whenever an order item is deleted. EventOrderClosed WebhookEvent = "order.closed" // Occurs whenever a request is closed. EventOrderUpdated WebhookEvent = "order.updated" // Occurs whenever a order is updated. EventInvoiceCreated WebhookEvent = "invoice.created" // Occurs whenever an invoice is created. EventInvoiceUpdated WebhookEvent = "invoice.updated" // Occurs whenever an invoice is updated. EventInvoicePaid WebhookEvent = "invoice.paid" // Occurs whenever an invoice is paid. EventInvoicePaymentFailed WebhookEvent = "invoice.payment_failed" // Occurs when an invoice payment fails. EventInvoiceCanceled WebhookEvent = "invoice.canceled" // Occurs whenever an invoice is canceled EventChargeCreated WebhookEvent = "charge.created" // Occurs whenever a charge is created. EventChargeUpdated WebhookEvent = "charge.updated" // Occurs when a charge is updated. EventChargePaid WebhookEvent = "charge.paid" // Occurs whenever a charge is paid. EventChargePaymentFailed WebhookEvent = "charge.payment_failed" // Occurs when a charge for a charge fails. EventChargeRefunded WebhookEvent = "charge.refunded" // Occurs whenever a charge is reversed. EventChargePending WebhookEvent = "charge.pending" // Occurs whenever a charge is pending. EventChargeProcessing WebhookEvent = "charge.processing" // Occurs whenever a charge is still being processed. EventChargeUnderpaid WebhookEvent = "charge.underpaid" // Occurs whenever a charge has been underpaid. EventChargeOverpaid WebhookEvent = "charge.overpaid" // Occurs whenever a charge has been overpaid. EventChargePartialCanceled WebhookEvent = "charge.partial_canceled" // Occurs when a charge has been partially canceled. EventChargeChargedback WebhookEvent = "charge.chargedback" // Ocorre sempre que uma cobrança sofre chargeback. EventUsageCreated WebhookEvent = "usage.created" // Occurs whenever the usage of an item in the period is created. EventUsageDeleted WebhookEvent = "usage.deleted" // Occurs whenever the usage of an item in the period is deleted. EventRecipientCreated WebhookEvent = "recipient.created" // Occurs whenever a recipient is created. EventRecipientDeleted WebhookEvent = "recipient.deleted" // Occurs whenever a recipient is deleted. EventRecipientUpdated WebhookEvent = "recipient.updated" // Occurs whenever a recipient is updated. EventBankAccountCreated WebhookEvent = "bank_account.created" // Occurs whenever a bank account is created. EventBankAccountUpdated WebhookEvent = "bank_account.updated" // Occurs whenever a bank account is updated. EventBankAccountDeleted WebhookEvent = "bank_account.deleted" // Occurs whenever a bank account is deleted. EventSellerCreated WebhookEvent = "seller.created" // Occurs whenever a salesperson is created. EventSellerUpdated WebhookEvent = "seller.updated" // Occurs whenever a seller is edited. EventSellerDeleted WebhookEvent = "seller.deleted" // Occurs whenever a seller is deleted. EventTransferPending WebhookEvent = "transfer.pending" // Occurs whenever a transfer is pending. EventTransferCreated WebhookEvent = "transfer.created" // Occurs whenever a transfer is created. EventTransferProcessing WebhookEvent = "transfer.processing" // Occurs whenever a transfer is in process. EventTransferPaid WebhookEvent = "transfer.paid" // It occurs whenever a transfer is paid. EventTransferCanceled WebhookEvent = "transfer.canceled" // Occurs whenever a transfer is canceled. EventTransferFailed WebhookEvent = "transfer.failed" // Occurs whenever a transfer fails. EventCheckoutCreated WebhookEvent = "checkout.created" // Occurs when a checkout is created. EventCheckoutCanceled WebhookEvent = "checkout.canceled" // Occurs when a checkout is canceled. EventCheckoutClosed WebhookEvent = "checkout.closed" // Ocorre quando um checkout é fechado. EventChargeAntifraudApproved WebhookEvent = "charge.antifraud_approved" // Occurs when an anti-fraud order is approved. EventChargeAntifraudReproved WebhookEvent = "charge.antifraud_reproved" // It occurs when an anti-fraud order is disapproved. EventChargeAntifraudManual WebhookEvent = "charge.antifraud_manual" // Occurs when an order in anti-fraud is marked for manual analysis. EventChargeAntifraudPending WebhookEvent = "charge.antifraud_pending" // It occurs when an order is pending to be sent for analysis by the anti-fraud service. )
type WebhookObject ¶
type WebhookObject[T any] struct { Id string `json:"id"` Account *Account `json:"account"` Type WebhookEvent `json:"type"` CreatedAt string `json:"created_at"` Data T `json:"data"` }
type WebhookStatus ¶
type WebhookStatus string
const ( WebhookPending WebhookStatus = "pending" WebhookSent WebhookStatus = "sent" WebhookFailed WebhookStatus = "failed" )
Click to show internal directories.
Click to hide internal directories.