pinpayments

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL            string = "https://api.pinpayments.com/1/"
	BaseURLTest        string = "https://test-api.pinpayments.com/1/"
	RequestContentType string = "application/json"
	RequestAccept      string = "application/json"
	Connection         string = "keep-alive"
	AuthHeader         string = "Authorization"
	TokenType          string = "Basic"
	APIEnvSecret       string = "API_SECRET"
	APIEnvKey          string = "API_KEY"
)

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

Types

type Balance

type Balance struct {
	Amount   int    `json:"amount,omitempty"`
	Currency string `json:"currency,omitempty"`
}

type BalanceService

type BalanceService service

func (*BalanceService) GetBalance

func (bc *BalanceService) GetBalance() (br *BalancesResponse, err error)

type Balances

type Balances struct {
	Available []Balance `json:"available,omitempty"`
	Pending   []Balance `json:"pending,omitempty"`
}

type BalancesResponse

type BalancesResponse struct {
	Response Balances `json:"response,omitempty"`
}

type BankAccount

type BankAccount struct {
	Token    string `json:"token,omitempty"`
	Name     string `json:"name,omitempty"`
	Bsb      string `json:"bsb,omitempty"`
	Number   string `json:"number,omitempty"`
	BankName string `json:"bank_name,omitempty"`
	Branch   string `json:"branch,omitempty"`
}

type BankAccountResponse

type BankAccountResponse struct {
	Response  BankAccount `json:"response,omitempty"`
	IpAddress net.IP      `json:"ip_address,omitempty"`
}

type BankAccountService

type BankAccountService service

func (*BankAccountService) Create

func (bas *BankAccountService) Create(bankAccount *BankAccount) (bar *BankAccountResponse, err error)

type Business

type Business struct {
	TradingName             string `json:"trading_name,omitempty"`
	Description             string `json:"description,omitempty"`
	TypicalProductPrice     string `json:"typical_product_price,omitempty"`
	TransactionsPerMonth    string `json:"transactions_per_month,omitempty"`
	AnnualTransactionVolume string `json:"annual_transaction_volume,omitempty"`
	SellsPhysicalGoods      string `json:"sells_physical_goods,omitempty"`
	AverageDeliveryDays     string `json:"average_delivery_days,omitempty"`
	URL                     string `json:"url,omitempty"`
}

type Card

type Card struct {
	Number            string `json:"number,omitempty"`
	ExpiryMonth       int    `json:"expiry_month,omitempty"`
	ExpiryYear        int    `json:"expiry_year,omitempty"`
	CVC               string `json:"cvc,omitempty"`
	Name              string `json:"name,omitempty"`
	AddressLine1      string `json:"address_line1,omitempty"`
	AddressLine2      string `json:"address_line2,omitempty"`
	AddressCity       string `json:"address_city,omitempty"`
	AddressPostcode   string `json:"address_postcode,omitempty"`
	AddressState      string `json:"address_state,omitempty"`
	AddressCountry    string `json:"address_country,omitempty"`
	Scheme            string `json:"scheme,omitempty"`
	DisplayNumber     string `json:"display_number,omitempty"`
	IssuingCountry    string `json:"issuing_country,omitempty"`
	CustomerToken     string `json:"customer_token,omitempty"`
	Token             string `json:"token,omitempty"`
	PublishableApiKey string `json:"publishable_api_key,omitempty"`
}

type CardCreatedResponse

type CardCreatedResponse struct {
	Response  Card   `json:"response,omitempty"`
	IpAddress net.IP `json:"ip_address,omitempty"`
}

type CardCreationRequest

type CardCreationRequest struct {
	Card          Card
	CustomerToken string
}

type CardCreationResponse

type CardCreationResponse struct {
	Response  Card   `json:"response,omitempty"`
	IpAddress string `json:"ip_address,omitempty"`
}

type CardDeletionRequest

type CardDeletionRequest struct {
	CustomerToken string
	CardToken     string
}

type CardsResponse

