pagarmeapisdk

package module
v0.0.0-...-d66366b Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 6 Imported by: 0

README

Getting Started with PagarmeApiSDK

Introduction

Pagarme API

Requirements

The SDK requires Go version 1.18 or above.

Building

Install Dependencies

Resolve all the SDK dependencies, using the go get command.

Installation

The following section explains how to use the pagarmeapisdk library in a new project.

1. Add SDK as a Dependency to the Application
  • Add the following lines to your application's go.mod file:
replace pagarmeapisdk => ".\\PagarmeApiSDK" // local path to the SDK

require pagarmeapisdk v0.0.0
  • Resolve the dependencies in the updated go.mod file, using the go get command.

Initialize the API Client

Note: Documentation for the client can be found here.

The following parameters are configurable for the API Client:

Parameter Type Description
serviceRefererName string
httpConfiguration https.HttpConfiguration Configurable http client options.
basicAuthUserName string The username to use with basic authentication
basicAuthPassword string The password to use with basic authentication

The API client can be initialized as follows:

config := pagarmeapisdk.CreateConfiguration(
    pagarmeapisdk.WithServiceRefererName("ServiceRefererName"),
    pagarmeapisdk.WithBasicAuthUserName("BasicAuthUserName"),
    pagarmeapisdk.WithBasicAuthPassword("BasicAuthPassword"),
)
client := pagarmeapisdk.NewClient(config)

Authorization

This API uses Basic Authentication.

API Errors

Here is the list of errors that the API might throw.

HTTP Status Code Error Description Exception Class
400 Invalid request ErrorException
401 Invalid API key ErrorException
404 An informed resource was not found ErrorException
412 Business validation error ErrorException
422 Contract validation error ErrorException
500 Internal server error ErrorException

List of APIs

Classes Documentation

Documentation

Overview

Package pagarmeapisdk

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthentication

func BasicAuthentication(config Configuration) https.Authenticator

func CreateHttpConfiguration

func CreateHttpConfiguration(options ...https.HttpConfigurationOptions) https.HttpConfiguration

func CreateRetryConfiguration

func CreateRetryConfiguration(options ...https.RetryConfigurationOptions) https.RetryConfiguration

func DefaultHttpConfiguration

func DefaultHttpConfiguration() https.HttpConfiguration

func DefaultRetryConfiguration

func DefaultRetryConfiguration() https.RetryConfiguration

Types

type Client

type Client struct {
	PlansController             controllers.PlansController
	SubscriptionsController     controllers.SubscriptionsController
	InvoicesController          controllers.InvoicesController
	OrdersController            controllers.OrdersController
	CustomersController         controllers.CustomersController
	RecipientsController        controllers.RecipientsController
	ChargesController           controllers.ChargesController
	TransfersController         controllers.TransfersController
	TokensController            controllers.TokensController
	TransactionsController      controllers.TransactionsController
	PayablesController          controllers.PayablesController
	BalanceOperationsController controllers.BalanceOperationsController
	BinController               controllers.BinController
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config Configuration) *Client

Constructor for client.

func (*Client) GetCallBuilder

func (c *Client) GetCallBuilder() https.CallBuilderFactory

type Configuration

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

func CreateConfiguration

func CreateConfiguration(options ...ConfigurationOptions) Configuration

func CreateConfigurationFromEnvironment

func CreateConfigurationFromEnvironment(options ...ConfigurationOptions) Configuration

func DefaultConfiguration

func DefaultConfiguration() Configuration

func (*Configuration) BasicAuthPassword

func (c *Configuration) BasicAuthPassword() string

func (*Configuration) BasicAuthUserName

func (c *Configuration) BasicAuthUserName() string

func (*Configuration) Environment

func (c *Configuration) Environment() Environment

func (*Configuration) HttpConfiguration

func (c *Configuration) HttpConfiguration() https.HttpConfiguration

func (*Configuration) ServiceRefererName

func (c *Configuration) ServiceRefererName() string

type ConfigurationOptions

type ConfigurationOptions func(*Configuration)

func WithBasicAuthPassword

func WithBasicAuthPassword(basicAuthPassword string) ConfigurationOptions

func WithBasicAuthUserName

func WithBasicAuthUserName(basicAuthUserName string) ConfigurationOptions

func WithEnvironment

func WithEnvironment(environment Environment) ConfigurationOptions

func WithHttpConfiguration

func WithHttpConfiguration(httpConfiguration https.HttpConfiguration) ConfigurationOptions

func WithServiceRefererName

func WithServiceRefererName(serviceRefererName string) ConfigurationOptions

type Environment

type Environment string

Available Environments

const (
	PRODUCTION Environment = "production"
)

type Server

type Server string

Available Servers

const (
	CORE_V5 Server = "core_v5"
	BIN_V1  Server = "bin_v1"
)

Directories

Path Synopsis
Package pagarmeapisdk
Package pagarmeapisdk
Package pagarmeapisdk
Package pagarmeapisdk
Package pagarmeapisdk
Package pagarmeapisdk

Jump to

Keyboard shortcuts

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