Module: PayjpMock::WebMockWrapper

Defined in:
lib/payjp_mock/webmock_wrapper.rb

Instance Method Summary collapse

Instance Method Details

#payjp_api_connection_errorObject



23
24
25
# File 'lib/payjp_mock/webmock_wrapper.rb', line 23

def payjp_api_connection_error
  Response::Error::ApiConnectionError.new
end

#payjp_api_error(attributes = {}) ⇒ Object



27
28
29
# File 'lib/payjp_mock/webmock_wrapper.rb', line 27

def payjp_api_error(attributes = {})
  Response::Error::ApiError.new(attributes.symbolize_keys)
end

#payjp_authentication_error(attributes = {}) ⇒ Object



19
20
21
# File 'lib/payjp_mock/webmock_wrapper.rb', line 19

def payjp_authentication_error(attributes = {})
  Response::Error::AuthenticationError.new(attributes.symbolize_keys)
end

#payjp_card_error(attributes = {}) ⇒ Object



11
12
13
# File 'lib/payjp_mock/webmock_wrapper.rb', line 11

def payjp_card_error(attributes = {})
  Response::Error::CardError.new(attributes.symbolize_keys)
end

#payjp_invalid_request_error(attributes = {}) ⇒ Object



15
16
17
# File 'lib/payjp_mock/webmock_wrapper.rb', line 15

def payjp_invalid_request_error(attributes = {})
  Response::Error::InvalidRequestError.new(attributes.symbolize_keys)
end

#payjp_stub(resource, operation, params: {}, source: {}, error: nil, response: nil) ⇒ Object



5
6
7
8
9
# File 'lib/payjp_mock/webmock_wrapper.rb', line 5

def payjp_stub(resource, operation, params: {}, source: {}, error: nil, response: nil)
  builder = RequestBuilder.new(resource, operation, params, source, error, response)
  request = builder.build
  request.stub
end