Yimaru-BackEnd/internal/domain/telebirr.go
2025-08-04 14:27:52 +03:00

61 lines
2.7 KiB
Go

package domain
type TelebirrFabricTokenResponse struct {
Token string `json:"token"`
EffectiveDate string `json:"effectiveDate"`
ExpirationDate string `json:"expirationDate"`
}
type TelebirrBizContent struct {
NotifyURL string `json:"notify_url"`
AppID string `json:"appid"`
MerchCode string `json:"merch_code"`
MerchOrderID string `json:"merch_order_id"`
TradeType string `json:"trade_type"`
Title string `json:"title"`
TotalAmount string `json:"total_amount"`
TransCurrency string `json:"trans_currency"`
TimeoutExpress string `json:"timeout_express"`
BusinessType string `json:"business_type"`
PayeeIdentifier string `json:"payee_identifier"`
PayeeIdentifierType string `json:"payee_identifier_type"`
PayeeType string `json:"payee_type"`
RedirectURL string `json:"redirect_url"`
CallbackInfo string `json:"callback_info"`
}
type TelebirrPreOrderRequestPayload struct {
Timestamp string `json:"timestamp"`
NonceStr string `json:"nonce_str"`
Method string `json:"method"`
Version string `json:"version"`
BizContent TelebirrBizContent `json:"biz_content"`
SignType string `json:"sign_type"`
Sign string `json:"sign"`
}
type TelebirrCheckoutParams struct {
AppID string `json:"appid"`
MerchCode string `json:"merch_code"`
NonceStr string `json:"nonce_str"`
PrepayID string `json:"prepay_id"`
Timestamp string `json:"timestamp"`
}
type TelebirrPaymentCallbackPayload struct {
NotifyURL string `json:"notify_url"` // Optional callback URL
AppID string `json:"appid"` // App ID provided by Telebirr
NotifyTime string `json:"notify_time"` // Notification timestamp (UTC, in seconds)
MerchCode string `json:"merch_code"` // Merchant short code
MerchOrderID string `json:"merch_order_id"` // Order ID from merchant system
PaymentOrderID string `json:"payment_order_id"` // Order ID from Telebirr system
TotalAmount string `json:"total_amount"` // Payment amount
TransID string `json:"trans_id"` // Transaction ID
TransCurrency string `json:"trans_currency"` // Currency type (e.g., ETB)
TradeStatus string `json:"trade_status"` // Payment status (e.g., Completed, Failure)
TransEndTime string `json:"trans_end_time"` // Transaction end time (UTC seconds)
CallbackInfo string `json:"callback_info"` // Optional merchant-defined callback data
Sign string `json:"sign"` // Signature of the payload
SignType string `json:"sign_type"` // Signature type, e.g., SHA256WithRSA
}