Documentation
¶
Index ¶
- Constants
- type Address
- type BankInfo
- type DeliveryInfo
- type DeviceInfo
- type Error
- type GetSubscriptionStateResponse
- type GetTokenPaymentResponse
- type GetTokenSubscriptionResponse
- type GetTokenSubscriptionV2Response
- type IntroductoryPriceInfo
- type Invoice
- type InvoiceParams
- type InvoiceStatus
- type IsActive
- type ItemParams
- type LoyaltyInfo
- type Methods
- type Order
- type OrderBundle
- type Payment
- func (p *Payment) GetPaymentInfo(ctx context.Context, purchaseToken string) (GetTokenPaymentResponse, error)
- func (p *Payment) GetProductionPaymentInfo(ctx context.Context, purchaseToken string) (GetTokenPaymentResponse, error)
- func (p *Payment) GetSandboxPaymentInfo(ctx context.Context, purchaseToken string) (GetTokenPaymentResponse, error)
- func (p *Payment) GetSubscriptionInfo(ctx context.Context, subscriptionToken string) (GetTokenSubscriptionResponse, error)
- func (p *Payment) GetSubscriptionInfoV2(ctx context.Context, packageName, subscriptionID, subscriptionToken string) (GetTokenSubscriptionV2Response, error)
- func (p *Payment) GetSubscriptionInfoV3(ctx context.Context, packageName, subscriptionID, subscriptionToken string) (GetTokenSubscriptionV2Response, error)
- func (p *Payment) GetSubscriptionState(ctx context.Context, subscriptionToken string) (GetSubscriptionStateResponse, error)
- func (p *Payment) IsTestPayment(purchaseToken string) bool
- func (p *Payment) SubmitSubscription(ctx context.Context, packageName, subscriptionID, subscriptionToken string) (SubmitSubscription, error)
- type PaymentInfo
- type PaymentMethods
- type PaymentParams
- type Periods
- type Purchaser
- type Quantity
- type SubmitSubscription
- type TokenPayment
- type TokenSubscription
- type TokenSubscriptionBody
Constants ¶
View Source
const ( Created InvoiceStatus = "created" Executed = "executed" Cancelled = "cancelled" Paid = "paid" Confirmed = "confirmed" Reversed = "reversed" Refunded = "refunded" )
View Source
const ( PublicAPIURL = "https://public-api.rustore.ru/public/" GetSandboxPaymentInfoURL = PublicAPIURL + "sandbox/purchase/%s" GetPaymentInfoURL = PublicAPIURL + "purchase/%s" GetSubscriptionInfoURL = PublicAPIURL + "subscription/%s" GetSubscriptionInfoV2URL = PublicAPIURL + "glike/subscription/%s/%s/%s" GetSubscriptionInfoV3URL = PublicAPIURL + "v3/subscription/%s/%s/%s" GetSubscriptionStateURL = PublicAPIURL + "subscription/%s/state" SubmitSubscriptionURL = PublicAPIURL + "glike/subscription/%s/%s/%s:acknowledge" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeliveryInfo ¶
type DeviceInfo ¶
type DeviceInfo struct {
DevicePlatformType string `json:"device_platform_type"`
DevicePlatformVersion string `json:"device_platform_version"`
DeviceModel string `json:"device_model"`
DeviceManufacturer string `json:"device_manufacturer"`
DeviceId string `json:"device_id"`
Surface string `json:"surface"`
SurfaceVersion string `json:"surface_version"`
}
type GetTokenPaymentResponse ¶
type GetTokenPaymentResponse struct {
Code string `json:"code"`
Message string `json:"message"`
Body TokenPayment `json:"body"`
Timestamp time.Time `json:"timestamp"`
}
func (GetTokenPaymentResponse) String ¶
func (t GetTokenPaymentResponse) String() string
type GetTokenSubscriptionResponse ¶
type GetTokenSubscriptionResponse struct {
Code string `json:"code"`
Message string `json:"message"`
Timestamp time.Time `json:"timestamp"`
Body TokenSubscription `json:"body"`
}
type GetTokenSubscriptionV2Response ¶
type GetTokenSubscriptionV2Response struct {
StartTimeMillis string `json:"startTimeMillis"`
ExpiryTimeMillis string `json:"expiryTimeMillis"`
AutoRenewing bool `json:"autoRenewing"`
PriceCurrencyCode string `json:"priceCurrencyCode"`
PriceAmountMicros string `json:"priceAmountMicros"`
CountryCode string `json:"countryCode"`
PaymentState int `json:"paymentState"`
OrderID string `json:"orderId"`
AcknowledgementState int `json:"acknowledgementState"`
Kind string `json:"kind"`
PurchaseType int `json:"purchaseType"`
IntroductoryPriceInfo IntroductoryPriceInfo `json:"introductoryPriceInfo"`
}
type IntroductoryPriceInfo ¶
type IntroductoryPriceInfo struct {
IntroductoryPriceCurrencyCode string `json:"introductoryPriceCurrencyCode"`
IntroductoryPriceAmountMicros string `json:"introductoryPriceAmountMicros"`
IntroductoryPricePeriod string `json:"introductoryPricePeriod"`
IntroductoryPriceCycles string `json:"introductoryPriceCycles"`
}
type Invoice ¶
type Invoice struct {
DeliveryInfo DeliveryInfo `json:"delivery_info"`
InvoiceParams *[]InvoiceParams `json:"invoice_params"`
Purchaser Purchaser `json:"purchaser"`
Order Order `json:"order"`
}
type InvoiceParams ¶
type InvoiceStatus ¶
type InvoiceStatus string
func (InvoiceStatus) Success ¶
func (i InvoiceStatus) Success() bool
type ItemParams ¶
type LoyaltyInfo ¶
type Order ¶
type Order struct {
OrderID string `json:"order_id"`
OrderNumber string `json:"order_number"`
OrderDate string `json:"order_date"`
ServiceID string `json:"service_id"`
ExpirationDate string `json:"expiration_date"`
TaxSystem int `json:"tax_system"`
TradeName *string `json:"trade_name"`
VisualName string `json:"visual_name"`
OrgName string `json:"org_name"`
OrgInn string `json:"org_inn"`
VisualAmount string `json:"visual_amount"`
OrderBundle []OrderBundle `json:"order_bundle"`
Amount int `json:"amount"`
Currency string `json:"currency"`
Purpose string `json:"purpose"`
Description string `json:"description"`
Language string `json:"language"`
}
type OrderBundle ¶
type OrderBundle struct {
PositionID int `json:"position_id"`
ItemParams []ItemParams `json:"item_params"`
ItemAmount int `json:"item_amount"`
ItemCode string `json:"item_code"`
ItemPrice int `json:"item_price"`
DiscountType *string `json:"discount_type"`
DiscountValue *float64 `json:"discount_value"`
InterestType *string `json:"interest_type"`
InterestValue *float64 `json:"interest_value"`
TaxType int `json:"tax_type"`
TaxSum *int `json:"tax_sum"`
Name string `json:"name"`
Quantity Quantity `json:"quantity"`
Currency string `json:"currency"`
Image string `json:"image"`
}
type Payment ¶
type Payment struct {
// contains filtered or unexported fields
}
func (*Payment) GetPaymentInfo ¶
func (*Payment) GetProductionPaymentInfo ¶
func (*Payment) GetSandboxPaymentInfo ¶
func (*Payment) GetSubscriptionInfo ¶
func (*Payment) GetSubscriptionInfoV2 ¶
func (*Payment) GetSubscriptionInfoV3 ¶
func (*Payment) GetSubscriptionState ¶
func (*Payment) IsTestPayment ¶
func (*Payment) SubmitSubscription ¶
type PaymentInfo ¶
type PaymentInfo struct {
PaymentDate string `json:"payment_date"`
PaymentID string `json:"payment_id"`
PaymentParams *PaymentParams `json:"payment_params"`
LoyaltyInfo *LoyaltyInfo `json:"loyalty_info"`
CardID string `json:"card_id"`
PaysysCode string `json:"paysys_code"`
MaskedPan string `json:"masked_pan"`
ExpiryDate string `json:"expiry_date"`
PaymentSystem string `json:"payment_system"`
PaymentSystemImage string `json:"payment_system_image"`
PaysysImage *string `json:"paysys_image"`
PaymentWay string `json:"payment_way"`
PaymentWayCode string `json:"payment_way_code"`
PaymentWayLogo string `json:"payment_way_logo"`
BankInfo BankInfo `json:"bank_info"`
DeviceInfo *DeviceInfo `json:"device_info"`
Name string `json:"name"`
Cardholder string `json:"cardholder"`
Image string `json:"image"`
Paysys string `json:"paysys"`
}
type PaymentMethods ¶
type PaymentParams ¶
type SubmitSubscription ¶
type TokenPayment ¶
type TokenPayment struct {
InvoiceID string `json:"invoice_id"`
InvoiceDate string `json:"invoice_date"`
InvoiceStatus InvoiceStatus `json:"invoice_status"`
ApplicationCode string `json:"application_code"`
ApplicationName string `json:"application_name"`
OwnerCode string `json:"owner_code"`
OwnerName string `json:"owner_name"`
PaymentInfo PaymentInfo `json:"payment_info"`
PaymentMethods *PaymentMethods `json:"payment_methods"`
Error Error `json:"error"`
Invoice Invoice `json:"invoice"`
Image string `json:"image"`
}
type TokenSubscription ¶
type TokenSubscription struct {
Code int `json:"code"`
Success bool `json:"success"`
Message string `json:"message"`
Body TokenSubscriptionBody `json:"body"`
}
type TokenSubscriptionBody ¶
type TokenSubscriptionBody struct {
ServiceName string `json:"serviceName"`
SubscriptionID int `json:"subscriptionId"`
AddParameters string `json:"addParameters"`
ProductType string `json:"productType"`
ProductName string `json:"productName"`
ProductCode string `json:"productCode"`
Recurrent bool `json:"recurrent"`
CountOfDay int `json:"countOfDay"`
PeriodType string `json:"periodType"`
PeriodDuration int `json:"periodDuration"`
NextPaymentDate string `json:"nextPaymentDate"`
Price int `json:"price"`
Currency string `json:"currency"`
ImageURL string `json:"imageUrl"`
State string `json:"state"`
CurrentPeriod string `json:"currentPeriod"`
DebtPaymentPeriod string `json:"debtPaymentPeriod"`
Description string `json:"description"`
TariffID int `json:"tariffId"`
Periods []Periods `json:"periods"`
}
Click to show internal directories.
Click to hide internal directories.