bss

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BSS

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

BSS 商务类接口封装

func NewBSS

func NewBSS(cli *client.Client) *BSS

NewBSS 获得 BSS 实例

func (*BSS) CancelOrder

func (s *BSS) CancelOrder(p *CancelOrderParams) (resp *CancelOrderResponse, err error)

CancelOrder 取消订单

func (*BSS) PayOrder

func (s *BSS) PayOrder(p *PayOrderParams) (resp *PayOrderResponse, err error)

PayOrder 支付订单

func (*BSS) UnpaidOrders

func (s *BSS) UnpaidOrders(p *UnpaidOrdersParams) (resp *UnpaidOrdersResponse, err error)

UnpaidOrders 未支付订单列表

type CancelOrderParams

type CancelOrderParams struct {
	OrderHash string `json:"order_hash"`
}

CancelOrderParams 取消订单参数

type CancelOrderResponse

type CancelOrderResponse struct {
	RequestID string `json:"request_id"`
}

CancelOrderResponse 取消订单返回数据

type OrderInfo

type OrderInfo struct {

	// 订单状态
	// - `new`:      新建状态
	// - `paid`:     已经支付状态
	// - `canceled`: 被取消状态
	// - `complete`: 订单下所有子订单都已经完成
	// - `refund`:   用户订单执行了退款
	Status string `json:"status"`

	CreateTime   time.Time `json:"create_time"`   // 订单创建时间
	CompleteTime time.Time `json:"complete_time"` // 订单完成时间
	CancelTime   time.Time `json:"cancel_time"`   // 订单取消时间
	PayTime      time.Time `json:"pay_time"`      // 订单支付时间

	Order struct {
		OrderDetail struct {
			ID          int       `json:"id"`           // ID
			Order       string    `json:"order"`        // 订单号
			Fee         float64   `json:"fee"`          // 订单原价
			CFee        float64   `json:"c_fee"`        // 订单实际价格
			CreateTime  time.Time `json:"create_time"`  // 创建时间
			UpdateTime  time.Time `json:"update_time"`  // 更新时间
			PayTime     time.Time `json:"pay_time"`     // 支付时间
			ExpiredTime time.Time `json:"expired_time"` // 订单过期时间
			Status      int       `json:"status"`       // 订单状态 1: 未支付 2: 已支付 3:作废, 4: 垫付,5: 后付费
		} `json:"bo_order"`

		OrderTag string `json:"order_tag"` // 订单标签
	} `json:"order"`

	Resources []struct {

		// 订单类型
		//
		// - `create`:              新建
		// - `renew`:               续费
		// - `auto_renew`:          自动续费
		// - `to_prepaid`:          按需转包月
		// - `upgrade`:             升级
		// - `replace_system_disk`: 更换系统盘
		// - `to_prepaid_disk`:     按需磁盘转包月
		// - `renew_with_spec`:     续费变配
		OrderType string `json:"order_type"`

		// 资源类型
		ResourceType params.ResourceType `json:"resource_type"`

		// 资源 ID
		ResourceID string `json:"resource_id"`

		// 地域
		RegionID string `json:"region"`

		// 金额
		Price float64 `json:"price"`

		// 状态
		//
		// - `non_executable`: 不可执行状态
		// - `executable`:     可执行状态
		// - `processing`:     正在执行中
		// - `success`:        执行成功
		// - `failed`:         执行失败
		// - `fail_over`:      失败次数过多
		// - `cancelled`:      被取消
		// - `refunded`:       已退款
		Status string `json:"status"`

		LifeStartTime  time.Time `json:"life_start_time"`  // 计费周期
		LifeExpireTime time.Time `json:"life_expire_time"` // 计费周期
	} `json:"resource_order_infos"`
}

OrderInfo 订单信息

type PayOrderParams

type PayOrderParams struct {
	OrderHash string `json:"order_hash"`
}

PayOrderParams 支付订单参数

type PayOrderResponse

type PayOrderResponse struct {
	RequestID string `json:"request_id"`
}

PayOrderResponse 支付订单返回数据

type UnpaidOrdersParams

type UnpaidOrdersParams struct {
	ResourceType params.ResourceType `json:"resource_type"` // 资源类型
}

UnpaidOrdersParams 未支付订单列表参数

type UnpaidOrdersResponse

type UnpaidOrdersResponse struct {
	RequestID string      `json:"request_id"` // 请求 ID
	Data      []OrderInfo `json:"data"`       // 订单信息
}

UnpaidOrdersResponse 未支付订单列表返回数据

Jump to

Keyboard shortcuts

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