Documentation ¶
Index ¶
- Constants
- func Md5Encrypt(text string) string
- func Sha1_HMAC(k string, message string) string
- func Sha256Encrypt(s string) string
- func Sha256_HMAC(k string, message string) string
- func Sha512Encrypt(s string) string
- func ShaOneEncrypt(s string) string
- type CalculatorProductReq
- type Client
- type Customer
- type ErrorResponse
- type Middleware
- func (g *Middleware) BuyCancel(req *ReqTransactionCancel) (SuccessResponse, error)
- func (g *Middleware) BuyConfirm(req *ReqTransactionConfirm) (SuccessResponse, error)
- func (g *Middleware) BuyInit(req *ReqTransactionInit) (SuccessResponse, error)
- func (g *Middleware) CalculatorProduct(req *CalculatorProductReq) (SuccessResponse, error)
- func (c *Middleware) Call(method, path string, body io.Reader) ([]byte, error)
- func (c *Middleware) CallPublic(method, path string, body io.Reader) ([]byte, error)
- func (g *Middleware) CustomerProfile(merchant_customer_id string) (resp SuccessResponse, err error)
- func (g *Middleware) ProductList() (SuccessResponse, error)
- func (g *Middleware) ProductLog(req *ProductLogReq) (SuccessResponse, error)
- func (g *Middleware) SellConfirm(req *ReqTransactionConfirm) (SuccessResponse, error)
- func (g *Middleware) SellInit(req *ReqTransactionInit) (SuccessResponse, error)
- func (g *Middleware) SellReverse(req *ReqTransactionCancel) (SuccessResponse, error)
- func (g *Middleware) ShippingCode() (SuccessResponse, error)
- func (g *Middleware) ShippingTracking(awb_number string) (SuccessResponse, error)
- func (g *Middleware) TransactionDetail(payment_id string) (resp SuccessResponse, err error)
- func (g *Middleware) TransactionList(req *TransactionListReq) (SuccessResponse, error)
- func (g *Middleware) WithdrawCancel(req *ReqTransactionCancel) (SuccessResponse, error)
- func (g *Middleware) WithdrawConfirm(req *ReqTransactionConfirm) (SuccessResponse, error)
- func (g *Middleware) WithdrawInit(req *ReqTransactionInit) (SuccessResponse, error)
- type Product
- type ProductLogReq
- type ReqTransactionCancel
- type ReqTransactionConfirm
- type ReqTransactionInit
- type SuccessResponse
- type TransCustomer
- type Transaction
- type TransactionListReq
- type TransactionWithdraw
- type TransactionWithdrawAddress
- type TransactionWithdrawDetail
Constants ¶
View Source
const ( VarTransactionCancel = 0 VarTransactionPending = 5 VarTransactionDelivering = 8 VarTransactionSuccess = 10 VarTransactionDelivered = 10 VarPaymentCancel = 0 VarPaymentPending = 5 VarPaymentPaid = 10 )
View Source
const ( // GET EndpointCustomerDetail = "/customer/" EndpointProductList = "/product" EndpointProductLog = "/product-log" EndpointTransaction = "/transaction" EndpointTransactionDetail = "/transaction/" EndpointShippingCode = "/shipping/init" EndpointShippingTracking = "/shipping/tracking" // POST EndpointBuyInit = "/buy-gold" EndpointBuyConfirm = "/buy-gold-confirm" EndpointBuyCancel = "/buy-gold-cancel" EndpointSellInit = "/sell-gold" EndpointSellConfirm = "/sell-gold-confirm" EndpointSellReversal = "/sell-gold-reverse" EndpointWithdrawInit = "/withdraw-gold" EndpointWithdrawConfirm = "/withdraw-gold-confirm" EndpointWithdrawCancel = "/withdraw-cancel" EndpointCalculatorProduct = "/calculator/product" )
View Source
const EMAS_DEVELOPMENT = "https://oroconnect-dev.e-mas.com/v2/thirdparty"
View Source
const EMAS_PRODUCTION = ""
Variables ¶
This section is empty.
Functions ¶
func Md5Encrypt ¶
func Sha256Encrypt ¶
func Sha256_HMAC ¶
func Sha512Encrypt ¶
func ShaOneEncrypt ¶
Types ¶
type CalculatorProductReq ¶
type Client ¶
type ErrorResponse ¶
type Middleware ¶
type Middleware struct {
Client Client
}
func (*Middleware) BuyCancel ¶
func (g *Middleware) BuyCancel(req *ReqTransactionCancel) (SuccessResponse, error)
func (*Middleware) BuyConfirm ¶
func (g *Middleware) BuyConfirm(req *ReqTransactionConfirm) (SuccessResponse, error)
func (*Middleware) BuyInit ¶
func (g *Middleware) BuyInit(req *ReqTransactionInit) (SuccessResponse, error)
func (*Middleware) CalculatorProduct ¶
func (g *Middleware) CalculatorProduct(req *CalculatorProductReq) (SuccessResponse, error)
func (*Middleware) CallPublic ¶
func (*Middleware) CustomerProfile ¶
func (g *Middleware) CustomerProfile(merchant_customer_id string) (resp SuccessResponse, err error)
func (*Middleware) ProductList ¶
func (g *Middleware) ProductList() (SuccessResponse, error)
func (*Middleware) ProductLog ¶
func (g *Middleware) ProductLog(req *ProductLogReq) (SuccessResponse, error)
func (*Middleware) SellConfirm ¶
func (g *Middleware) SellConfirm(req *ReqTransactionConfirm) (SuccessResponse, error)
func (*Middleware) SellInit ¶
func (g *Middleware) SellInit(req *ReqTransactionInit) (SuccessResponse, error)
func (*Middleware) SellReverse ¶
func (g *Middleware) SellReverse(req *ReqTransactionCancel) (SuccessResponse, error)
func (*Middleware) ShippingCode ¶
func (g *Middleware) ShippingCode() (SuccessResponse, error)
func (*Middleware) ShippingTracking ¶
func (g *Middleware) ShippingTracking(awb_number string) (SuccessResponse, error)
func (*Middleware) TransactionDetail ¶
func (g *Middleware) TransactionDetail(payment_id string) (resp SuccessResponse, err error)
func (*Middleware) TransactionList ¶
func (g *Middleware) TransactionList(req *TransactionListReq) (SuccessResponse, error)
func (*Middleware) WithdrawCancel ¶
func (g *Middleware) WithdrawCancel(req *ReqTransactionCancel) (SuccessResponse, error)
func (*Middleware) WithdrawConfirm ¶
func (g *Middleware) WithdrawConfirm(req *ReqTransactionConfirm) (SuccessResponse, error)
func (*Middleware) WithdrawInit ¶
func (g *Middleware) WithdrawInit(req *ReqTransactionInit) (SuccessResponse, error)
type Product ¶
type Product struct { Id uint64 `json:"id"` Name string `json:"name"` Description string `json:"description"` Weight int `json:"weight"` SellPrice uint32 `json:"sell_price"` // We sell to customer BuyPrice uint32 `json:"buy_price"` // We buy from customer AdminFee int `json:"admin_fee"` Image string `json:"image"` }
type ProductLogReq ¶
type ReqTransactionCancel ¶
type ReqTransactionConfirm ¶
type ReqTransactionInit ¶
type ReqTransactionInit struct { Customer TransCustomer `json:"customer"` Email string `json:"email"` IdCardNumber string `json:"id_card_number"` IdCardPhotoUrl string `json:"id_card_photo_url"` IdCardPhotoSelfieUrl string `json:"id_card_photo_selfie_url"` Gender string `json:"gender"` Weight float64 `json:"weight"` Amount int `json:"amount"` Insurance int `json:"insurance"` Birthdate string `json:"birthdate"` TransactionWithdraw }
type SuccessResponse ¶
type TransCustomer ¶
type TransCustomer struct { MerchantCustomerId string `json:"merchant_customer_id"` Handphone string `json:"handphone"` Fullname string `json:"fullname"` Email string `json:"email"` IdCardNumber string `json:"id_card_number"` IdCardPhotoUrl string `json:"id_card_photo_url"` IdCardPhotoSelfieUrl string `json:"id_card_photo_selfie_url"` Gender string `json:"gender"` Birthdate string `json:"birthdate"` }
type Transaction ¶
type Transaction struct { PaymentId string `json:"payment_id"` Description string `json:"description"` Balance float64 `json:"balance,omitempty"` Weight float64 `json:"weight"` Price float64 `json:"price"` AdminFee int `json:"admin_fee"` PricePerGram float64 `json:"price_per_gram"` Status uint8 `json:"status"` PaymentStatus int `json:"payment_status"` Withdraw *TransactionWithdraw `json:"withdraw_detail,omitempty"` CreatedAt time.Time `json:"created_at"` }
type TransactionListReq ¶
type TransactionWithdraw ¶
type TransactionWithdraw struct { Handphone string `json:"handphone"` Fullname string `json:"fullname"` Address *TransactionWithdrawAddress `json:"address"` ShippingCompany int `json:"shipping_company"` // 1 = JNE_REG, 2 = JNE_YES, 12 = RPX_NDP ShippingFee int `json:"shipping_fee"` ShippingCode string `json:"shipping_code"` Insurance int `json:"insurance"` Detail []*TransactionWithdrawDetail `json:"detail"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.