cicil

package module
v1.0.0 Latest Latest
Warning

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

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

README

cicil-go

Unofficial CICIL SDK for Go Programming Language

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(baseUrl string, apiKey string, merchantId string, merchantSecret string, timeout time.Duration) *cicil

New Function, create cicil pointer Required parameter : 1. Your MerchantID (this from Team cicil) 2. Your MerchantSecret (this from Team cicil) 3. Your APIKey (this from Team cicil) 3. BaseURL (hit to endpoint ex: https://sandbox-api.cicil.dev/v1 for sandbox. this value based on https://docs.cicil.app/#introduction)

Types

type Buyer

type Buyer struct {
	Fullname   string `json:"fullname"`
	Email      string `json:"email"`
	Phone      string `json:"phone"`
	Address    string `json:"address"`
	City       string `json:"city"`
	District   string `json:"district"`
	PostalCode string `json:"postal_code"`
	Company    string `json:"company"`
	Country    string `json:"country"`
}

type CancelOrderRequest

type CancelOrderRequest struct {
	PONumber      string `json:"po_number"`
	Reason        string `json:"reason"`
	CancelledBy   string `json:"cancelled_by"`
	TotalAmount   int    `json:"total_amount"`
	TransactionID string `json:"transaction_id"`
}

type CancelOrderResponse

type CancelOrderResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

type CheckoutRequest

type CheckoutRequest struct {
	Transaction Transaction  `json:"transaction"`
	PushURL     string       `json:"push_url"`
	RedirectURL string       `json:"redirect_url"`
	Buyer       Buyer        `json:"buyer"`
	Shipment    Shipment     `json:"shipment"`
	SellerList  []SellerList `json:"seller_list,omitempty"`
	BackURL     string       `json:"back_url"`
}

type CheckoutResponse

type CheckoutResponse struct {
	Status   string `json:"status"`
	Message  string `json:"message"`
	PoNumber string `json:"po_number"`
	Url      string `json:"url"`
}

type CicilService

type CicilService interface {
	GetToken() (digest string, dateNowReturn string)
	GetCheckoutURL(param CheckoutRequest) (resp CheckoutResponse, err error)
	SetCancelOrder(param CancelOrderRequest) (resp CancelOrderResponse, err error)
	UpdateStatus(param UpdateStatusRequest) (resp UpdateStatusResponse, err error)
}

type ItemList

type ItemList struct {
	ItemID   string `json:"item_id"`
	Type     string `json:"type"`
	Name     string `json:"name"`
	Price    int    `json:"price"`
	Quantity int    `json:"quantity"`
	Category string `json:"category,omitempty"`
	Url      string `json:"url,omitempty"`
	SellerID string `json:"seller_id,omitempty"`
}

type SellerList

type SellerList struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Phone string `json:"phone"`
	Url   string `json:"url"`
}

type Shipment

type Shipment struct {
	ShipmentProvider string `json:"shipment_provider"`
	ShipmentPrice    int    `json:"shipment_price"`
	ShipmentTax      int    `json:"shipment_tax"`
	Address          string `json:"address"`
	City             string `json:"city"`
	District         string `json:"district"`
	PostalCode       string `json:"postal_code"`
	Phone            string `json:"phone"`
	Company          string `json:"company"`
	Name             string `json:"name"`
	Country          string `json:"country"`
}

type Transaction

type Transaction struct {
	TotalAmount   int        `json:"total_amount"`
	TransactionID string     `json:"transaction_id"`
	ItemLists     []ItemList `json:"item_list"`
}

type UpdateStatusRequest

type UpdateStatusRequest struct {
	PONumber      string   `json:"po_number"`
	POStatus      string   `json:"po_status"`
	TransactionID string   `json:"transaction_id"`
	Shipment      Shipment `json:"shipment,omitempty"`
	Reason        string   `json:"reason,omitempty"`
}

type UpdateStatusResponse

type UpdateStatusResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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