<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class PaymentMethodResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return [
            'code' => $this->code,
            'paymentType' => intval($this->type),
            'payment_image' => $this->image,
            'withImage' => $this->image != '',
            'description' => $this->description,
            'r_reference' => $this->need_ref == 1,
            'r_drawer' => $this->open_drawer == 1,
            'textColor' => $this->text_color,
            'baseColor' => $this->base_color,
            'use_terminal' => $this->use_terminal == 1,
            'terminal_key' => $this->terminal_id,
            'refund_pin' => $this->refund_pin,
            'store_id' => $this->store_id,
            'client_id' => $this->client_id,
            'client_key' => $this->client_key,
            'private_key' => $this->private_key,
            'public_key' => $this->public_key,
            'useCreditCard' => $this->used_credit_card == 1,
            'useQrPay' => $this->used_ewallet == 1,



        ];
    }
}