type CardsResponse struct {
	Response   []Card `json:"response,omitempty"`
	Count      int    `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type CardsService

type CardsService service

func (*CardsService) Create

func (cs *CardsService) Create(card *Card) (cr *CardCreatedResponse, err error)

type ChargeResponse

type ChargeResponse struct {
	Response ResponseBody `json:"response"`
}

type ChargesRequest

type ChargesRequest struct {
	Email         string       `json:"email"`
	Description   string       `json:"description"`
	Amount        int32        `json:"amount"`
	IpAddress     string       `json:"ip_address"`
	Currency      string       `json:"currency,omitempty"`
	Capture       bool         `json:"capture,omitempty"`
	Metadata      Metadata     `json:"metadata,omitempty"`
	ThreeDSecure  ThreeDSecure `json:"three_d_secure,omitempty"`
	Card          Card         `json:"card,omitempty"`
	CardToken     string       `json:"card_token,omitempty"`
	CustomerToken string       `json:"customer_token,omitempty"`
}

type ChargesResponse

type ChargesResponse struct {
	Responses  []ResponseBody `json:"response"`
	Count      int            `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type ChargesService added in v1.0.1

type ChargesService service

func (*ChargesService) CaptureCharge added in v1.0.1

func (cs *ChargesService) CaptureCharge(token string) (cr *ChargeResponse, err error)

func (*ChargesService) CreateCharge added in v1.0.1

func (cs *ChargesService) CreateCharge(charge *ChargesRequest) (cr *ChargeResponse, err error)

func (*ChargesService) Get added in v1.0.1

func (cs *ChargesService) Get(token string) (cr *ChargeResponse, err error)

func (*ChargesService) GetAll added in v1.0.1

func (cs *ChargesService) GetAll(page int) (cr *ChargesResponse, err error)

func (*ChargesService) Search added in v1.0.1

func (cs *ChargesService) Search(search Search) (cr *ChargesResponse, err error)

func (*ChargesService) VoidCharge added in v1.0.1

func (cs *ChargesService) VoidCharge(token string) (cr *ChargeResponse, err error)

type Client

type Client struct {
	PaginationInterface

	BaseURL *url.URL

	Charges          *ChargesService
	Customers        *CustomersService
	Refunds          *RefundsService
	Cards            *CardsService
	Recipients       *RecipientsService
	Transfers        *TransfersService
	Balance          *BalanceService
	BankAccount      *BankAccountService
	Events           *EventsService
	WebhookEndpoints *WebhookEndpointsService
	Webhooks         *WebhooksService
	Plans            *PlansService
	Subscription     *SubscriptionService
	Merchant         *MerchantsService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseClient *http.Client, c *Config) (pinpayments *Client, err error)

func (*Client) Do

func (c *Client) Do(req *http.Request) (*Response, error)

func (*Client) NewAPIRequest

func (c *Client) NewAPIRequest(secret bool, method string, uri string, body interface{}) (req *http.Request, err error)

func (*Client) SetPage added in v1.0.1

func (c *Client) SetPage(page int)

func (*Client) WithAuthenticationValue

func (c *Client) WithAuthenticationValue(k string, p string) error

type Config

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

func NewConfig

func NewConfig(t bool, secretKey string, publishableKey string) *Config

type Contact

type Contact struct {
	FirstName   string `json:"first_name,omitempty"`
	LastName    string `json:"last_name,omitempty"`
	PhoneNumber string `json:"phone_number,omitempty"`
	Email       string `json:"email,omitempty"`
	Password    string `json:"password,omitempty"`
}

type CustomerRequest

type CustomerRequest struct {
	Token            string `json:"token,omitempty"`
	Email            string `json:"email,omitempty"`
	FirstName        string `json:"first_name,omitempty"`
	LastName         string `json:"last_name,omitempty"`
	PhoneNumber      string `json:"phone_number,omitempty"`
	Company          string `json:"company,omitempty"`
	Notes            string `json:"notes,omitempty"`
	Card             Card   `json:"card,omitempty"`
	CardToken        string `json:"card_token,omitempty"`
	PrimaryCardToken string `json:"primary_card_token,omitempty"`
}

type CustomerResponse

type CustomerResponse struct {
	Response CustomerResponseBody `json:"response"`
}

type CustomerResponseBody

type CustomerResponseBody struct {
	Token       string    `json:"token,omitempty"`
	Email       string    `json:"email,omitempty"`
	FirstName   string    `json:"first_name,omitempty"`
	LastName    string    `json:"last_name,omitempty"`
	PhoneNumber string    `json:"phone_number,omitempty"`
	Notes       string    `json:"notes,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty"`
	Card        Card      `json:"card,omitempty"`
}

type CustomersResponse

type CustomersResponse struct {
	Responses  []CustomerResponseBody `json:"response"`
	Count      int                    `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type CustomersService

type CustomersService service

func (*CustomersService) AddCard

func (cs *CustomersService) AddCard(cardRequest *CardCreationRequest) (cr *CardCreationResponse, err error)

func (*CustomersService) Create

func (cs *CustomersService) Create(customer *CustomerRequest) (cr *CustomerResponse, err error)

func (*CustomersService) Delete

func (cs *CustomersService) Delete(token string) (bool bool, err error)

func (*CustomersService) DeleteCard

func (cs *CustomersService) DeleteCard(cardDeletion *CardDeletionRequest) (bool bool, err error)

func (*CustomersService) Get

func (cs *CustomersService) Get(token string) (cr *CustomerResponse, err error)

func (*CustomersService) GetAll

func (cs *CustomersService) GetAll(page int) (cr *CustomersResponse, err error)

func (*CustomersService) GetCards

func (cs *CustomersService) GetCards(token string) (cr *CardsResponse, err error)

func (*CustomersService) GetCharges

func (cs *CustomersService) GetCharges(token string) (cr *ChargesResponse, err error)

func (*CustomersService) GetSubscriptions

func (cs *CustomersService) GetSubscriptions(token string) (csub *SubscriptionsResponse, err error)

func (*CustomersService) Update

func (cs *CustomersService) Update(customerUpdated *CustomerRequest) (cr *CustomerResponse, err error)

type Director

type Director struct {
	FullName      string `json:"full_name,omitempty"`
	ContactNumber string `json:"contact_number,omitempty"`
	DateOfBirth   string `json:"date_of_birth,omitempty"`
}

type Endpoint

type Endpoint struct {
	Token     string    `json:"token,omitempty"`
	Key       string    `json:"key,omitempty"`
	Url       string    `json:"url,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

type EndpointResponse

type EndpointResponse struct {
	Response Endpoint `json:"response,omitempty"`
}

type EndpointsResponse

type EndpointsResponse struct {
	Response   []Endpoint `json:"response,omitempty"`
	Count      int        `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type Entity

type Entity struct {
	BusinessRegistrationNumber string `json:"business_registration_number,omitempty"`
	FullLegalName              string `json:"full_legal_name,omitempty"`
	IncorporationStatus        string `json:"incorporation_status,omitempty"`
	RegisteredForGst           bool   `json:"registered_for_gst,omitempty"`
	AddressLine1               string `json:"address_line_1,omitempty"`
	AddressLine2               string `json:"address_line_2,omitempty"`
	AddressLocality            string `json:"address_locality,omitempty"`
	AddressRegion              string `json:"address_region,omitempty"`
	AddressPostalCode          string `json:"address_postal_code,omitempty"`
}

type Error

type Error struct {
	Code             int            `json:"code,omitempty"`
	Message          string         `json:"message,omitempty"`
	Content          string         `json:"content,omitempty"`
	Response         *http.Response `json:"response,omitempty"` // the full response that produced the error
	ErrorMessage     string         `json:"error,omitempty"`
	ErrorDescription string         `json:"error_description,omitempty"`
}

func (*Error) Error

func (e *Error) Error() string

type Event

type Event struct {
	Token     string      `json:"token,omitempty"`
	Type      string      `json:"type,omitempty"`
	Data      interface{} `json:"data,omitempty"`
	CreatedAt time.Time   `json:"created_at,omitempty"`
}

type EventResponse

type EventResponse struct {
	Response Event `json:"response,omitempty"`
}

type EventsResponse

type EventsResponse struct {
	PaginationInterface
	Response   []Event `json:"response,omitempty"`
	Count      int     `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type EventsService

type EventsService service

func (*EventsService) Get

func (es *EventsService) Get(token string) (er *EventResponse, err error)

func (*EventsService) GetAll

func (es *EventsService) GetAll(page int) (er *EventsResponse, err error)

type Fee

type Fee struct {
	FixedFee      int     `json:"fixed_fee,omitempty"`
	PercentageFee float64 `json:"percentage_fee,omitempty"`
}

type Ledger

type Ledger struct {
	CreatedAt  time.Time `json:"created_at,omitempty"`
	Type       string    `json:"type,omitempty"`
	Amount     int       `json:"amount,omitempty"`
	Currency   string    `json:"currency,omitempty"`
	Annotation string    `json:"annotation,omitempty"`
}

type LedgerResponse

type LedgerResponse struct {
	Response   []Ledger `json:"response,omitempty"`
	Count      int      `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type LineItem

type LineItem struct {
	Type      string    `json:"type,omitempty"`
	Amount    int       `json:"amount,omitempty"`
	Currency  string    `json:"currency,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	Object    string    `json:"object,omitempty"`
	Token     string    `json:"token,omitempty"`
	Record    Record    `json:"record,omitempty"`
}

type LineItemsResponse

type LineItemsResponse struct {
	Response   []LineItem `json:"response,omitempty"`
	Count      int        `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type Merchant

type Merchant struct {
	Contact     Contact     `json:"contact,omitempty"`
	Entity      Entity      `json:"entity,omitempty"`
	Business    Business    `json:"business,omitempty"`
	BankAccount BankAccount `json:"bank_account,omitempty"`
	Director    Director    `json:"director,omitempty"`
	Notes       string      `json:"notes,omitempty"`
}

type MerchantFullResponse

type MerchantFullResponse struct {
	Response struct {
		Token                            string    `json:"token,omitempty"`
		Status                           string    `json:"status,omitempty"`
		BusinessName                     string    `json:"business_name,omitempty"`
		ContactName                      string    `json:"contact_name,omitempty"`
		ContactEmail                     string    `json:"contact_email,omitempty"`
		SkipChargeAddressValidation      bool      `json:"skip_charge_address_validation,omitempty"`
		SendTransferEmail                bool      `json:"send_transfer_email,omitempty"`
		SendRefundSuccessfulEmails       bool      `json:"send_refund_successful_emails,omitempty"`
		SettlementDelayDays              int       `json:"settlement_delay_days,omitempty"`
		AmexEnabled                      bool      `json:"amex_enabled,omitempty"`
		MaximumChargeCents               int       `json:"maximum_charge_cents,omitempty"`
		PosMaximumChargeCents            int       `json:"pos_maximum_charge_cents,omitempty"`
		TransfersEnabled                 bool      `json:"transfers_enabled,omitempty"`
		LastChargeDate                   time.Time `json:"last_charge_date,omitempty"`
		TestSecretApiKey                 string    `json:"test_secret_api_key,omitempty"`
		TestPublishableApiKey            string    `json:"test_publishable_api_key,omitempty"`
		TransactionFixedFee              int       `json:"transaction_fixed_fee,omitempty"`
		ThirdPartyTransferFee            int       `json:"third_party_transfer_fee,omitempty"`
		DomesticTransactionPercentageFee float64   `json:"domestic_transaction_percentage_fee,omitempty"`
		AmexTransactionPercentageFee     float64   `json:"amex_transaction_percentage_fee,omitempty"`
		ForeignTransactionPercentageFee  float64   `json:"foreign_transaction_percentage_fee,omitempty"`
		Amex                             bool      `json:"amex,omitempty"`
		TransferEmailLineItemsAttachment bool      `json:"transfer_email_line_items_attachment,omitempty"`
		StatementDescriptorRandomCode    bool      `json:"statement_descriptor_random_code,omitempty"`
		ApiKeys                          struct {
			Secret      string `json:"secret,omitempty"`
			Publishable string `json:"publishable,omitempty"`
		} `json:"api_keys,omitempty"`
		Pricing struct {
			DomesticCurrencyDomesticCardCore    Fee `json:"domestic_currency_domestic_card_core,omitempty"`
			DomesticCurrencyDomesticCardPremium Fee `json:"domestic_currency_domestic_card_premium,omitempty"`
			DomesticCurrencyForeignCardCore     Fee `json:"domestic_currency_foreign_card_core,omitempty"`
			DomesticCurrencyForeignCardPremium  Fee `json:"domestic_currency_foreign_card_premium,omitempty"`
			ForeignCurrencyCore                 Fee `json:"foreign_currency_core,omitempty"`
			ForeignCurrencyPremium              Fee `json:"foreign_currency_premium,omitempty"`
		} `json:"pricing,omitempty"`
		Notifications struct {
			Receipts struct {
				Api               bool `json:"api,omitempty"`
				PaymentPage       bool `json:"payment_page,omitempty"`
				ManualCharge      bool `json:"manual_charge,omitempty"`
				RecurringPayments bool `json:"recurring_payments,omitempty"`
				XeroPaymentPage   bool `json:"xero_payment_page,omitempty"`
			} `json:"receipts,omitempty"`
			RecurringPayments struct {
				Subscribed    bool `json:"subscribed,omitempty"`
				Unsubscribed  bool `json:"unsubscribed,omitempty"`
				Cancelled     bool `json:"cancelled,omitempty"`
				Renewed       bool `json:"renewed,omitempty"`
				RenewalFailed bool `json:"renewal_failed,omitempty"`
				Reactivated   bool `json:"reactivated,omitempty"`
			} `json:"recurring_payments,omitempty"`
		} `json:"notifications,omitempty"`
		CreatedAt time.Time `json:"created_at,omitempty"`
		UpdatedAt time.Time `json:"updated_at,omitempty"`
	} `json:"response,omitempty"`
}

type MerchantResponse

type MerchantResponse struct {
	Response struct {
		Token        string    `json:"token,omitempty"`
		Email        string    `json:"email,omitempty"`
		BusinessName string    `json:"business_name,omitempty"`
		Status       string    `json:"status,omitempty"`
		CreatedAt    time.Time `json:"created_at,omitempty"`
		UpdatedAt    time.Time `json:"updated_at,omitempty"`
	} `json:"response,omitempty"`
}

type MerchantsResponse

type MerchantsResponse struct {
	Response []struct {
		Token        string    `json:"token,omitempty"`
		Email        string    `json:"email,omitempty"`
		BusinessName string    `json:"business_name,omitempty"`
		Status       string    `json:"status,omitempty"`
		CreatedAt    time.Time `json:"created_at,omitempty"`
		UpdatedAt    time.Time `json:"updated_at,omitempty"`
	} `json:"response,omitempty"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type MerchantsService

type MerchantsService service

func (*MerchantsService) Create

func (ms *MerchantsService) Create(merchant *Merchant) (mr *MerchantResponse, err error)

func (*MerchantsService) Get

func (ms *MerchantsService) Get(token string) (mr *MerchantFullResponse, err error)

func (*MerchantsService) GetAll

func (ms *MerchantsService) GetAll(page int) (mr *MerchantsResponse, err error)

func (*MerchantsService) GetDefault

func (ms *MerchantsService) GetDefault(token string) (mr *MerchantFullResponse, err error)

type Metadata

type Metadata struct {
	OrderNumber        string    `json:"OrderNumber,omitempty"`
	CustomerName       string    `json:"CustomerName,omitempty"`
	OrderTakenBy       string    `json:"order taken by,omitempty"`
	Location           string    `json:"Location,omitempty"`
	TimeOrderCompleted time.Time `json:"time_order_completed,omitempty"`
}

type PaginationInterface added in v1.0.1

type PaginationInterface interface {
	SetPage(page int)
}

type Plan

type Plan struct {
	Name                string             `json:"name,omitempty"`
	Amount              int                `json:"amount,omitempty"`
	Currency            string             `json:"currency,omitempty"`
	SetupAmount         int                `json:"setup_amount,omitempty"`
	TrialAmount         int                `json:"trial_amount,omitempty"`
	Interval            int                `json:"interval,omitempty"`
	IntervalUnit        string             `json:"interval_unit,omitempty"`
	Intervals           int                `json:"intervals,omitempty"`
	TrialInterval       int                `json:"trial_interval,omitempty"`
	TrialIntervalUnit   string             `json:"trial_interval_unit,omitempty"`
	CreatedAt           time.Time          `json:"created_at,omitempty"`
	Token               string             `json:"token,omitempty"`
	CustomerPermissions []string           `json:"customer_permissions,omitempty"`
	SubscriptionCounts  SubscriptionCounts `json:"subscription_counts,omitempty"`
}

type PlanResponse

type PlanResponse struct {
	Response Plan `json:"response,omitempty"`
}

type PlansResponse

type PlansResponse struct {
	Response   []Plan `json:"response,omitempty"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type PlansService

type PlansService service

func (*PlansService) Create

func (ps *PlansService) Create(plan *Plan) (pr *PlanResponse, err error)

func (*PlansService) CreatePlanSubscription

func (ps *PlansService) CreatePlanSubscription(subscription *Subscription) (sr *SubscriptionResponse, err error)

func (*PlansService) Delete

func (ps *PlansService) Delete(token string) (pr bool, err error)

func (*PlansService) Get

func (ps *PlansService) Get(token string) (pr *PlanResponse, err error)

func (*PlansService) GetAll

func (ps *PlansService) GetAll(page int) (pr *PlansResponse, err error)

func (*PlansService) GetPlanSubscriptions

func (ps *PlansService) GetPlanSubscriptions(token string) (sr *SubscriptionsResponse, err error)

func (*PlansService) Update

func (ps *PlansService) Update(plan *Plan) (pr *PlanResponse, err error)

type Recipient

type Recipient struct {
	Token            string      `json:"token,omitempty"`
	Email            string      `json:"email,omitempty"`
	Name             string      `json:"name,omitempty"`
	CreatedAt        time.Time   `json:"created_at,omitempty"`
	BankAccount      BankAccount `json:"bank_account,omitempty"`
	BankAccountToken string      `json:"bank_account_token,omitempty"`
}

type RecipientResponse

type RecipientResponse struct {
	Response Recipient `json:"response,omitempty"`
}

type RecipientsResponse

type RecipientsResponse struct {
	Response   []Recipient `json:"response,omitempty"`
	Count      int         `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type RecipientsService

type RecipientsService service

func (*RecipientsService) Create

func (rs *RecipientsService) Create(recipient *Recipient) (rr *RecipientResponse, err error)

func (*RecipientsService) Get

func (rs *RecipientsService) Get(token string) (rr *RecipientResponse, err error)

func (*RecipientsService) GetAll

func (rs *RecipientsService) GetAll(page int) (rr RecipientsResponse, err error)

func (*RecipientsService) GetTransfers

func (rs *RecipientsService) GetTransfers(token string) (tr *TransfersResponse, err error)

func (*RecipientsService) Update

func (rs *RecipientsService) Update(recipient *Recipient) (rr *RecipientResponse, err error)

type Record

type Record struct {
	Type      string    `json:"type,omitempty"`
	Amount    int       `json:"amount,omitempty"`
	Currency  string    `json:"currency,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

type Refund

type Refund struct {
	Token         string    `json:"token,omitempty"`
	Success       string    `json:"success,omitempty"`
	Amount        int       `json:"amount,omitempty"`
	Currency      string    `json:"currency,omitempty"`
	Charge        string    `json:"charge,omitempty"`
	CreatedAt     time.Time `json:"created_at,omitempty"`
	ErrorMessage  string    `json:"error_message,omitempty"`
	StatusMessage string    `json:"status_message,omitempty"`
}

type RefundRequest

type RefundRequest struct {
	ChargeToken string
	Amount      int `json:"amount,omitempty"`
}

type RefundResponse

type RefundResponse struct {
	Response Refund `json:"response,omitempty"`
}

type RefundsResponse

type RefundsResponse struct {
	Response   []Refund `json:"response,omitempty"`
	Count      int      `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type RefundsService

type RefundsService service

func (*RefundsService) Create

func (rs *RefundsService) Create(refundRequest *RefundRequest) (rr *RefundResponse, err error)

func (*RefundsService) Get

func (rs *RefundsService) Get(token string) (rr *RefundResponse, err error)

func (*RefundsService) GetAll

func (rs *RefundsService) GetAll(page int) (rr *RefundsResponse, err error)

func (*RefundsService) GetRefundsForCharge

func (rs *RefundsService) GetRefundsForCharge(token string, page int) (rr *RefundsResponse, err error)

type Resp

type Resp struct {
	Resp interface{} `json:"response"`
}

type Response

type Response struct {
	*http.Response
	// contains filtered or unexported fields
}

type ResponseBody

type ResponseBody struct {
	Token         string    `json:"token,omitempty"`
	Success       bool      `json:"success,omitempty"`
	Amount        int       `json:"amount,omitempty"`
	Currency      string    `json:"currency,omitempty"`
	Description   string    `json:"description,omitempty"`
	Email         string    `json:"email,omitempty"`
	IpAddress     string    `json:"ip_address,omitempty"`
	CreatedAt     time.Time `json:"created_at,omitempty"`
	StatusMessage string    `json:"status_message,omitempty"`
	ErrorMessage  string    `json:"error_message,omitempty"`
	Card          Card      `json:"card,omitempty"`
	Metadata      `json:"metadata,omitempty"`
	TotalFees     int `json:"total_fees,omitempty"`
}
type Search struct {
	Page      int
	Query     string    `url:"query,omitempty"`
	StartDate time.Time `url:"start_date,omitempty"`
	EndDate   time.Time `url:"end_date,omitempty"`
	Sort      string    `url:"sort,omitempty"`
	Direction int       `url:"direction,omitempty"`
}

type Subscription

type Subscription struct {
	State                    string    `json:"state,omitempty"`
	NextBillingDate          time.Time `json:"next_billing_date,omitempty"`
	ActiveIntervalStartedAt  time.Time `json:"active_interval_started_at,omitempty"`
	ActiveIntervalFinishedAt time.Time `json:"active_interval_finished_at,omitempty"`
	CancelledAt              time.Time `json:"cancelled_at,omitempty"`
	CreatedAt                time.Time `json:"created_at,omitempty"`
	Token                    string    `json:"token,omitempty"`
	PlanToken                string    `json:"plan_token,omitempty"`
	CustomerToken            string    `json:"customer_token,omitempty"`
	CardToken                string    `json:"card_token,omitempty"`
}

type SubscriptionCounts

type SubscriptionCounts struct {
	Trial      int `json:"trial,omitempty"`
	Active     int `json:"active,omitempty"`
	Cancelling int `json:"cancelling,omitempty"`
	Cancelled  int `json:"cancelled,omitempty"`
}

type SubscriptionResponse

type SubscriptionResponse struct {
	Response Subscription `json:"response,omitempty"`
}

type SubscriptionService

type SubscriptionService service

func (*SubscriptionService) Create

func (ss *SubscriptionService) Create(subscription *Subscription) (sr *SubscriptionResponse, err error)

func (*SubscriptionService) Delete

func (ss *SubscriptionService) Delete(token string) (pr bool, err error)

func (*SubscriptionService) Get

func (ss *SubscriptionService) Get(token string) (sr *SubscriptionResponse, err error)

func (*SubscriptionService) GetAll

func (ss *SubscriptionService) GetAll(page int) (sr *SubscriptionsResponse, err error)

func (*SubscriptionService) GetLedger

func (ss *SubscriptionService) GetLedger(token string) (lr *LedgerResponse, err error)

func (*SubscriptionService) ReactivateSubscription

func (ss *SubscriptionService) ReactivateSubscription(subscription *Subscription) (sr *SubscriptionResponse, err error)

func (*SubscriptionService) Update

func (ss *SubscriptionService) Update(subscription *Subscription) (sr *SubscriptionResponse, err error)

type SubscriptionsResponse

type SubscriptionsResponse struct {
	Response   []Subscription `json:"response,omitempty"`
	Count      int            `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type ThreeDSecure

type ThreeDSecure struct {
	Version       string `json:"version,omitempty"`
	Eci           string `json:"eci,omitempty"`
	Cavv          string `json:"cavv,omitempty"`
	TransactionId string `json:"transaction_id,omitempty"`
}

type Transfer

type Transfer struct {
	Token          string      `json:"token,omitempty"`
	Status         string      `json:"status,omitempty"`
	Currency       string      `json:"currency,omitempty"`
	Description    string      `json:"description,omitempty"`
	Amount         int         `json:"amount,omitempty"`
	TotalDebits    int         `json:"total_debits,omitempty"`
	TotalCredits   int         `json:"total_credits,omitempty"`
	CreatedAt      time.Time   `json:"created_at,omitempty"`
	PaidAt         time.Time   `json:"paid_at,omitempty"`
	LineItemsCount int         `json:"line_items_count,omitempty"`
	BankAccount    BankAccount `json:"bank_account,omitempty"`
	Recipient      string      `json:"recipient,omitempty"`
}

type TransferResponse

type TransferResponse struct {
	Response Transfer `json:"response,omitempty"`
}

type TransfersResponse

type TransfersResponse struct {
	Response   []Transfer `json:"response,omitempty"`
	Count      int        `json:"count"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type TransfersService

type TransfersService service

func (*TransfersService) Create

func (ts *TransfersService) Create(transfer *Transfer) (tr *TransferResponse, err error)

func (*TransfersService) Get

func (ts *TransfersService) Get(token string) (tr *TransferResponse, err error)

func (*TransfersService) GetAll

func (ts *TransfersService) GetAll(page int) (tr *TransfersResponse, err error)

func (*TransfersService) GetLineItems

func (ts *TransfersService) GetLineItems(token string, page int) (lr *LineItemsResponse, err error)

func (*TransfersService) Search

func (ts *TransfersService) Search(search Search) (tr *TransfersResponse, err error)

type Webhook

type Webhook struct {
	Token                string      `json:"token,omitempty"`
	Status               string      `json:"status,omitempty"`
	Url                  url.URL     `json:"url,omitempty"`
	EventToken           string      `json:"event_token,omitempty"`
	WebhookEndpointToken string      `json:"webhook_endpoint_token,omitempty"`
	CreatedAt            time.Time   `json:"created_at,omitempty"`
	AcceptedAt           time.Time   `json:"accepted_at,omitempty"`
	NextRun              time.Time   `json:"next_run,omitempty"`
	Retries              int         `json:"retries,omitempty"`
	Errors               interface{} `json:"errors,omitempty"`
}

type WebhookEndpointsService

type WebhookEndpointsService service

func (*WebhookEndpointsService) Create

func (es *WebhookEndpointsService) Create(endpoint *Endpoint) (er *EndpointResponse, err error)

func (*WebhookEndpointsService) Delete

func (es *WebhookEndpointsService) Delete(token string) (er bool, err error)

func (*WebhookEndpointsService) Get

func (es *WebhookEndpointsService) Get(token string) (er *EndpointResponse, err error)

func (*WebhookEndpointsService) GetAll

func (es *WebhookEndpointsService) GetAll(page int) (er *EndpointsResponse, err error)

type WebhookResponse

type WebhookResponse struct {
	Response Webhook `json:"response,omitempty"`
}

type WebhooksResponse

type WebhooksResponse struct {
	Response   []Webhook `json:"response,omitempty"`
	Pagination struct {
		Current  int `json:"current"`
		Previous int `json:"previous"`
		Next     int `json:"next"`
		PerPage  int `json:"per_page"`
		Pages    int `json:"pages"`
		Count    int `json:"count"`
	} `json:"pagination"`
}

type WebhooksService

type WebhooksService service

func (*WebhooksService) Get

func (es *WebhooksService) Get(token string) (er *WebhookResponse, err error)

func (*WebhooksService) GetAll

func (ws *WebhooksService) GetAll(page int) (wr *WebhooksResponse, err error)

func (*WebhooksService) Replay

func (es *WebhooksService) Replay(token string) (er *WebhookResponse, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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