Class: Monri::Payments::CreateResponse

Inherits:
Response
  • Object
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

Constructor Details

This class inherits a constructor from Monri::Response

Class Method Details

.createCreateResponse

Returns:

Raises:

  • (ArgumentError)


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

Returns:

  • (Boolean)


5
6
7
# File 'lib/monri/payments/create_response.rb', line 5

def approved?
  status == 'approved'
end

#client_secretString

Returns:

  • (String)


20
21
22
# File 'lib/monri/payments/create_response.rb', line 20

def client_secret
  self[:client_secret]
end

#idString

Returns:

  • (String)


15
16
17
# File 'lib/monri/payments/create_response.rb', line 15

def id
  self[:id]
end

#statusString

Returns:

  • (String)


10
11
12
# File 'lib/monri/payments/create_response.rb', line 10

def status
  self[:status]
end