Yimaru-BackEnd/internal/domain/arifpay.go
2025-11-06 16:37:41 +03:00

78 lines
2.4 KiB
Go

package domain
type CheckoutSessionRequest struct {
CancelURL string `json:"cancelUrl"`
Phone string `json:"phone"`
Email string `json:"email"`
Nonce string `json:"nonce"`
SuccessURL string `json:"successUrl"`
ErrorURL string `json:"errorUrl"`
NotifyURL string `json:"notifyUrl"`
PaymentMethods []string `json:"paymentMethods"`
ExpireDate string `json:"expireDate"` // could also use time.Time if you parse it
Items []struct {
Name string `json:"name"`
Quantity int `json:"quantity"`
Price float64 `json:"price"`
Description string `json:"description"`
} `json:"items"`
Beneficiaries []struct {
AccountNumber string `json:"accountNumber"`
Bank string `json:"bank"`
Amount float64 `json:"amount"`
} `json:"beneficiaries"`
Lang string `json:"lang"`
}
type CheckoutSessionClientRequest struct {
Amount float64 `json:"amount" binding:"required"`
CustomerEmail string `json:"customerEmail" binding:"required"`
CustomerPhone string `json:"customerPhone" binding:"required"`
}
type CancelCheckoutSessionResponse struct {
Error bool `json:"error"`
Msg string `json:"msg"`
Data struct {
SessionID string `json:"sessionId"`
PaymentURL string `json:"paymentUrl"`
CancelURL string `json:"cancelUrl"`
TotalAmount float64 `json:"totalAmount"`
} `json:"data"`
}
type WebhookRequest struct {
UUID string `json:"uuid"`
Nonce string `json:"nonce"`
Phone string `json:"phone"`
PaymentMethod string `json:"paymentMethod"`
TotalAmount int64 `json:"totalAmount"`
TransactionStatus string `json:"transactionStatus"`
Transaction struct {
TransactionID string `json:"transactionId"`
TransactionStatus string `json:"transactionStatus"`
} `json:"transaction"`
NotificationURL string `json:"notificationUrl"`
SessionID string `json:"sessionId"`
}
// type ArifpayB2CRequest struct{
// PhoneNumber string `json:"Phonenumber"`
// Amount float64 `json:"amount" binding:"required"`
// CustomerEmail string `json:"customerEmail" binding:"required"`
// // CustomerPhone string `json:"customerPhone" binding:"required"`
// }
type ArifpayVerifyByTransactionIDRequest struct{
TransactionId string `json:"transactionId"`
PaymentType int `json:"paymentType"`
}
type ARIFPAYPaymentMethod struct {
ID int
Name string
}