culqi

package
v0.0.0-...-794a79b Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCulqiNotWorking = errors.New("sorry, culqi is a piece of shit and it isn't working")

ErrCulqiNotWorking culqi is a shit

Functions

This section is empty.

Types

type Bridge

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

Bridge represents a bridge between your culqi service and your plutus service

func NewBridge

func NewBridge(publicKey, secretKey string) (*Bridge, error)

NewBridge returns a new culqi bridge instance

func (*Bridge) Description

func (bridge *Bridge) Description() *plutus.BridgeDescription

Description returns useful information of culqi bridge, that is an implementation of plutus bridge

func (*Bridge) MakeCharge

func (bridge *Bridge) MakeCharge(source plutus.CardToken, params plutus.ChargeParams) (*plutus.ChargeToken, error)

MakeCharge make a charge with culqi, that implements plutus bridge

func (*Bridge) MakeRefund

func (bridge *Bridge) MakeRefund(source plutus.ChargeToken, params plutus.RefundParams) (*plutus.RefundToken, error)

MakeRefund ...

func (*Bridge) NewToken

func (bridge *Bridge) NewToken(details plutus.CardDetails, kind plutus.CardTokenType) (*plutus.CardToken, error)

NewToken returns a new token of your card, that is an implementation of plutus bridge

type Card

type Card struct {
	ID         string `json:"id"`
	CustomerID string `json:"customer_id"`
	Token      struct {
		ID         string `json:"id"`
		CardNumber string `json:"card_number"`
		Active     bool
		Iin        struct {
			CardBrand    string `json:"card_brand"`
			CardType     string `json:"card_type"`
			CardCategory string `json:"card_category"`
		} `json:"iin"`
	} `json:"token"`
}

Card represents the culqi response to /card endpoint

type CheckoutParams

type CheckoutParams struct {
	Title        string
	Currency     string
	Description  string
	Amount       string
	Installments bool
	Orders       string
}

CheckoutParams ...

type CustomerInfo

type CustomerInfo struct {
	FirstName   string            `json:"first_name"`
	LastName    string            `json:"last_name"`
	Email       string            `json:"email"`
	Address     string            `json:"address"`
	AddressCity string            `json:"address_city"`
	CountryCode string            `json:"country_code"`
	PhoneNumber string            `json:"phone_number"`
	Metadata    map[string]string `json:"metadata"`
}

CustomerInfo is an customer object of Culqi Service

type Token

type Token struct {
	Value string `json:"id"`
}

Token ...

Jump to

Keyboard shortcuts

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