Documentation
¶
Index ¶
- Constants
- func ComputeHmac256(message, secret []byte) string
- func ErrorStatusText(code int) string
- type AccountRequest
- type BaseRequest
- type BaseResponse
- type CancelWebhookRequest
- type Client
- func (c *Client) AuthorizeCryptogramPayment(cpr CryptogramPaymentRequest) (*Payment3DSResponse, error)
- func (c *Client) AuthorizeTokenPayment(tpr TokenPaymentRequest) (*PaymentResponse, error)
- func (c *Client) CancelSubscription(sur SubscriptionUpdateRequest) (*BaseResponse, error)
- func (c *Client) ChargeCryptogramPayment(cpr *CryptogramPaymentRequest) (*PaymentResponse, error)
- func (c *Client) ChargeCryptogramPayout()
- func (c *Client) ChargeTokenPayment(tpr TokenPaymentRequest) (*PaymentResponse, error)
- func (c *Client) ChargeTokenPayout()
- func (c *Client) Confirm3DSPayment(confirm3DS Confirm3DSRequest) (*PaymentResponse, error)
- func (c *Client) ConfirmPayment(confirm ConfirmPaymentRequest) (*BaseResponse, error)
- func (c *Client) CreateOrder(lpr LinkPaymentRequest) (*BaseResponse, error)
- func (c *Client) CreateSubscription(scr SubscriptionCreateRequest) (*SubscriptionResponse, error)
- func (c *Client) FindPaymentByInvoiceID(fpr FindPaymentRequest) (*PaymentResponse, error)
- func (c *Client) GetSubscription(sgr SubscriptionGetRequest) (*SubscriptionResponse, error)
- func (c *Client) GetSubscriptionsList(slr SubscriptionListRequest) (*SubscriptionsListResponse, error)
- func (c *Client) Payment(gpr GetPaymentRequest) (*PaymentResponse, error)
- func (c *Client) PaymentsList()
- func (c *Client) Ping() (map[string]interface{}, error)
- func (c *Client) RefundPayment(rpp RefundPaymentRequest) (*BaseResponse, error)
- func (c *Client) UpdateSubscription(sur SubscriptionUpdateRequest) (*SubscriptionResponse, error)
- func (c *Client) VoidPayment(vpr VoidPaymentRequest) (*BaseResponse, error)
- type Config
- type Confirm3DSRequest
- type ConfirmPaymentRequest
- type CryptogramPaymentRequest
- type FailWebhookRequest
- type FindPaymentRequest
- type GetPaymentRequest
- type LinkPaymentRequest
- type PayWebhookRequest
- type Payment3DSModel
- type Payment3DSResponse
- type PaymentModel
- type PaymentRequest
- type PaymentResponse
- type PaymentStatus
- type RefundPaymentRequest
- type RefundWebhookRequest
- type SubscriptionBase
- type SubscriptionCreateRequest
- type SubscriptionGetRequest
- type SubscriptionListRequest
- type SubscriptionModel
- type SubscriptionResponse
- type SubscriptionUpdateRequest
- type SubscriptionsListResponse
- type TokenPaymentRequest
- type VoidPaymentRequest
- type WebhookResponse
Constants ¶
const ( ReferToCardIssuer = 5001 // Отказ эмитента проводить онлайн операцию // DoNotHonor Отказ эмитента без объяснения причин // Данный код возвращается по следующим причинам: // — неверно указан код CVV на картах MasterCard; // — внутренние ограничения банка, выпустившего карту; // — карта заблокирована или еще не активирована; // — на карте не включены интернет-платежи или не подключен 3DS. DoNotHonor = 5005 Error = 5006 // Отказ сети проводить операцию или неправильный CVV код InvalidTransaction = 5012 // Карта не предназначена для онлайн платежей AmountError = 5013 // Слишком маленькая или слишком большая сумма операции FormatError = 5030 // Ошибка на стороне эквайера — неверно сформирована транзакция BankNotSupportedBySwitch = 5031 // Неизвестный эмитент карты SuspectedFraud = 5034 // Отказ эмитента — подозрение на мошенничество LostCard = 5041 // Карта потеряна StolenCard = 5043 // Карта украдена InsufficientFunds = 5051 // Недостаточно средств ExpiredCard = 5054 // Карта просрочена или неверно указан срок действия // TransactionNotPermitted Ограничение на карте // Данный код возвращается по следующим причинам: // — внутренние ограничения банка, выпустившего карту; // — карта заблокирована или еще не активирована; // — на карте не включены интернет-платежи или не подключен 3DS. TransactionNotPermitted = 5057 ExceedWithdrawalFrequency = 5065 // Превышен лимит операций по карте IncorrectCVV = 5082 // Неверный CVV код Timeout = 5091 // Эмитент недоступен CannotReachNetwork = 5092 // Эмитент недоступен SystemError = 5096 // Ошибка банка-эквайера или сети UnableToProcess = 5204 // Операция не может быть обработана по прочим причинам AuthenticationFailed = 5206 // 3-D Secure авторизация не пройдена AntiFraud = 5300 // Лимиты эквайера на проведение операций )
const ( SUCCESS = 0 UNKNOWN_INVOICE_ID = 10 INVALID_ACCOUNT_ID = 11 INVALID_AMOUNT = 12 REJECTED = 13 EXPIRED = 20 )
const ( KZT = "KZT" RUB = "RUB" EUR = "EUR" USD = "USD" GBP = "GBP" UAH = "UAH" BYR = "BYR" BYN = "BYN" AZN = "AZN" CHF = "CHF" CZK = "CZK" CAD = "CAD" PLN = "PLN" SEK = "SEK" TRY = "TRY" CNY = "CNY" INR = "INR" )
const (
DefaultRequestTimeout = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func ComputeHmac256 ¶
func ErrorStatusText ¶
ErrorStatusText returns a text of error codes that determine the reason for the refusal to make a payment string if the code is unknown.
Types ¶
type AccountRequest ¶
type BaseRequest ¶
type BaseResponse ¶
type CancelWebhookRequest ¶
type CancelWebhookRequest struct { TransactionId int `json:"TransactionId"` Amount float64 `json:"Amount"` DateTime time.Time `json:"DateTime"` InvoiceId string `json:"InvoiceId,omitempty"` AccountId string `json:"AccountId,omitempty"` Email string `json:"Email,omitempty"` Data map[string]interface{} `json:"Data,omitempty"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AuthorizeCryptogramPayment ¶
func (c *Client) AuthorizeCryptogramPayment(cpr CryptogramPaymentRequest) (*Payment3DSResponse, error)
AuthorizeCryptogramPayment two-stage payment
func (*Client) AuthorizeTokenPayment ¶
func (c *Client) AuthorizeTokenPayment(tpr TokenPaymentRequest) (*PaymentResponse, error)
AuthorizeTokenPayment authorize token payment
func (*Client) CancelSubscription ¶
func (c *Client) CancelSubscription(sur SubscriptionUpdateRequest) (*BaseResponse, error)
CancelSubscription cancel subscription
func (*Client) ChargeCryptogramPayment ¶
func (c *Client) ChargeCryptogramPayment(cpr *CryptogramPaymentRequest) (*PaymentResponse, error)
ChargeCryptogramPayment Payment by cryptogram
func (*Client) ChargeCryptogramPayout ¶
func (c *Client) ChargeCryptogramPayout()
func (*Client) ChargeTokenPayment ¶
func (c *Client) ChargeTokenPayment(tpr TokenPaymentRequest) (*PaymentResponse, error)
ChargeTokenPayment payment by token
func (*Client) ChargeTokenPayout ¶
func (c *Client) ChargeTokenPayout()
func (*Client) Confirm3DSPayment ¶
func (c *Client) Confirm3DSPayment(confirm3DS Confirm3DSRequest) (*PaymentResponse, error)
Confirm3DSPayment Confirm a 3DS payment
func (*Client) ConfirmPayment ¶
func (c *Client) ConfirmPayment(confirm ConfirmPaymentRequest) (*BaseResponse, error)
ConfirmPayment confirm an authorized payment
func (*Client) CreateOrder ¶
func (c *Client) CreateOrder(lpr LinkPaymentRequest) (*BaseResponse, error)
CreateOrder to send by email
func (*Client) CreateSubscription ¶
func (c *Client) CreateSubscription(scr SubscriptionCreateRequest) (*SubscriptionResponse, error)
CreateSubscription create subscription
func (*Client) FindPaymentByInvoiceID ¶
func (c *Client) FindPaymentByInvoiceID(fpr FindPaymentRequest) (*PaymentResponse, error)
FindPaymentByInvoiceID
func (*Client) GetSubscription ¶
func (c *Client) GetSubscription(sgr SubscriptionGetRequest) (*SubscriptionResponse, error)
GetSubscription get subscription by ID of transaction
func (*Client) GetSubscriptionsList ¶
func (c *Client) GetSubscriptionsList(slr SubscriptionListRequest) (*SubscriptionsListResponse, error)
GetSubscriptionsList get subscription list by AccountId
func (*Client) Payment ¶
func (c *Client) Payment(gpr GetPaymentRequest) (*PaymentResponse, error)
Payment getting pyment by transaction id
func (*Client) RefundPayment ¶
func (c *Client) RefundPayment(rpp RefundPaymentRequest) (*BaseResponse, error)
RefundPayment refund
func (*Client) UpdateSubscription ¶
func (c *Client) UpdateSubscription(sur SubscriptionUpdateRequest) (*SubscriptionResponse, error)
UpdateSubscription update subscription
func (*Client) VoidPayment ¶
func (c *Client) VoidPayment(vpr VoidPaymentRequest) (*BaseResponse, error)
VoidPayment cancellation of payment
type Confirm3DSRequest ¶
type Confirm3DSRequest struct { BaseRequest TransactionId string PaRes string }
type ConfirmPaymentRequest ¶
type ConfirmPaymentRequest struct { BaseRequest TransactionId int Amount float64 JsonData *string }
type CryptogramPaymentRequest ¶
type CryptogramPaymentRequest struct { PaymentRequest CardCryptogramPacket string AccountId *string }
type FailWebhookRequest ¶
type FailWebhookRequest struct { TransactionId int `json:"TransactionId"` Amount float64 `json:"Amount"` Currency string `json:"Currency"` PaymentAmount string `json:"PaymentAmount"` PaymentCurrency string `json:"PaymentCurrency"` DateTime time.Time `json:"DateTime"` CardFirstSix string `json:"CardFirstSix"` CardLastFour string `json:"CardLastFour"` CardExpDate string `json:"CardExpDate"` TestMode int `json:"TestMode"` Reason string `json:"Reason"` ReasonCode int `json:"ReasonCode"` OperationType string `json:"OperationType"` InvoiceId string `json:"InvoiceId,omitempty"` AccountId string `json:"AccountId,omitempty"` SubscriptionId string `json:"SubscriptionId,omitempty"` Name string `json:"Name,omitempty"` Email string `json:"Email,omitempty"` IpAddress string `json:"IpAddress,omitempty"` IpCountry string `json:"IpCountry,omitempty"` IpCity string `json:"IpCity,omitempty"` IpRegion string `json:"IpRegion,omitempty"` IpDistrict string `json:"IpDistrict,omitempty"` IpLatitude float64 `json:"IpLatitude,omitempty"` IpLongitude float64 `json:"IpLongitude,omitempty"` Issuer string `json:"Issuer,omitempty"` IssuerBankCountry string `json:"IssuerBankCountry,omitempty"` Description string `json:"Description,omitempty"` Data map[string]interface{} `json:"Data,omitempty"` Token string `json:"Token,omitempty"` PaymentMethod string `json:"PaymentMethod,omitempty"` FallBackScenarioDeclinedTransactionId int `json:"FallBackScenarioDeclinedTransactionId,omitempty"` }
type FindPaymentRequest ¶
type FindPaymentRequest struct { BaseRequest InvoiceId string }
type GetPaymentRequest ¶
type GetPaymentRequest struct { BaseRequest TransactionId int }
type LinkPaymentRequest ¶
type LinkPaymentRequest struct { BaseRequest Amount int Currency string // ValidCurrency JsonData *string Description string // contains filtered or unexported fields }
type PayWebhookRequest ¶
type PayWebhookRequest struct { TransactionId int `json:"TransactionId"` Amount float64 `json:"Amount"` Currency string `json:"Currency"` PaymentAmount string `json:"PaymentAmount"` PaymentCurrency string `json:"PaymentCurrency"` DateTime time.Time `json:"DateTime"` CardFirstSix string `json:"CardFirstSix"` CardLastFour string `json:"CardLastFour"` CardExpDate string `json:"CardExpDate"` TestMode int `json:"TestMode"` Status string `json:"Status"` OperationType string `json:"OperationType"` GatewayName string `json:"GatewayName"` InvoiceId string `json:"InvoiceId,omitempty"` AccountId string `json:"AccountId,omitempty"` SubscriptionId string `json:"SubscriptionId,omitempty"` Name string `json:"Name,omitempty"` Email string `json:"Email,omitempty"` IpAddress string `json:"IpAddress,omitempty"` IpCountry string `json:"IpCountry,omitempty"` IpCity string `json:"IpCity,omitempty"` IpRegion string `json:"IpRegion,omitempty"` IpDistrict string `json:"IpDistrict,omitempty"` IpLatitude float64 `json:"IpLatitude,omitempty"` IpLongitude float64 `json:"IpLongitude,omitempty"` Issuer string `json:"Issuer,omitempty"` IssuerBankCountry string `json:"IssuerBankCountry,omitempty"` Description string `json:"Description,omitempty"` AuthCode string `json:"AuthCode,omitempty"` Data map[string]interface{} `json:"Data,omitempty"` Token string `json:"Token,omitempty"` CardProduct string `json:"CardProduct,omitempty"` PaymentMethod string `json:"PaymentMethod,omitempty"` FallBackScenarioDeclinedTransactionId int `json:"FallBackScenarioDeclinedTransactionId,omitempty"` }
type Payment3DSModel ¶
type Payment3DSModel struct { PaReq string `json:"PaReq,omitempty"` AcsUrl string `json:"AcsUrl,omitempty"` ThreeDsCallbackId string `jsno:"ThreeDsCallbackId,omitempty"` AuthDate string `json:"AuthDate,omitempty"` AuthDateIso string `json:"AuthDateIso,omitempty"` AuthCode string `json:"AuthCode,omitempty"` ConfirmDate string `json:"ConfirmDate,omitempty"` ConfirmDateIso string `json:"ConfirmDateIso,omitempty"` }
type Payment3DSResponse ¶
type Payment3DSResponse struct { BaseResponse Model struct { PaymentModel Payment3DSModel } }
type PaymentModel ¶
type PaymentModel struct { TransactionId int `json:"TransactionId,omitempty"` Amount float64 `json:"Amount,omitempty"` Currency string `json:"Currency,omitempty"` CurrencyCode int `json:"CurrencyCode,omitempty"` InvoiceID string `json:"InvoiceID,omitempty"` AccountID string `json:"AccountID,omitempty"` Email string `json:"Email,omitempty"` Description string `json:"Description,omitempty"` Data []byte `json:"Data,omitempty"` TestMode bool `json:"TestMode,omitempty"` IpAddress string `json:"IpAddress,omitempty"` IpCountry string `json:"IpCountry,omitempty"` IpCity string `json:"IpCity,omitempty"` IpRegion string `json:"IpRegion,omitempty"` IpDistrict string `json:"IpDistrict,omitempty"` IpLatitude float64 `json:"IpLatitude,omitempty"` IpLongitude float64 `json:"IpLongitude,omitempty"` CardFirstSix string `json:"CardFirstSix,omitempty"` CardLastFour string `json:"CardLastFour,omitempty"` CardExpiredMonth int `json:"CardExpiredMonth,omitempty"` CardExpiredYear int `json:"CardExpiredYear,omitempty"` CardType string `json:"CardType,omitempty"` CardTypeCode int `json:"CardTypeCode,omitempty"` Issuer string `json:"Issuer,omitempty"` IssuerBankCountry string `json:"IssuerBankCountry,omitempty"` Status string `json:"Status,omitempty"` StatusCode int `json:"StatusCode,omitempty"` Reason string `json:"Reason,omitempty"` ReasonCode int `json:"ReasonCode,omitempty"` CardHolderMessage string `json:"CardHolderMessage,omitempty"` CardHolderName string `json:"CardHolderName,omitempty"` Token string `json:"Token,omitempty"` JsonData string `json:"JsonData,omitempty"` Name string `json:"Name,omitempty"` }
type PaymentRequest ¶
type PaymentResponse ¶
type PaymentResponse struct { BaseResponse Model struct { PaymentModel Payment3DSModel } }
type PaymentStatus ¶
type PaymentStatus string
const ( PaymentStatusAwaitingAuthentication PaymentStatus = "AwaitingAuthentication" PaymentStatusAuthorized PaymentStatus = "Authorized" PaymentStatusCompleted PaymentStatus = "Completed" PaymentStatusCancelled PaymentStatus = "Cancelled" PaymentStatusDeclined PaymentStatus = "Declined" )
type RefundPaymentRequest ¶
type RefundPaymentRequest struct { BaseRequest TransactionId int Amount float64 JsonData *string }
type RefundWebhookRequest ¶
type RefundWebhookRequest struct { TransactionId int `json:"TransactionId"` PaymentTransactionId int `json:"PaymentTransactionId"` Amount float64 `json:"Amount"` DateTime time.Time `json:"DateTime"` OperationType string `json:"OperationType"` InvoiceId string `json:"InvoiceId,omitempty"` AccountId string `json:"AccountId,omitempty"` Email string `json:"Email,omitempty"` Data map[string]interface{} `json:"Data,omitempty"` }
type SubscriptionBase ¶
type SubscriptionBase struct { BaseRequest AccountRequest Description string Amount float64 Currency string RequireConfirmation bool StartDate string Interval string Period int MaxPeriods int }
type SubscriptionCreateRequest ¶
type SubscriptionCreateRequest struct { SubscriptionBase Token string }
type SubscriptionGetRequest ¶
type SubscriptionGetRequest struct { BaseRequest Id string }
type SubscriptionListRequest ¶
type SubscriptionListRequest struct { BaseRequest AccountId string }
type SubscriptionModel ¶
type SubscriptionModel struct { Id string CurrencyCode int StartDateIso string IntervalCode int StatusCode int Status string SuccessfulTransactionsNumber int FailedTransactionsNumber int LastTransactionDate string LastTransactionDateIso string NextTransactionDate string NextTransactionDateIso string }
type SubscriptionResponse ¶
type SubscriptionResponse struct { BaseResponse Model SubscriptionModel }
type SubscriptionUpdateRequest ¶
type SubscriptionUpdateRequest struct { SubscriptionBase Id string }
type SubscriptionsListResponse ¶
type SubscriptionsListResponse struct { BaseResponse Model []SubscriptionModel }
type TokenPaymentRequest ¶
type TokenPaymentRequest struct { PaymentRequest AccountId string Token string }
type VoidPaymentRequest ¶
type VoidPaymentRequest struct { BaseRequest TransactionId int }
type WebhookResponse ¶
type WebhookResponse struct {
Code int `json:"code"`
}