<?php

namespace Yajny\Helpers;

use GuzzleHttp\Client;

class PostBackIntegration
{
    public static function postConversion($coupon, $currency, $country, $sale_amount = 0.1, $discount = 0.1)
    {
        $client = new Client();
        $response = $client->get('https://track.arabytracking.net/direct/conversion', [
            'query' => [
                'discount' => $discount,
                'coupon' => $coupon,
                'client' => 'yajny',
                'sales_amount' => $sale_amount,
                'currency' => $currency,
                'order_id' => now(),
                'country' => $country
            ]
        ]);
        return json_decode($response->getBody(), true);
    }
}