Module: RegApi2::User

Extended by:
User
Includes:
Builder
Included in:
User
Defined in:
lib/reg_api2/user.rb

Overview

REG.API user category

Instance Method Summary collapse

Methods included from Builder

included

Instance Method Details

#create(opts = {}) ⇒ String

Note:

Accessability: partners

New user registration.

Parameters:

Options Hash (opts):

  • :user_login (String)

    Login of the new user in the REG.API system. Allowed symbols: Latin lower-case letters (a-z), digits (0 -9) and the symbols "-" and "_".

  • :user_password (String)

    Password of the new user.

  • :user_email (String)

    E-mail of the new user.

  • :user_country_code (String)

    Two-letter ISO code of the country of residence of the new user, for example, 'RU'.

Returns:

  • (String)

    user_id of new user.



28
# File 'lib/reg_api2/user.rb', line 28

define :create, required: %w[ user_login user_password user_email user_country_code ], field: :user_id

#get_balance(opts = {}) ⇒ Hash(currency, prepay, blocked, credit)

Note:

Accessability: clients

Note:

Support of service lists: no

View current balance.

Parameters:

  • opts (defaults to: {})

    Opts

Options Hash (opts):

  • :currency (String)

    Define the currency in which the balance is presented. Conversion is performed automatically in accordance with the current exchange rates. Available options: RUR (default), USD, EUR, UAH.

Returns:

  • (Hash(currency, prepay, blocked, credit))

    User balance



47
# File 'lib/reg_api2/user.rb', line 47

define :get_balance, required: %w[ currency ]

#get_statistics(opts = {}) ⇒ Hash(costs_for_period, active_domains_cnt, active_domains_get_ctrl_cnt, renew_domains_cnt, ...)

Note:

Accessability: clients

Note:

Support of service lists: no

Get user statistics.

Parameters:

  • opts (defaults to: {})

    Opts

Options Hash (opts):

  • :date_from (String)

    This field sets the statistics start date (optional).

  • :date_till (String)

    This field sets the statistics end date (optional).

Returns:

  • (Hash(costs_for_period, active_domains_cnt, active_domains_get_ctrl_cnt, renew_domains_cnt, ...))

    User statistics



38
# File 'lib/reg_api2/user.rb', line 38

define :get_statistics, optional: %w[ date_till date_from ]

#nopvoid

This method returns an undefined value.

Accessibility testing.

Parameters:

  • None


17
# File 'lib/reg_api2/user.rb', line 17

define :nop

#refill_balance(opts = {}) ⇒ Hash(total_payment, ...)

Note:

Accessability: clients

Note:

Support of service lists: no

Add funds to the account. Allows sending invoices to WebMoney and Yandex.Dengi.

Examples:

Add funds though WebMoney

RegApi2.user.refill_balance(pay_type: 'WM', wmid: 123456789012, currency: 'RUR', amount: 1000)

Parameters:

  • opts (defaults to: {})

    Opts

Options Hash (opts):

  • :pay_type (String)

    Payment method. Available options: WM — WebMoney, requires specifying of WMID; ymbill - Yandex.Dengi (the invoice receipt function should be enabled).

  • :wmid (String)

    WebMoney ID

  • :currency (String)

    Currency of the transfer. RUR only for Yandex.Dengi; USD, EUR and UAH for WebMoney.

  • :amount (String)

    Amount of the invoice.

Returns:

  • (Hash(total_payment, ...))

    Result of operation.



61
# File 'lib/reg_api2/user.rb', line 61

define :refill_balance, required: %w[ pay_type wmid currency amount ]