class GoCardlessPro::InvalidStateError
Thrown when the API returns an invalid state error
Constants
- CONFLICTING_RESOURCE_ID
- IDEMPOTENT_CREATION_CONFLICT
Public Instance Methods
Source
# File lib/gocardless_pro/error/invalid_state_error.rb, line 11 def conflicting_resource_id return unless idempotent_creation_conflict? idempotent_creation_conflict_error['links'][CONFLICTING_RESOURCE_ID] end
Source
# File lib/gocardless_pro/error/invalid_state_error.rb, line 7 def idempotent_creation_conflict? !idempotent_creation_conflict_error.nil? end
Private Instance Methods
Source
# File lib/gocardless_pro/error/invalid_state_error.rb, line 19 def idempotent_creation_conflict_error errors.find { |error| error['reason'] == IDEMPOTENT_CREATION_CONFLICT } end