echargeSDK

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreditCardHolderInfo

type CreditCardHolderInfo struct {
	Name              string `json:"name" bson:"name"`
	Email             string `json:"email" bson:"email"`
	Document          string `json:"cpfCnpj" bson:"document"`
	PostalCode        string `json:"postalCode" bson:"postal_code"`
	AddressNumber     string `json:"addressNumber" bson:"address_number"`
	AddressComplement string `json:"addressComplement" bson:"address_complement"`
	Phone             string `json:"phone" bson:"phone"`
	MobilePhone       string `json:"mobilePhone" bson:"mobile_phone"`
}

type CreditCardInfo

type CreditCardInfo struct {
	HolderName  string `json:"holderName" bson:"holder_name"`
	Number      string `json:"number" bson:"number"`
	ExpiryMonth string `json:"expiryMonth" bson:"expiry_month"`
	ExpiryYear  string `json:"expiryYear" bson:"expiry_year"`
	CCV         string `json:"ccv" bson:"ccv"`
}

type Echarge

type Echarge struct {
	// contains filtered or unexported fields
}

func Start added in v1.0.2

func Start() *Echarge

func (*Echarge) CreateCharge

func (s *Echarge) CreateCharge(body RequestCharge) (*ResponseCharge, error)

func (*Echarge) CreateClient

func (s *Echarge) CreateClient(body RequestClient) (*ResponseClient, error)

func (*Echarge) CreateToken

func (s *Echarge) CreateToken(body RequestCreditCard) (*ResponseCreditCard, error)

func (*Echarge) DeleteCharge

func (s *Echarge) DeleteCharge(param string) error

func (*Echarge) DeleteClient

func (s *Echarge) DeleteClient(param string) error

func (*Echarge) ListClient

func (s *Echarge) ListClient(param string) (*ResponseClient, error)

func (*Echarge) RestoreClient

func (s *Echarge) RestoreClient(param string) (*ResponseClient, error)

func (*Echarge) SearchCharge

func (s *Echarge) SearchCharge(param string) (*ResponseCharge, error)

func (*Echarge) SetEnvironment

func (e *Echarge) SetEnvironment(env Environment) *Echarge

func (*Echarge) SetHeader

func (e *Echarge) SetHeader() *Echarge

func (*Echarge) SetKey

func (e *Echarge) SetKey(key string) *Echarge

func (*Echarge) UpdateCharge

func (s *Echarge) UpdateCharge(param string, body RequestCharge) (*ResponseCharge, error)

func (*Echarge) UpdateClient

func (s *Echarge) UpdateClient(param string, body RequestClient) (*ResponseClient, error)

type Environment

type Environment string
const (
	Prodution    Environment = "https://api.asaas.com/"
	Homologation Environment = "https://api-sandbox.asaas.com/"
)

type RequestCharge

type RequestCharge struct {
	Customer    string  `json:"customer,omitempty" bson:"costumer,omitempty"`
	BillingType string  `json:"billingType" bson:"billing_type"`
	DueDate     string  `json:"dueDate" bson:"due_date"`
	Description string  `json:"description" bson:"description"`
	Value       float64 `json:"value" bson:"value"`
	Split       []Slipt `json:"split" bson:"split"`
}

type RequestClient

type RequestClient struct {
	Name     string     `json:"name" bson:"name"`
	Document string     `json:"cpfCnpj" bson:"document"`
	Email    string     `json:"email" bson:"email"`
	CreateAt *time.Time `json:"-" bson:"create_at"`
}

type RequestCreditCard

type RequestCreditCard struct {
	RemoteIP             string               `json:"remoteIp" bson:"remote_ip"`
	Customer             string               `json:"customer" bson:"customer"`
	CreditCard           CreditCardInfo       `json:"creditCardInfo" bson:"credit_card_info"`
	CreditCardHolderInfo CreditCardHolderInfo `json:"creditCardHolderInfo" bson:"credit_card_holder_info"`
}

type RequestPayment

type RequestPayment struct {
	CreditCardToken string `json:"creditCardToken" bson:"credit_card_token"`
}

type ResponseCharge

type ResponseCharge struct {
	ChargeID    string  `json:"id" bson:"id"`
	Object      string  `json:"object" bson:"object"`
	Customer    string  `json:"customer" bson:"customer"`
	DateCreated string  `json:"dateCreated" bson:"date_created"`
	Description string  `json:"description" bson:"description"`
	Status      string  `json:"status" bson:"status"`
	BillingType string  `json:"billingType" bson:"billing_type"`
	Value       float64 `json:"value" bson:"value"`
	NetValue    float64 `json:"netValue" bson:"net_value"`
}

type ResponseClient

type ResponseClient struct {
	Costumer string `json:"id" bson:"id"`
	Object   string `json:"object" bson:"object"`
	Name     string `json:"name,omitempty" bson:"name,omitempty"`
	Email    string `json:"email,omitempty" bson:"email,omitempty"`
	Document string `json:"cpfCnpj,omitempty" bson:"document,omitempty"`
	Deleted  bool   `json:"deleted,omitempty" bson:"deleted,omitempty"`
}

type ResponseCreditCard

type ResponseCreditCard struct {
	CreditCardNumber string `json:"creditCardNumber" bson:"creditCardNumber"`
	CreditCardBrand  string `json:"creditCardBrand" bson:"credit_card_brand"`
	CreditCardToken  string `json:"creditCardToken" bson:"credit_card_token"`
}

type ResponsePayment

type ResponsePayment struct {
	ChargeID    string  `json:"id" bson:"id"`
	Object      string  `json:"object" bson:"object"`
	Customer    string  `json:"customer" bson:"customer"`
	DateCreated string  `json:"dateCreated" bson:"date_created"`
	Description string  `json:"description" bson:"description"`
	Status      string  `json:"status" bson:"status"`
	BillingType string  `json:"billingType" bson:"billing_type"`
	Value       float64 `json:"value" bson:"value"`
	NetValue    float64 `json:"netValue" bson:"net_value"`
}

type Slipt

type Slipt struct {
	WalletID          string  `json:"walletid" bson:"wallet_id"`
	ExternalReference string  `json:"external_reference" bson:"external_reference"`
	Description       string  `json:"description" bson:"description"`
	FixedValue        float64 `json:"fixedValue" bson:"fixed_value"`
}

Jump to

Keyboard shortcuts

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