payment

package
v0.0.0-...-f1a69a6 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInitializePayment = errors.New("決済情報の初期化に失敗しました")
	ErrPaymentResult     = errors.New("課金APIの処理結果を取得できませんでした")
	ErrRegistCard        = errors.New("クレジットカードの登録及びトークン発行に失敗しました")
)

Functions

This section is empty.

Types

type CardInformation

type CardInformation struct {
	CardNumber string `json:"card_number"`
	Cvv        string `json:"cvv"`
	ExpiryDate string `json:"expiry_date"`
}

type Client

type Client struct {
	BaseURL *url.URL
}

func NewClient

func NewClient() (*Client, error)

func (*Client) Initialize

func (c *Client) Initialize() error

func (*Client) RegistCard

func (c *Client) RegistCard(ctx context.Context, cardNumber, cvv, expiryDate string) (string, error)

func (*Client) Result

func (c *Client) Result(ctx context.Context) (*PaymentResult, error)

type PaymentInformation

type PaymentInformation struct {
	CardToken     string    `json:"card_token"`
	ReservationID int       `json:"reservation_id"`
	Datetime      time.Time `json:"datetime"`
	Amount        int64     `json:"amount"`
	IsCanceled    bool      `json:"is_canceled"`
}

type PaymentResult

type PaymentResult struct {
	RawData []*RawData `json:"raw_data"`
	IsOK    bool       `json:"is_ok"`
}

type RawData

type RawData struct {
	PaymentInfo *PaymentInformation `json:"payment_information"`
	CardInfo    *CardInformation    `json:"card_information"`
}

type RegistCardResponse

type RegistCardResponse struct {
	CardToken string `json:"card_token"`
	IsOK      bool   `json:"is_ok"`
}

Jump to

Keyboard shortcuts

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