Documentation
¶
Index ¶
- func Authenticate(APIKey string) (string, error)
- func ConcatTransactionProcessedValues(c *TransactionProcessedRequest) string
- func ConcatTransactionResponseValues(r *TransactionResponseRequest) string
- func GenerateIFrameURL(iframeId string, paymentKey string) string
- func RegisterOrder(authToken string, items []Item, totalPriceInCents uint) (int, error)
- func RequestPaymentKey(authToken string, paymentIntegrationId string, orderId int, amountCents uint, ...) (string, error)
- func RequestRefund(authToken string, transactionId uint, amountCents uint) (uint, error)
- func ValidateHMAC(message string, expectedHMAC string, key string) bool
- type BillingData
- type Item
- type OrderRegistrationRequest
- type PaymentKeyRequest
- type RefundRequest
- type TransactionProcessedRequest
- type TransactionResponseRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
returns a token valid for 1 hour
func ConcatTransactionProcessedValues ¶
func ConcatTransactionProcessedValues(c *TransactionProcessedRequest) string
func ConcatTransactionResponseValues ¶
func ConcatTransactionResponseValues(r *TransactionResponseRequest) string
func GenerateIFrameURL ¶
func RegisterOrder ¶
return thirdparty order identifier
func RequestPaymentKey ¶
func RequestRefund ¶ added in v0.0.8
Types ¶
type BillingData ¶
type BillingData struct {
Apartment string `json:"apartment"`
Email string `json:"email"`
Floor string `json:"floor"`
FirstName string `json:"first_name"`
Street string `json:"street"`
Building string `json:"building"`
PhoneNumber string `json:"phone_number"`
ShippingMethod string `json:"shipping_method"`
PostalCode string `json:"postal_code"`
City string `json:"city"`
Country string `json:"country"`
LastName string `json:"last_name"`
State string `json:"state"`
}
type PaymentKeyRequest ¶
type PaymentKeyRequest struct {
AuthToken string `json:"auth_token"`
AmountCents uint `json:"amount_cents"`
ExpirationMS uint `json:"expiration"`
OrderID int `json:"order_id"`
Currency string `json:"currency"`
IntegrationID string `json:"integration_id"`
UserBillingData BillingData `json:"billing_data"`
}
type RefundRequest ¶ added in v0.0.8
type TransactionProcessedRequest ¶
type TransactionProcessedRequest struct {
Obj struct {
Id uint `json:"id"`
Pending bool `json:"pending"`
AmountCents uint `json:"amount_cents"`
Success bool `json:"success"`
IsAuth bool `json:"is_auth"`
IsCapture bool `json:"is_capture"`
IsStandalonePayment bool `json:"is_standalone_payment"`
IsVoided bool `json:"is_voided"`
IsRefunded bool `json:"is_refunded"`
Is3dSecure bool `json:"is_3d_secure"`
IntegrationId uint `json:"integration_id"`
HasParentTransaction bool `json:"has_parent_transaction"`
Order struct {
Id uint `json:"id"`
} `json:"order"`
CreatedAt string `json:"created_at"`
Currency string `json:"currency"`
SourceData struct {
Pan string `json:"pan"`
Type_ string `json:"type"`
SubType string `json:"sub_type"`
} `json:"source_data"`
ErrorOccured bool `json:"error_occured"`
Owner uint `json:"owner"`
} `json:"obj"`
}
for back-end direct callback
type TransactionResponseRequest ¶ added in v0.0.5
type TransactionResponseRequest struct {
Id uint `schema:"id"`
Pending bool `schema:"pending"`
AmountCents uint `schema:"amount_cents"`
Success bool `schema:"success"`
IsAuth bool `schema:"is_auth"`
IsCapture bool `schema:"is_capture"`
IsStandalonePayment bool `schema:"is_standalone_payment"`
IsVoided bool `schema:"is_voided"`
IsRefunded bool `schema:"is_refunded"`
Is3dSecure bool `schema:"is_3d_secure"`
IntegrationId uint `schema:"integration_id"`
HasParentTransaction bool `schema:"has_parent_transaction"`
OrderId uint `schema:"order"`
CreatedAt string `schema:"created_at"`
Currency string `schema:"currency"`
SourceData struct {
Pan string `schema:"pan"`
Type string `schema:"type"`
SubType string `schema:"sub_type"`
} `schema:"source_data"`
ErrorCccured bool `schema:"error_occured"`
Owner string `schema:"owner"`
}
TODO: find a way to merge these two structs for post-payment redirection
func MakeTransactionResponseRequest ¶ added in v0.0.6
func MakeTransactionResponseRequest(params *map[string][]string) TransactionResponseRequest
Click to show internal directories.
Click to hide internal directories.