EFL
Builders

PostVerificationCodeBuilder

Fluent builder for constructing PostVerificationCode payloads with transaction and verification code.

Namespace and purpose

Imoli\EflLeasingSdk\Builder\PostVerificationCodeBuilder is a fluent helper for building PostVerificationCode instances. It is used when submitting a verification code back to the EFL API via /Process/PostVerificationCode.

Class definition

  • Namespace: Imoli\EflLeasingSdk\Builder
  • Class: final PostVerificationCodeBuilder
  • Builds: Imoli\EflLeasingSdk\Model\Verification\PostVerificationCode
namespace Imoli\EflLeasingSdk\Builder;

use Imoli\EflLeasingSdk\Model\Verification\PostVerificationCode;

final class PostVerificationCodeBuilder
{
    public function withTransactionId(string $transactionId): self;
    public function withVerificationCode(string $verificationCode): self;

    public function build(): PostVerificationCode;

    public static function create(string $transactionId, string $verificationCode): self;
}

Fluent API

  • withTransactionId(string $transactionId): self
    Sets the transaction identifier associated with the verification attempt.
  • withVerificationCode(string $verificationCode): self
    Sets the verification code received from the user or external system.
  • build(): PostVerificationCode
    • Requires both transactionId and verificationCode.
    • Throws \LogicException if any of them is missing.
    • Returns a new PostVerificationCode instance.
  • static create(string $transactionId, string $verificationCode): self
    Convenience factory that sets both required fields in a single call.

Usage example

use Imoli\EflLeasingSdk\Builder\PostVerificationCodeBuilder;

$payload = PostVerificationCodeBuilder::create('tx-1', '123456')
    ->build();