Documentation ¶
Index ¶
- Constants
- type BillResponse
- type CreateBillInfo
- type CreateBillRequest
- type CustomFields
- type Customer
- type ErrorResponse
- type HTTPClient
- type MoneyAmount
- type Notification
- type PaymentInfo
- type QiwiBillPaymentsAPI
- func (m *QiwiBillPaymentsAPI) CancelBill(billId string) (*BillResponse, error)
- func (m *QiwiBillPaymentsAPI) CreateBill(billInfo CreateBillInfo) (*BillResponse, error)
- func (m *QiwiBillPaymentsAPI) CreatePaymentForm(paymentInfo PaymentInfo) string
- func (m *QiwiBillPaymentsAPI) GetBillInfo(billId string) (*BillResponse, error)
- func (m *QiwiBillPaymentsAPI) GetRefundInfo(billId, refundId string) (*RefundResponse, error)
- func (m *QiwiBillPaymentsAPI) Refund(billId, refundId string, amount MoneyAmount) (*RefundResponse, error)
- func (m *QiwiBillPaymentsAPI) SetSecretKey(secretKey string)
- type RefundBillRequest
- type RefundResponse
- type ResponseStatus
Constants ¶
const ( WAITING = "WAITING" // Invoice issued awaiting for payment. PAID = "PAID" // Invoice paid. REJECTED = "REJECTED" // Invoice rejected by customer. EXPIRED = "EXPIRED" // Invoice expired. Invoice not paid. )
Invoice Payment Statuses
const ( PARTIAL = "PARTIAL" // The partial refund of the invoice amount. FULL = "FULL" // The full refund of the invoice amount. )
The refund status enum.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BillResponse ¶
type BillResponse struct { SiteId string `json:"siteId"` // The merchant’s site identifier in API. BillId string `json:"billId"` // The unique invoice identifier in the merchant’s system. Amount MoneyAmount `json:"amount"` // The invoice amount info. Status ResponseStatus `json:"status"` // The invoice status info. Comment string `json:"comment"` // The comment to the invoice. Customer Customer `json:"customer"` // The customer info. CreationDateTime time.Time `json:"creationDateTime"` // The dateTime of the invoice creation. ExpirationDateTime time.Time `json:"expirationDateTime"` // The expiration date of the pay form link. PayUrl string `json:"payUrl"` // The pay form link. CustomFields CustomFields `json:"customFields"` // The invoice additional data. }
BillResponse is the invoice response.
type CreateBillInfo ¶
type CreateBillInfo struct { BillId string `json:"billId"` // The unique invoice identifier in merchant's system. Amount MoneyAmount `json:"amount"` // The invoice amount info. Comment string `json:"comment"` // The invoice commentary. ExpirationDateTime time.Time `json:"expirationDateTime"` // The invoice due date. Customer Customer `json:"customer"` // The customer's info. SuccessUrl string `json:"successUrl"` // The URL to which the client will be redirected in case of successful payment. ThemeCode string `json:"-"` // The style theme code. }
CreateBillInfo is create issue info.
func (*CreateBillInfo) GetCreateBillRequest ¶
func (m *CreateBillInfo) GetCreateBillRequest() CreateBillRequest
GetCreateBillRequest returns a create invoice request.
type CreateBillRequest ¶
type CreateBillRequest struct { Amount MoneyAmount `json:"amount"` // The invoice amount witch currency. Comment string `json:"comment"` // The invoice commentary. ExpirationDateTime time.Time `json:"expirationDateTime"` // The invoice expiration date. Customer Customer `json:"customer"` // The customer's info. CustomFields CustomFields `json:"customFields"` // The invoice additional data. }
CreateBillRequest is create issue request.
type CustomFields ¶
type CustomFields struct { ApiClient string `json:"apiClient"` // // The API client name. ApiClientVersion string `json:"apiClientVersion"` // The API client version. ThemeCode string `json:"themeCode"` // The style theme code. }
CustomFields is the invoice additional data.
type Customer ¶
type Customer struct { Email string `json:"email"` // The client's e-mail. Account string `json:"account"` // The client's identifier in merchant's system. Phone string `json:"phone"` // The phone number to which invoice issued. }
Customer is the customer's info.
type ErrorResponse ¶
type ErrorResponse struct { ServiceName string `json:"serviceName"` // The service name. ErrorCode string `json:"errorCode"` // The error code. Description string `json:"description"` // The description. UserMessage string `json:"userMessage"` // The user message. DateTime time.Time `json:"dateTime"` // The dateTime. TraceId string `json:"traceId"` // The trace ID. }
ErrorResponse is the API error response.
func (ErrorResponse) Error ¶
func (m ErrorResponse) Error() string
Error returns a formatted error string.
type HTTPClient ¶
HTTPClient is HTTP client.
type MoneyAmount ¶
type MoneyAmount struct { Value string `json:"value"` // The invoice amount value. Currency string `json:"currency"` // The invoice currency value. }
MoneyAmount is the invoice amount info.
func (*MoneyAmount) GetValueNumber ¶
func (m *MoneyAmount) GetValueNumber() float64
GetValueNumber returns the amount in float.
func (*MoneyAmount) SetValueNumber ¶
func (m *MoneyAmount) SetValueNumber(value float64)
SetValueString sets the amount from a float.
func (*MoneyAmount) SetValueString ¶
func (m *MoneyAmount) SetValueString(value string) error
SetValueString sets the amount from a string.
type Notification ¶ added in v1.1.0
type Notification struct { BillResponse Version string `json:"version"` // The notification version. }
Notification is the invoice payment notification.
type PaymentInfo ¶
type PaymentInfo struct { PublicKey string `json:"publicKey"` // The merchant public key. Amount MoneyAmount `json:"amount"` // The invoice amount. BillId string `json:"billId"` // Unique invoice identifier in merchant’s system. SuccessUrl string `json:"successUrl"` // The URL to which the client will be redirected in case of successful payment. ThemeCode string `json:"-"` // The style theme code.. }
PaymentInfo is the invoice data are put in Pay Form URL.
type QiwiBillPaymentsAPI ¶
type QiwiBillPaymentsAPI struct {
// contains filtered or unexported fields
}
QiwiBillPaymentsAPI for rest v3.
func NewQiwiBillPaymentsAPI ¶
func NewQiwiBillPaymentsAPI(secretKey string) *QiwiBillPaymentsAPI
NewQiwiBillPaymentsAPI creates a new QiwiBillPaymentsAPI instance.
func NewQiwiBillPaymentsAPIWithClient ¶
func NewQiwiBillPaymentsAPIWithClient(secretKey string, httpClient HTTPClient) *QiwiBillPaymentsAPI
NewQiwiBillPaymentsAPIWithClient creates a new QiwiBillPaymentsAPI instance and allows you to pass a http.Client.
func (*QiwiBillPaymentsAPI) CancelBill ¶
func (m *QiwiBillPaymentsAPI) CancelBill(billId string) (*BillResponse, error)
CancelBill cancelling unpaid bill.
func (*QiwiBillPaymentsAPI) CreateBill ¶
func (m *QiwiBillPaymentsAPI) CreateBill(billInfo CreateBillInfo) (*BillResponse, error)
CreateBill creating bill.
func (*QiwiBillPaymentsAPI) CreatePaymentForm ¶
func (m *QiwiBillPaymentsAPI) CreatePaymentForm(paymentInfo PaymentInfo) string
CreatePaymentForm creating checkout link.
func (*QiwiBillPaymentsAPI) GetBillInfo ¶
func (m *QiwiBillPaymentsAPI) GetBillInfo(billId string) (*BillResponse, error)
GetBillInfo getting bill info.
func (*QiwiBillPaymentsAPI) GetRefundInfo ¶ added in v1.1.0
func (m *QiwiBillPaymentsAPI) GetRefundInfo(billId, refundId string) (*RefundResponse, error)
GetRefundInfo getting refund info. Method is not available for individuals.
func (*QiwiBillPaymentsAPI) Refund ¶ added in v1.1.0
func (m *QiwiBillPaymentsAPI) Refund(billId, refundId string, amount MoneyAmount) (*RefundResponse, error)
Refund paid bill. Method is not available for individuals.
func (*QiwiBillPaymentsAPI) SetSecretKey ¶
func (m *QiwiBillPaymentsAPI) SetSecretKey(secretKey string)
SetSecretKey sets new secret key.
type RefundBillRequest ¶ added in v1.1.0
type RefundBillRequest struct {
Amount MoneyAmount `json:"amount"` // The refund amount.
}
RefundBillRequest is the refund request.
type RefundResponse ¶ added in v1.1.0
type RefundResponse struct { Amount MoneyAmount `json:"amount"` // The invoice amount. DateTime time.Time `json:"dateTime"` // The dateTime of refund processing. RefundId string `json:"refundId"` // Unique refund identifier in merchant’s system. Status string `json:"status"` // The refund status. }
RefundResponse is the refund response.
type ResponseStatus ¶
type ResponseStatus struct { Value string `json:"value"` // The status value. ChangedDateTime time.Time `json:"changedDateTime"` // The status refresh dateTime. }
ResponseStatus is the invoice status info.