Documentation
¶
Overview ¶
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Package yoopayment describes all the necessary entities for working with YooMoney Payments.
Index ¶
- type Alfabank
- type ApplePay
- type AuthorizationDetails
- type B2BSberbank
- type BankCard
- type Card
- type Cash
- type ConfirmationType
- type Confirmer
- type Customer
- type Deal
- type Embedded
- type External
- type GooglePay
- type Installments
- type MarkQuantity
- type MobileApplication
- type MobileBalance
- type PayerBankDetails
- type Payment
- type PaymentList
- type PaymentListFilter
- type PaymentMethodType
- type PaymentMethoder
- type PaymentMode
- type PaymentSubject
- type QR
- type Qiwi
- type Receipt
- type ReceiptItem
- type Recipient
- type Redirect
- type SBP
- type Sberbank
- type Status
- type TinkoffBank
- type Transfer
- type WeChat
- type WebMoney
- type YooMoney
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alfabank ¶
type Alfabank struct {
// User's login in Alfa-Click (linked phone number or the additional login).
Login string `login:"login,omitempty"`
// contains filtered or unexported fields
}
type AuthorizationDetails ¶
type AuthorizationDetails struct {
// Retrieval Reference Number is a unique identifier of a transaction
// in the issuer's system. Used for payments via bank card.
RRN string `json:"rrn,omitempty"`
// Bank card's authorization code.
// Provided by the issuer to confirm authorization.
AuthCode string `json:"auth_code,omitempty"`
// Information about user’s 3‑D Secure authentication for confirming the payment.
ThreeDSecure struct {
// Information on whether the 3-D Secure authentication form
// is displayed to the user for confirming the payment or not
Applied bool `json:"applied,omitempty"`
} `json:"three_d_secure,omitempty"`
}
Payment authorization details.
type B2BSberbank ¶
type B2BSberbank struct {
// Banking details of the payer (legal entity or sole proprietor).
PayerBankDetails PayerBankDetails `json:"payer_bank_details,omitempty"`
// Purpose of payment (no more than 210 characters).
PaymentPurpose string `json:"payment_purpose,omitempty" binding:"max=210"`
// Information about the value-added tax (VAT).
// A payment might or might not be subject to VAT.
// Products may be taxed at the same VAT rate, or at different rates.
VATData string `json:"vat_data,omitempty"`
// contains filtered or unexported fields
}
type BankCard ¶
type BankCard struct {
// Bank card details.
Card Card `json:"card,omitempty"`
// contains filtered or unexported fields
}
type Card ¶
type Card struct {
// First 6 digits of the card’s number (BIN).
// For payments with bank cards saved in YooMoney and other services,
// the specified BIN might not correspond with the last4, expiry_year, expiry_month values.
First6 string `json:"first6,omitempty"`
// Last 4 digits of the card's number.
Last4 string `json:"last4,omitempty"`
// Expiration date, year, YYYY.
ExpiryYear string `json:"expiry_year,omitempty"`
// Expiration date, month, MM.
ExpiryMonth string `json:"expiry_month,omitempty"`
// Type of bank card. Possible values: MasterCard (for Mastercard and Maestro cards),
// Visa (for Visa and Visa Electron cards), Mir, UnionPay, JCB, AmericanExpress,
// DinersClub, DiscoverCard, InstaPayment, InstaPaymentTM, Laser, Dankort,
// Solo, Switch, and Unknown.
CardType string `json:"card_type,omitempty"`
// Code of the country where the bank card was issued according to ISO-3166 alpha-2.
// Example: RU.
IssuerCountry string `json:"issuer_country,omitempty"`
// Name of the issuing bank.
IssuerName string `json:"issuer_name,omitempty"`
// Source of bank card details. Possible values: mir_pay, apple_pay, google_pay.
// For payments where the user selects a card saved in Mir Pay, Apple Pay or Google Pay.
Source string `json:"source,omitempty"`
}
Card details.
type ConfirmationType ¶
type ConfirmationType string
const ( TypeEmbedded ConfirmationType = "embedded" TypeExternal ConfirmationType = "external" TypeMobileApplication ConfirmationType = "mobile_application" TypeQR ConfirmationType = "qr" TypeRedirect ConfirmationType = "redirect" )
type Customer ¶
type Customer struct {
// For a legal entity — the name of the organization,
// for sole proprietors and individuals — full name.
// If an individual does not have an INN, passport data is transmitted
// in the same parameter. Maximum of 256 characters.
// You can transfer it if you use Receipts from YooKassa
// or the online sales register Orange Data, Atol Online.
FullName string `json:"full_name,omitempty"`
// The user's INN (10 or 12 digits)
// If an individual does not have an INN, it is necessary to pass
// the passport data in the full_name parameter.
// You can transfer it if you use Receipts from YUKASA or the online sales register
// Orange Data, Atol Online
INN string `json:"inn,omitempty"`
// The user's email address for sending the receipt.
// A mandatory parameter if you use Receipts from KasaKasa
// or if you use another solution
// (third-party online sales register, self-employed receipts)
// and do not transfer the phone
Email string `json:"email,omitempty"`
// The user's phone number for sending the receipt. It is specified in the ITU-T E.164 format,
// for example 79000000000.
// Required parameter if no email is passed
Phone string `json:"phone,omitempty"`
}
type Deal ¶
type Deal struct {
// Deal ID.
ID string `json:"id,omitempty" binding:"min=36,max=50"`
// Information about money distribution.
Settlements []yoocommon.Settlement `json:"settlements,omitempty"`
}
The Deal within which the payment is being carried out.
type Embedded ¶
type Embedded struct {
// Confirmation scenario code.
Type ConfirmationType `json:"type,omitempty"`
// Token for the YooMoney Checkout Widget initialization.
ConfirmationToken string `json:"confirmation_token,omitempty"`
}
type External ¶
type External struct {
// Confirmation scenario code.
Type ConfirmationType `json:"type,omitempty"`
}
type Installments ¶
type Installments struct {
// contains filtered or unexported fields
}
type MarkQuantity ¶
type MarkQuantity struct {
// The numerator is the number of goods sold from one consumer package (tag b 54 FZ — 1293).
// Cannot exceed denominator.
Numerator int `json:"numerator"`
// The denominator is the total number of goods in consumer packaging (tag in 54 FZ — 1294).
Denominator int `json:"denominator"`
}
type MobileApplication ¶
type MobileApplication struct {
// Confirmation scenario code.
Type ConfirmationType `json:"type,omitempty"`
// Deep link to the mobile app where the user confirms the payment.
ConfirmationURL string `json:"confirmation_url,omitempty"`
}
type MobileBalance ¶
type MobileBalance struct {
// contains filtered or unexported fields
}
type PayerBankDetails ¶
type PayerBankDetails struct {
// Full name of the organization.
FullName string `json:"full_name,omitempty" binding:"max=800"`
// Abbreviated name of the organization.
ShortName string `json:"short_name,omitempty" binding:"max=160"`
// Address of the organization.
Address string `json:"address,omitempty" binding:"max=500"`
// Taxpayer Identification Number (INN) of the organization.
INN string `json:"inn,omitempty"`
// Name of the organization's bank.
BankName string `json:"bank_name,omitempty" binding:"min=1,max=350"`
// Branch of the organization's bank.
BankBranch string `json:"bank_branch,omitempty" binding:"min=1,max=140"`
// Bank Identification Code (BIC) of the organization's bank.
BankBIK string `json:"bank_bik,omitempty"`
// Account number of the organization.
Account string `json:"account,omitempty"`
// Tax Registration Reason Code (KPP) of the organization.
KPP string `json:"kpp,omitempty"`
}
Banking details of the payer (legal entity or sole proprietor).
type Payment ¶
type Payment struct {
// Payment ID in YooMoney.
ID string `json:"id,omitempty"`
// Payment Status. Possible values: pending, waiting_for_capture, succeeded, and canceled.
Status Status `json:"status,omitempty"`
// Payment Amount. Sometimes YooMoney's partners charge additional
// commission from the users that is not included in this amount.
Amount *yoocommon.Amount `json:"amount,omitempty"`
// Amount of payment to be received by the store: the amount value minus the YooMoney commission.
IncomeAmount *yoocommon.Amount `json:"income_amount,omitempty"`
// Capture defines automatic acceptance of payment
Capture bool `json:"capture,omitempty"`
// Description of the transaction (maximum 128 characters) displayed in your YooMoney
// Merchant Profile, and shown to the user during checkout. For example,
// "Payment for order No. 72 for user@yoomoney.ru".
Description string `json:"description,omitempty" binding:"max=128"`
// Payment Recipient.
Recipient *Recipient `json:"recipient,omitempty"`
// Payment method used for this payment.
PaymentMethod PaymentMethoder `json:"payment_method,omitempty"`
// Time of order creation, based on UTC and specified in the ISO 8601 format.
// Example: 2017-11-03T11:52:31.827Z
CapturedAt *time.Time `json:"captured_at,omitempty"`
// Time of order creation, based on UTC and specified in the ISO 8601 format.
// Example: 2017-11-03T11:52:31.827Z
CreatedAt *time.Time `json:"created_at,omitempty"`
// The period during which you can cancel or capture a payment for free.
// The payment with the waiting_for_capture status will be automatically
// canceled at the specified time. Based on UTC and specified in the ISO 8601 format.
// Example: 2017-11-03T11:52:31.827Z
ExpiresAt *time.Time `json:"expires_at,omitempty"`
// Selected payment confirmation scenario.
// For payments requiring confirmation from the user.
Confirmation Confirmer `json:"confirmation,omitempty"`
// The attribute of a test transaction.
Test bool `json:"test,omitempty"`
// The amount refunded to the user. Specified if the payment has successful refunds.
RefundedAmount *yoocommon.Amount `json:"refunded_amount,omitempty"`
// The attribute of a paid order.
Paid bool `json:"paid,omitempty"`
// Availability of the option to make a refund via API.
Refundable bool `json:"refundable,omitempty"`
// Status of receipt delivery.
ReceiptRegistration Status `json:"receipt_registration,omitempty"`
Receipt Receipt `json:"receipt,omitempty"`
// Any additional data you might require for processing payments
// (for example, your internal order ID), specified as a “key-value” pair and
// returned in response from YooMoney. Limitations: no more than 16 keys,
// no more than 32 characters in the key’s title, no more than 512 characters
// in the key’s value, data type is a string in the UTF-8 format.
Metadata interface{} `json:"metadata,omitempty"`
// Commentary to the canceled status: who and why canceled the payment.
CancellationDetails *yoocommon.CancellationDetails `json:"cancellation_details,omitempty"`
// Payment authorization details.
AuthorizationDetails *AuthorizationDetails `json:"authorization_details,omitempty"`
// Information about money distribution: the amounts of transfers and
// the stores to be transferred to.
Transfers []Transfer `json:"transfers,omitempty"`
// The deal within which the payment is being carried out.
Deal *Deal `json:"deal,omitempty"`
// The identifier of the customer in your system, such as email address or phone number.
// No more than 200 characters.
MerchantCustomerID string `json:"merchant_customer_id,omitempty" binding:"max=200"`
}
The Payment object contains all currently relevant information about the payment. The object is generated during creation of a payment, and sent in response to any payment-related requests.
type PaymentList ¶
type PaymentList struct {
// Format of request results output. Possible value: list.
Type string `json:"type"`
// Array of objects matching the request parameters.
Items []Payment `json:"items"`
// Cursor to the next fragment of the list.
// Example: cursor=37a5c87d-3984-51e8-a7f3-8de646d39ec15
NextCursor string `json:"next_cursor"`
}
PaymentList contains list of payments. Data can be filtered.
type PaymentListFilter ¶
type PaymentListFilter struct {
// Filter by creation date: time must be greater than the specified
// value or equal ("from a certain moment inclusive").
// Specified in the ISO 8601 format.
CreatedAtGTE *time.Time `json:"created_at.gte,omitempty"`
// Filter by creation date: time must be greater than the specified
// value ("from a certain moment exclusive").
// Specified in the ISO 8601 format.
CreatedAtGT *time.Time `json:"created_at.gt,omitempty"`
// Filter by creation date: time must be less than the specified
// value or equal ("until a certain moment inclusive").
// Specified in the ISO 8601 format
CreatedAtLTE *time.Time `json:"created_at.lte,omitempty"`
// Filter by creation date: time must be less than the specified
// value ("until a certain moment exclusive").
// Specified in the ISO 8601 format.
CreatedAtLT *time.Time `json:"created_at.lt,omitempty"`
// Filter by time of payment capture: time must be greater than the specified
// value or equal ("from a certain moment inclusive").
// Specified in the ISO 8601 format.
CapturedAtGTE *time.Time `json:"captured_at.gte,omitempty"`
// Filter by time of payment capture: time must be greater than the specified
// value ("from a certain moment exclusive").
// Specified in the ISO 8601 format.
CapturedAtGT *time.Time `json:"captured_at.gt,omitempty"`
// Filter by time of payment capture: time must be less than the specified
// value or equal ("until a certain moment inclusive").
// Specified in the ISO 8601 format.
CapturedAtLTE *time.Time `json:"captured_at.lte,omitempty"`
// Filter by time of payment capture: time must be less than the specified
// value ("until a certain moment exclusive").
// Specified in the ISO 8601 format.
CapturedAtLT *time.Time `json:"captured_at.lt,omitempty"`
// Filter by payment method code. Example: bank_card
PaymentMethod string `json:"payment_method,omitempty"`
// Filter by payment status. Example: succeeded
Status Status `json:"status,omitempty"`
// Size of the output of request results: number of objects sent in response.
// Possible values: 1 to 100.
// Default value: 10
Limit int `json:"limit,omitempty"`
// Cursor to the next fragment in the list. Example: cursor=37a5c87d-3984-51e8-a7f3-8de646d39ec15
// Use the value of the next_cursor parameter received in response to the previous request as the cursor.
// Used if the size of the list is greater than the output size (limit) and the output end hasn't been reached.
Cursor string `json:"cursor,omitempty"`
}
The request allows you to receive the list of payments filtered by specified criteria.
type PaymentMethodType ¶
type PaymentMethodType string
const ( PaymentTypeAlfabank PaymentMethodType = "alfabank" PaymentTypeApplePay PaymentMethodType = "apple_pay" PaymentTypeB2BSberbank PaymentMethodType = "b2b_sberbank" PaymentTypeBankCard PaymentMethodType = "bank_card" PaymentTypeCash PaymentMethodType = "cash" PaymentTypeGooglePay PaymentMethodType = "google_pay" PaymentTypeInstallments PaymentMethodType = "installments" PaymentTypeMobileBalance PaymentMethodType = "mobile_balance" PaymentTypeQiwi PaymentMethodType = "qiwi" PaymentTypeSberbank PaymentMethodType = "sberbank" PaymentTypeSBP PaymentMethodType = "sbp" PaymentTypeTinkoffBank PaymentMethodType = "tinkoff_bank" PaymentTypeWebmoney PaymentMethodType = "webmoney" PaymentTypeWeChat PaymentMethodType = "wechat" PaymentTypeYooMoney PaymentMethodType = "yoo_money" )
type PaymentMethoder ¶
type PaymentMethoder interface {
}
type PaymentMode ¶
type PaymentMode string
const ( PaymentModeFullPrepayment PaymentMode = "full_prepayment" PaymentModePartialPrepayment PaymentMode = "partial_prepayment" PaymentModeAdvance PaymentMode = "advance" PaymentModeFullPayment PaymentMode = "full_payment" PaymentModePartialPayment PaymentMode = "partial_payment" PaymentModeCredit PaymentMode = "credit" PaymentModeCreditPayment PaymentMode = "credit_payment" )
type PaymentSubject ¶
type PaymentSubject string
PaymentSubject The attribute of the subject of calculation (tag in 54 FZ — 1212) is what payment is accepted for, for example, a product or service.
List of possible values:
for Receipts from YooKassa: https://yookassa.ru/developers/payment-acceptance/receipts/54fz/yoomoney/parameters-values#payment-subject for third-party online sales registers: https://yookassa.ru/developers/payment-acceptance/receipts/54fz/other-services/parameters-values#payment-subject
const ( SubjectCommodity PaymentSubject = "commodity" SubjectJob PaymentSubject = "job" SubjectService PaymentSubject = "service" SubjectPayment PaymentSubject = "payment" SubjectCasino PaymentSubject = "casino" SubjectGamblingBet PaymentSubject = "gambling_bet" SubjectGamblingPrize PaymentSubject = "gambling_prize" SubjectLottery PaymentSubject = "lottery" SubjectLotteryPrize PaymentSubject = "lottery_prize" SubjectIntellectualActivity PaymentSubject = "intellectual_activity" SubjectAgentCommission PaymentSubject = "agent_commission" SubjectPropertyRight PaymentSubject = "property_right" SubjectNonOperatingGain PaymentSubject = "non_operating_gain" SubjectInsurancePremium PaymentSubject = "insurance_premium" SubjectResortFee PaymentSubject = "resort_fee" SubjectMarked PaymentSubject = "market" SubjectNonMarked PaymentSubject = "non_marked" SubjectFine PaymentSubject = "fine" SubjectTax PaymentSubject = "tax" SubjectLien PaymentSubject = "lien" SubjectCost PaymentSubject = "cost" SubjectAgentWithdrawals PaymentSubject = "agent_withdrawals" SubjectPensionInsuranceWithoutPayouts PaymentSubject = "pension_insurance_without_payouts" SubjectPensionInsuranceWithPayouts PaymentSubject = "pension_insurance_with_payouts" SubjectHealthInsuranceWithoutPayouts PaymentSubject = "health_insurance_without_payouts" SubjectHealthInsuranceWithPayouts PaymentSubject = "health_insurance_with_payouts" SubjectAnother PaymentSubject = "another" )
type QR ¶
type QR struct {
// Confirmation scenario code.
Type ConfirmationType `json:"type,omitempty"`
// Data for generating the QR code.
ConfirmationData string `json:"confirmation_data,omitempty"`
}
type Receipt ¶
type Receipt struct {
// User information
// It is necessary to specify at least contact information:
// for Receipts from YooKassa — e—mail (customer.email),
// in other cases - e-mail (customer.email) or phone number (customer.phone).
Customer *Customer `json:"customer,omitempty"`
Items []ReceiptItem `json:"items"`
}
type ReceiptItem ¶
type ReceiptItem struct {
Description string `json:"description"`
Amount yoocommon.Amount `json:"amount"`
VatCode int `json:"vat_code"`
Quantity int `json:"quantity"`
Measure string `json:"measure,omitempty"`
// The fractional amount of the marked product (tag in 54 FZ — 1291).
// A mandatory parameter if these conditions are met at the same time:
// * you use Receipts from Kassa or an online sales register updated to FFD 1.2;
// * the product must be marked;
// * the measure field has the value piece.
//
// Example:
// you sell pencils by the piece.
// They are supplied in packs of 100 pieces with one marking code.
// When selling one pencil, you need to transfer 1 to numerator, and 100 to denominator.
MarkQuantity *MarkQuantity `json:"mark_quantity,omitempty"`
// The attribute of the subject of calculation (tag in 54 FZ — 1212)
// is what payment is accepted for, for example, a product or service.
//
// List of possible values:
// https://yookassa.ru/developers/payment-acceptance/receipts/54fz/yoomoney/parameters-values#payment-subject
PaymentSubject PaymentSubject `json:"payment_subject,omitempty"`
// The sign of the payment method (tag in 54 FZ — 1214) reflects the type of payment and the fact of transfer of the goods. Example: the buyer pays for the product in full and receives it immediately. In this case, you need to pass the full_payment value (full calculation).
//
// List of possible values:
// for Receipts from YooKassa: https://yookassa.ru/developers/payment-acceptance/receipts/54fz/yoomoney/parameters-values#payment-mode
// for third-party online sales registers: https://yookassa.ru/developers/payment-acceptance/receipts/54fz/other-services/parameters-values#payment-mode
PaymentMode PaymentMode `json:"payment_mode,omitempty"`
}
type Redirect ¶
type Redirect struct {
// Confirmation scenario code.
Type ConfirmationType `json:"type,omitempty"`
// The URL that the user will be redirected to for payment confirmation.
ConfirmationURL string `json:"confirmation_url,omitempty"`
// A request for making a payment with authentication by 3-D Secure.
// It works if you accept bank card payments without user confirmation by default.
// In other cases, the 3-D Secure authentication will be handled by YooMoney.
// If you would like to accept payments without additional confirmation by the user,
// contact your YooMoney manager.
Enforce bool `json:"enforce,omitempty"`
// The URL that the user will return to after confirming or
// canceling the payment on the webpage.
ReturnURL string `json:"return_url,omitempty" binding:"max=2048"`
}
type Sberbank ¶
type Sberbank struct {
// Bank card details.
Card Card `json:"card,omitempty"`
// The phone number specified during the registration process
// of the SberPay account, specified in the ITU-T E.164 format,
// for example, 79000000000.
Phone string `json:"phone,omitempty"`
// contains filtered or unexported fields
}
type Status ¶
type Status string
const ( // Pending - data is being processed. Pending Status = "pending" // Waiting for capture. WaitingForCapture Status = "waiting_for_capture" // Succeeded — receipt successfully registered. Succeeded Status = "succeeded" // Canceled — receipt was not registered, you need to create it independently. Canceled Status = "canceled" )
type TinkoffBank ¶
type TinkoffBank struct {
// contains filtered or unexported fields
}
type Transfer ¶
type Transfer struct {
// ID of the store in favor of which you're accepting the receipt.
// Provided by YooMoney, displayed in the Sellers section of your Merchant Profile (shopId column).
AccountID string `json:"account_id,omitempty"`
// Amount to be transferred to the store.
Amount yoocommon.Amount `json:"amount,omitempty"`
// Status of the money distribution between stores.
Status Status `json:"status,omitempty"`
// Commission for sold products or services charged in your favor.
PlatformFeeAmount yoocommon.Amount `json:"platform_fee_amount,omitempty"`
// Transaction description, which the seller will see in the YooMoney Merchant Profile.
// Example: "Marketplace order No. 72".
Description string `json:"description,omitempty" binding:"max=128"`
// Any additional data you might require for processing payments
// (for example, your internal order ID), specified as a “key-value” pair and returned in response from YooMoney.
// Limitations: no more than 16 keys, no more than 32 characters in the key’s title,
// no more than 512 characters in the key’s value, data type is a string in the UTF-8 format.
Metadata interface{} `json:"metadata,omitempty"`
}
Information about money distribution: the amounts of transfers and the stores to be transferred to.