Class: Monri::Payments::CreateResponse
- Inherits:
-
Response
- Object
- Hash
- Response
- Monri::Payments::CreateResponse
show all
- Defined in:
- lib/monri/payments/create_response.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Response
exception, #exception, #exception=, #failed?, #initialize
Class Method Details
25
26
27
28
29
30
31
32
33
|
# File 'lib/monri/payments/create_response.rb', line 25
def self.create
raise ArgumentError, 'Provide a block' unless block_given?
begin
CreateResponse.new(yield)
rescue StandardError => e
CreateResponse.new(exception: e)
end
end
|
Instance Method Details
#approved? ⇒ Boolean
5
6
7
|
# File 'lib/monri/payments/create_response.rb', line 5
def approved?
status == 'approved'
end
|
#client_secret ⇒ String
20
21
22
|
# File 'lib/monri/payments/create_response.rb', line 20
def client_secret
self[:client_secret]
end
|
#id ⇒ String
15
16
17
|
# File 'lib/monri/payments/create_response.rb', line 15
def id
self[:id]
end
|
#status ⇒ String
10
11
12
|
# File 'lib/monri/payments/create_response.rb', line 10
def status
self[:status]
end
|