HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: /home/xedaptot/ai.naniguide.com/vendor/square/square/src/Models/Builders/ChargeResponseBuilder.php
<?php

declare(strict_types=1);

namespace Square\Models\Builders;

use Core\Utils\CoreHelper;
use Square\Models\ChargeResponse;
use Square\Models\Transaction;

/**
 * Builder for model ChargeResponse
 *
 * @see ChargeResponse
 */
class ChargeResponseBuilder
{
    /**
     * @var ChargeResponse
     */
    private $instance;

    private function __construct(ChargeResponse $instance)
    {
        $this->instance = $instance;
    }

    /**
     * Initializes a new charge response Builder object.
     */
    public static function init(): self
    {
        return new self(new ChargeResponse());
    }

    /**
     * Sets errors field.
     */
    public function errors(?array $value): self
    {
        $this->instance->setErrors($value);
        return $this;
    }

    /**
     * Sets transaction field.
     */
    public function transaction(?Transaction $value): self
    {
        $this->instance->setTransaction($value);
        return $this;
    }

    /**
     * Initializes a new charge response object.
     */
    public function build(): ChargeResponse
    {
        return CoreHelper::clone($this->instance);
    }
}