Class: Rubyplat::Responses::PaymentStatusResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/rubyplat/responses/payment_status_response.rb

Constant Summary collapse

STATES =
{
  1 => "payment_permission_sent",
  3 => "processing",
  7 => "completed"
}

Instance Method Summary collapse

Methods inherited from Response

from_response_string, #initialize

Methods included from Utils::Parser

#parse

Constructor Details

This class inherits a constructor from Rubyplat::Responses::Response

Instance Method Details

#completed?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/rubyplat/responses/payment_status_response.rb', line 22

def completed?
  state == 'completed'
end

#payment_permission_sent?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rubyplat/responses/payment_status_response.rb', line 18

def payment_permission_sent?
  state == 'payment_permission_sent'
end

#processing?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rubyplat/responses/payment_status_response.rb', line 14

def processing?
  state == 'processing'
end

#stateObject



10
11
12
# File 'lib/rubyplat/responses/payment_status_response.rb', line 10

def state
  STATES[result.to_i]
end

#success?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/rubyplat/responses/payment_status_response.rb', line 26

def success?
  result.to_i == 7 && error.to_i == 0
end