<?php namespace TPS\Shop\Listeners;

use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;

class Customer
{
    public function __construct(){
        $this->sms_gateway = config('app.sms_gateway'); 
        $this->check_sms_gateway = config('app.check_sms_gateway');
    }

    public function sendVeificationCode($data){
        $response = Http::withHeaders(['Accept' => 'application/json'])
        ->post($this->sms_gateway, [
            'phone_number' => '+993'.$data->phone
        ]);
        return $response;
    }

    public function checkVeificationCode($data){
        $response = Http::withHeaders(['Accept' => 'application/json'])
        ->post($this->check_sms_gateway, [
            'phone_number' => '+993'.$data->phone,
            'otp' => $data->token
        ]);
        return $response;
    }
}