Class: Monri::Payments::StatusResponse
- Inherits:
-
Response
- Object
- Hash
- Response
- Monri::Payments::StatusResponse
show all
- Defined in:
- lib/monri/payments/status_response.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Response
#exception, exception, #exception=, #failed?
Constructor Details
Returns a new instance of StatusResponse.
6
7
8
9
10
11
|
# File 'lib/monri/payments/status_response.rb', line 6
def initialize(params)
if params.has_key?(:payment_result)
self[:payment_result] = PaymentResult.new(params.delete(:payment_result))
end
self.merge!(params)
end
|
Class Method Details
34
35
36
37
38
39
40
41
42
|
# File 'lib/monri/payments/status_response.rb', line 34
def self.create
raise ArgumentError, 'Provide a block' unless block_given?
begin
StatusResponse.new(yield)
rescue StandardError => e
StatusResponse.new(exception: e)
end
end
|
Instance Method Details
#client_secret ⇒ String
24
25
26
|
# File 'lib/monri/payments/status_response.rb', line 24
def client_secret
self[:client_secret]
end
|
29
30
31
|
# File 'lib/monri/payments/status_response.rb', line 29
def payment_result
self[:payment_result]
end
|
#payment_status ⇒ String
19
20
21
|
# File 'lib/monri/payments/status_response.rb', line 19
def payment_status
self[:payment_status]
end
|
#status ⇒ String
14
15
16
|
# File 'lib/monri/payments/status_response.rb', line 14
def status
self[:status]
end
|