<?php
if($_GET){
session_start();
require '../../db.php';
$uyeid = $_SESSION['uyeid'];
$paketid = $_GET["id"];
$shopierbilgiler = mysqli_fetch_array(mysqli_query($db, "SELECT * FROM site_sanalpos WHERE id = '1'"));

	$uyebilgi = mysqli_fetch_array(mysqli_query($db, "select * from uyeler WHERE id = '$uyeid'"));
	$paketbilgi = mysqli_fetch_array(mysqli_query($db, "select * from paketler WHERE id = '$paketid'"));
	$paket_fiyat = $paketbilgi['paket_fiyat'];
	$uyeid = $uyebilgi["id"].",".$paketbilgi['id'];
	require 'shopierAPI.php';
	    $shopier = new Shopier($shopierbilgiler['api_key'], $shopierbilgiler['api_sifre']);
	    $shopier->setBuyer([
	    'id' => $uyeid,
	    'paket' => $uyeid,
	    'first_name' => $uyebilgi["ad"], 'last_name' => $uyebilgi["soyad"], 'email' => $uyebilgi["email"], 'phone' => '']);
	    $shopier->setOrderBilling([
	    'billing_address' => $uyeid,
	    'billing_city' => $uyebilgi["ad"],
	    'billing_country' => $uyebilgi["email"],
	    'billing_postcode' => $uyeid,
	    ]);
	    $shopier->setOrderShipping([
	    'shipping_address' => $uyeid,
	    'shipping_city' => $uyebilgi["ad"],
	    'shipping_country' => $uyebilgi["email"],
	    'shipping_postcode' => $uyeid,
	    ]);
	    die($shopier->run($uyeid, $paket_fiyat, $site_url.'/entegrasyonlar/shopier/shopierNotify.php'));
	}
?>
