Documentation
¶
Index ¶
- Constants
- type BlockAddressRequest
- type BlockAddressResponse
- type BlockedAddressRefundRequest
- type BlockedAddressRefundResponse
- type Callback
- type Cryptomus
- func (c *Cryptomus) BlockAddress(blockAddressReq *BlockAddressRequest) (*BlockAddressResponse, error)
- func (c *Cryptomus) BlockedAddressRefund(refundRequest *BlockedAddressRefundRequest) (*BlockedAddressRefundResponse, error)
- func (c *Cryptomus) CreateInvoice(invoiceReq *InvoiceRequest) (*Payment, error)
- func (c *Cryptomus) CreateStaticWallet(staticWalletReq *StaticWalletRequest) (*StaticWalletResponse, error)
- func (c *Cryptomus) GeneratePaymentQRCode(paymentUUID string) (string, error)
- func (c *Cryptomus) GenerateStaticWalletQRCode(walletUUID string) (string, error)
- func (c *Cryptomus) GetPaymentHistory(dateFrom, dateTo time.Time) (*PaymentHistoryResponse, error)
- func (c *Cryptomus) GetPaymentInfo(paymentInfoReq *PaymentInfoRequest) (*Payment, error)
- func (c *Cryptomus) Refund(refundRequest *RefundRequest) (bool, error)
- func (c *Cryptomus) ResendWebhook(resendRequest *ResendWebhookRequest) (bool, error)
- func (c *Cryptomus) VerifySignature(body []byte) bool
- type Currency
- type InvoiceRequest
- type InvoiceRequestOptions
- type Payment
- type PaymentHistoryPaginate
- type PaymentHistoryResponse
- type PaymentInfoRequest
- type RefundRequest
- type ResendWebhookRequest
- type StaticWalletRequest
- type StaticWalletRequestOptions
- type StaticWalletResponse
Constants ¶
View Source
const ( CallbackStatusPaid = "paid" CallbackStatusPaidOver = "paid_over" CallbackStatusCancel = "cancel" CallbackStatusConfirmCheck = "confirm_check" )
View Source
const APIURL = "https://api.cryptomus.com/v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockAddressRequest ¶
type BlockAddressResponse ¶
type Callback ¶
type Callback struct {
Type string `json:"type"`
Uuid string `json:"uuid"`
OrderId string `json:"order_id"`
Amount string `json:"amount"`
PaymentAmount string `json:"payment_amount"`
PaymentAmountUsd string `json:"payment_amount_usd"`
MerchantAmount string `json:"merchant_amount"`
Commission string `json:"commission"`
IsFinal bool `json:"is_final"`
Status string `json:"status"`
From string `json:"from"`
WalletAddressUuid interface{} `json:"wallet_address_uuid"`
Network string `json:"network"`
Currency string `json:"currency"`
PayerCurrency string `json:"payer_currency"`
AdditionalData interface{} `json:"additional_data"`
Convert struct {
ToCurrency string `json:"to_currency"`
Commission interface{} `json:"commission"`
Rate string `json:"rate"`
Amount string `json:"amount"`
} `json:"convert"`
Txid string `json:"txid"`
Sign string `json:"sign"`
}
type Cryptomus ¶
type Cryptomus struct {
// contains filtered or unexported fields
}
func (*Cryptomus) BlockAddress ¶
func (c *Cryptomus) BlockAddress(blockAddressReq *BlockAddressRequest) (*BlockAddressResponse, error)
func (*Cryptomus) BlockedAddressRefund ¶
func (c *Cryptomus) BlockedAddressRefund(refundRequest *BlockedAddressRefundRequest) (*BlockedAddressRefundResponse, error)
func (*Cryptomus) CreateInvoice ¶
func (c *Cryptomus) CreateInvoice(invoiceReq *InvoiceRequest) (*Payment, error)
func (*Cryptomus) CreateStaticWallet ¶
func (c *Cryptomus) CreateStaticWallet(staticWalletReq *StaticWalletRequest) (*StaticWalletResponse, error)
func (*Cryptomus) GeneratePaymentQRCode ¶
func (*Cryptomus) GenerateStaticWalletQRCode ¶
func (*Cryptomus) GetPaymentHistory ¶
func (c *Cryptomus) GetPaymentHistory(dateFrom, dateTo time.Time) (*PaymentHistoryResponse, error)
func (*Cryptomus) GetPaymentInfo ¶
func (c *Cryptomus) GetPaymentInfo(paymentInfoReq *PaymentInfoRequest) (*Payment, error)
func (*Cryptomus) ResendWebhook ¶
func (c *Cryptomus) ResendWebhook(resendRequest *ResendWebhookRequest) (bool, error)
func (*Cryptomus) VerifySignature ¶
type InvoiceRequest ¶
type InvoiceRequest struct {
Amount string `json:"amount"`
Currency string `json:"currency"`
OrderId string `json:"order_id"`
*InvoiceRequestOptions
}
type InvoiceRequestOptions ¶
type InvoiceRequestOptions struct {
Network string `json:"network,omitempty"`
UrlReturn string `json:"url_return,omitempty"`
UrlSuccess string `json:"url_success,omitempty"`
UrlCallback string `json:"url_callback,omitempty"`
IsPaymentMultiple bool `json:"is_payment_multiple,omitempty"`
Lifetime uint16 `json:"lifetime,omitempty"`
ToCurrency string `json:"to_currency,omitempty"`
Subtract uint8 `json:"subtract,omitempty"`
AccuarcyPaymentPercent uint8 `json:"accuarcy_payment_percent,omitempty"`
AdditionalData string `json:"additional_data,omitempty"`
Currencies []Currency `json:"currencies,omitempty"`
ExceptCurrencies []Currency `json:"except_currencies,omitempty"`
CourseSource string `json:"course_source,omitempty"`
FromReferralCode string `json:"from_referral_code,omitempty"`
DiscountPercent int8 `json:"discount_percent,omitempty"`
IsRefresh bool `json:"is_refresh,omitempty"`
}
type Payment ¶
type Payment struct {
UUID string `json:"uuid"`
OrderId string `json:"order_id"`
Amount string `json:"amount"`
PaymentAmount string `json:"payment_amount,omitempty"`
PaymentAmountUSD string `json:"payment_amount_usd,omitempty"`
PayerAmount string `json:"payer_amount,omitempty"`
PayerAmountExchangeRate string `json:"payer_amount_exchange_rate,omitempty"`
DiscountPercent int8 `json:"discount_percent,omitempty"`
Discount string `json:"discount,omitempty"`
PayerCurrency string `json:"payer_currency,omitempty"`
Currency string `json:"currency"`
MerchantAmount string `json:"merchant_amount,omitempty"`
Network string `json:"network,omitempty"`
Address string `json:"address,omitempty"`
From string `json:"from,omitempty"`
TxId string `json:"txid,omitempty"`
PaymentStatus string `json:"payment_status"`
Status string `json:"status,omitempty"`
Url string `json:"url"`
ExpiredAt float64 `json:"expired_at"`
IsFinal bool `json:"is_final"`
AdditionalData string `json:"additional_data,omitempty"`
Comments string `json:"comments,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type PaymentHistoryPaginate ¶
type PaymentHistoryResponse ¶
type PaymentHistoryResponse struct {
Payments []*Payment
Paginate *PaymentHistoryPaginate
}
type PaymentInfoRequest ¶
type RefundRequest ¶
type ResendWebhookRequest ¶
type StaticWalletRequest ¶
type StaticWalletRequest struct {
Currency string `json:"currency"`
Network string `json:"network"`
OrderId string `json:"order_id"`
*StaticWalletRequestOptions
}
Click to show internal directories.
Click to hide internal directories.