Class: Rubyplat::Requests::PaymentPermission
- Inherits:
-
Object
- Object
- Rubyplat::Requests::PaymentPermission
- Defined in:
- lib/rubyplat/requests/payment_permission.rb
Constant Summary collapse
- InvalidPaytool =
Class.new(StandardError)
Instance Method Summary collapse
-
#body ⇒ String
String representation of request.
-
#initialize(params = {}) ⇒ PaymentPermission
constructor
A new instance of PaymentPermission.
Constructor Details
#initialize(params = {}) ⇒ PaymentPermission
Returns a new instance of PaymentPermission.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rubyplat/requests/payment_permission.rb', line 19 def initialize(params = {}) params = defaults.merge(params) @sender = params[:sender] @receiver = params[:receiver] @operator = params[:operator] @date = DateTime.parse((params[:date] || Time.now).to_s).strftime('%Y.%m.%d %H:%M:%S') @session = params[:session] @number = params[:number] @account = params[:account] @amount = params[:amount] @req_type = params[:req_type] @pay_tool = Rubyplat::PAYTOOL.fetch(params[:pay_tool]) { raise InvalidPaytool.new("Paytool может принимать значения #{PAYTOOL.keys}") } @term_id = params[:term_id] @comment = params[:comment] @accept_keys = params[:accept_keys] @no_route = params[:no_route] @amount_all = params[:amount_all] end |
Instance Method Details
#body ⇒ String
Returns String representation of request.
58 59 60 |
# File 'lib/rubyplat/requests/payment_permission.rb', line 58 def body body_parameters.compact.join("\r\n").encode(Encoding::WINDOWS_1251) end |