Class: Bs2Api::Payment::Detail

Inherits:
Base
  • Object
show all
Defined in:
lib/bs2_api/payment/detail.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#payment

Instance Method Summary collapse

Constructor Details

#initialize(payment_id, client_id: Bs2Api.configuration.client_id, client_secret: Bs2Api.configuration.client_secret, proxy: nil) ⇒ Detail

Returns a new instance of Detail.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/bs2_api/payment/detail.rb', line 6

def initialize(
  payment_id,
  client_id: Bs2Api.configuration.client_id,
  client_secret: Bs2Api.configuration.client_secret,
  proxy: nil
)
  @payment_id = payment_id
  @client_id = client_id
  @client_secret = client_secret
  @proxy = proxy
end

Instance Attribute Details

#successObject (readonly)

Returns the value of attribute success.



4
5
6
# File 'lib/bs2_api/payment/detail.rb', line 4

def success
  @success
end

Instance Method Details

#callObject



18
19
20
21
22
23
# File 'lib/bs2_api/payment/detail.rb', line 18

def call
  response = detail_request
  raise Bs2Api::Errors::BadRequest, ::Util::Response.parse_error(response) unless response.ok?

  Bs2Api::Entities::Payment.from_response(response)
end