Viewing File: /home/ubuntu/vedadeals-backend-base/app/Http/Resources/OrderPaymentResource.php

<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class OrderPaymentResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {   
        return [
            'order_payment_id' => $this->order_payment_id,
            'order_payment_unique_id' => $this->order_payment_unique_id,
            'payment_id' => $this->payment_id,
            'transaction_hash' => $this->transaction_hash,
            'wallet_address' => $this->wallet_address,
            'payment_mode' => $this->payment_mode,
            'is_cancelled' => $this->is_cancelled,
            'cancelled_reason' => $this->cancelled_reason,
            'sub_total_formatted' => formatted_amount($this->sub_total),
            'total_formatted' => formatted_amount($this->total),
            'paid_date' => common_date($this->paid_date, $request->timezone),
            'status' => $this->status,
            'status_formatted' => payment_status_formatted($this->status),
        ];
    }
}
Back to Directory File Manager