Class: Bs2Api::Payment::Base
- Inherits:
-
Object
- Object
- Bs2Api::Payment::Base
- Defined in:
- lib/bs2_api/payment/base.rb
Direct Known Subclasses
Async, Confirmation, Detail, Key, Manual
Instance Attribute Summary collapse
-
#payment ⇒ Object
readonly
Returns the value of attribute payment.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
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
#payment ⇒ Object (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
#call ⇒ Object
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 |