Class: InvisibleCollector::Resources::PaymentResource
- Inherits:
-
Object
- Object
- InvisibleCollector::Resources::PaymentResource
- Includes:
- DefaultHandlers
- Defined in:
- lib/invisible_collector/resources/payment_resource.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PaymentResource
constructor
A new instance of PaymentResource.
- #save(payment) ⇒ Object
Methods included from DefaultHandlers
#execute, #execute_get, #execute_post, #handle, #handles
Constructor Details
#initialize(options = {}) ⇒ PaymentResource
Returns a new instance of PaymentResource.
8 9 10 11 12 13 14 |
# File 'lib/invisible_collector/resources/payment_resource.rb', line 8 def initialize( = {}) super() handle(400) { |response| raise InvisibleCollector::InvalidRequest.from_json(response.body) } handle(404) { |response| raise InvisibleCollector::NotFound.from_json(response.body) } handle(409) { |response| raise InvisibleCollector::InvalidRequest.from_json(response.body) } handle(422) { |response| raise InvisibleCollector::InvalidRequest.from_json(response.body) } end |