Current section

Files

Jump to
mollie_api lib mollie_api api verify_payee_api.ex
Raw

lib/mollie_api/api/verify_payee_api.ex

# NOTE: This file is auto generated by OpenAPI Generator 7.17.0 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule MollieAPI.Api.VerifyPayeeAPI do
@moduledoc """
API calls for all endpoints tagged `VerifyPayeeAPI`.
"""
alias MollieAPI.Connection
import MollieAPI.RequestBuilder
@doc """
Verify Payee
> 🚧 Beta feature > > This feature is currently in beta testing, and the final specification may still change. Perform a Verification of Payee (VoP) check. This allows you to verify the account holder name against the records held by the receiving bank before initiating a transfer. The verification result indicates whether the provided name matches, closely matches, or does not match the name on file at the receiving bank. This helps prevent misdirected payments. ### Simulating verification scenarios in test mode In test mode, you can simulate various verification outcomes by adjusting the creditor name in the `creditorBankAccount.accountHolderName` property. This allows you to test all possible Verification of Payee results without needing special properties. The names are case insensitive. | Account holder name | Scenario | Verification result | Suggested name | |----------------------------------------|-----------------------------------------------|---------------------|----------------| | `John Close Match` | Name closely matches the bank records | `close-match` | `John Match` | | `John No Match` | Name does not match the bank records | `no-match` | — | | `John Unavailable` | Verification is not available | `not-available` | — | | Any other name | Default: name matches the bank records | `match` | — |
### Parameters
- `connection` (MollieAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
- `:"idempotency-key"` (String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.
- `:body` (VerificationOfPayeeRequest):
### Returns
- `{:ok, MollieAPI.Model.VerificationOfPayeeResponse.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec verify_payee(Tesla.Env.client, keyword()) :: {:ok, MollieAPI.Model.VerificationOfPayeeResponse.t} | {:ok, MollieAPI.Model.ErrorResponse.t} | {:error, Tesla.Env.t}
def verify_payee(connection, opts \\ []) do
optional_params = %{
:"idempotency-key" => :headers,
:body => :body
}
request =
%{}
|> method(:post)
|> url("/v2/business-accounts/payee-verifications")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, MollieAPI.Model.VerificationOfPayeeResponse},
{422, MollieAPI.Model.ErrorResponse},
{429, MollieAPI.Model.ErrorResponse},
{503, MollieAPI.Model.ErrorResponse}
])
end
end