Class: Bs2Api::Payment::Base

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

Direct Known Subclasses

Async, Confirmation, Detail, Key, Manual

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.

Raises:

  • (NoMethodError)


6
7
8
# File 'lib/bs2_api/payment/base.rb', line 6

def initialize
  raise NoMethodError, "Missing #{__method__} to #{self.class}"
end

Instance Attribute Details

#paymentObject (readonly)

Returns the value of attribute payment.



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

def payment
  @payment
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
# File 'lib/bs2_api/payment/base.rb', line 10

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

  @payment = Bs2Api::Entities::Payment.from_response(response)
  self
end