Class: Payabli::Management::Client
- Inherits:
-
Object
- Object
- Payabli::Management::Client
- Defined in:
- lib/payabli/management/client.rb
Instance Method Summary collapse
- #initialize(client:) ⇒ void constructor
-
#verify_account_details(request_options: {}, **params) ⇒ Payabli::Types::VerifyAccountDetailsResponse
Verifies a bank account and returns detailed verification results from the verification network, including bank name, account status, and response codes.
Constructor Details
#initialize(client:) ⇒ void
9 10 11 |
# File 'lib/payabli/management/client.rb', line 9 def initialize(client:) @client = client end |
Instance Method Details
#verify_account_details(request_options: {}, **params) ⇒ Payabli::Types::VerifyAccountDetailsResponse
Verifies a bank account and returns detailed verification results from the verification network, including bank name, account status, and response codes. Unlike a pass/fail verification, this endpoint returns granular data to support decision-making and troubleshooting.
When bank authentication is enabled for the paypoint's organization, the endpoint performs an identity
verification check on the account holder. Otherwise, it performs an account existence check. When bank
authentication is enabled, the accountHolderType and holderName fields are required.
Requires inboundpayments_create or outboundpayments_create permission.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/payabli/management/client.rb', line 33 def verify_account_details(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) request_data = Payabli::Management::Types::VerifyAccountDetailsRequest.new(params).to_h non_body_param_names = %w[entry] body = request_data.except(*non_body_param_names) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "Management/verifyAccountDetails/#{URI.encode_uri_component(params[:entry].to_s)}", body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::VerifyAccountDetailsResponse.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |