Affirm v0.1.2 Affirm.TestHelpers

Link to this section Summary

Link to this section Functions

Link to this function build_bypass()
build_bypass() :: any()

Creates a Bypass listener to act as a double for the actual Affirm API endpoints

Link to this function failed_response_string(code)
failed_response_string(String.t()) :: String.t()
Link to this function simulate_service_down(bypass)
simulate_service_down(any()) :: nil

Simulates that the provided Bypass listener is not accepting connections

Link to this function simulate_service_response(bypass, status, body, fun)
simulate_service_response(any(), Plug.Conn.status(), String.t(), (Plug.Conn.t() -> boolean())) :: no_return()
Link to this function successful_authorization_response_string(amount, order_id \\ nil)
Link to this function successful_capture_response_string(amount, fee)
successful_capture_response_string(String.t(), String.t()) :: String.t()
Link to this function successful_read_response_string()
successful_read_response_string() :: String.t()
Link to this function successful_refund_response_string(amount, fee_refunded)
successful_refund_response_string(String.t(), String.t()) :: String.t()
Link to this function successful_void_response_string()
successful_void_response_string() :: String.t()