2023-07-27 08:11:40 +00:00
|
|
|
package viva
|
|
|
|
|
2023-07-27 20:46:37 +00:00
|
|
|
import "payment-poc/database"
|
2023-07-27 08:11:40 +00:00
|
|
|
|
2023-07-27 20:46:37 +00:00
|
|
|
type OrderRequest struct {
|
2023-07-27 08:11:40 +00:00
|
|
|
Amount int64 `json:"amount"`
|
|
|
|
Description string `json:"customerTrns"`
|
|
|
|
MerchantDescription string `json:"merchantTrns"`
|
|
|
|
PreAuth bool `json:"preauth"`
|
|
|
|
AllowRecurring bool `json:"allowRecurring"`
|
|
|
|
Source string `json:"sourceCode"`
|
|
|
|
}
|
|
|
|
|
2023-07-27 20:46:37 +00:00
|
|
|
type OrderResponse struct {
|
|
|
|
OrderId database.OrderId `json:"orderCode"`
|
2023-07-27 08:11:40 +00:00
|
|
|
}
|
|
|
|
|
2023-07-27 20:46:37 +00:00
|
|
|
type OAuthResponse struct {
|
2023-07-27 08:11:40 +00:00
|
|
|
AccessToken string `json:"access_token"`
|
|
|
|
ExpiresIn int `json:"expires_in"`
|
|
|
|
}
|
|
|
|
|
2023-07-27 20:46:37 +00:00
|
|
|
type TransactionCompleteRequest struct {
|
2023-07-27 08:11:40 +00:00
|
|
|
Amount int64 `json:"amount"`
|
|
|
|
CustomerDescription string `json:"customerTrns"`
|
|
|
|
}
|
|
|
|
|
2023-07-27 20:46:37 +00:00
|
|
|
type TransactionResponse struct {
|
2023-07-27 08:11:40 +00:00
|
|
|
Amount float64 `json:"Amount"`
|
|
|
|
StatusId string `json:"StatusId"`
|
|
|
|
ErrorCode int64 `json:"ErrorCode"`
|
|
|
|
ErrorText string `json:"ErrorText"`
|
|
|
|
EventId int64 `json:"EventId"`
|
|
|
|
Success bool `json:"Success"`
|
|
|
|
}
|