Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/platnosc.php |
<?php
include('admin/config.php');
include('admin/Admin.php');
require_once realpath(dirname(__FILE__)) . '/payu/lib/openpayu.php';
require_once realpath(dirname(__FILE__)) . '/payu/examples/config.php';
$order = array();
$admin = new Admin();
if(isset($_GET['id']))$dane = $admin->setDate('kupione',$_GET['id']);
elseif(isset($_GET['zip']))$dane = $admin->setDate2('kupione',$_GET['zip']);
elseif(isset($_GET['hash']))$dane = $admin->setDate3('kupione',$_GET['hash']);
$order['notifyUrl'] = 'http://www.etykietyweselne.pl/';
$order['continueUrl'] = 'http://www.etykietyweselne.pl/koszyk.php?success';
$order['customerIp'] = '127.0.0.1';
$order['merchantPosId'] = OpenPayU_Configuration::getMerchantPosId();
$order['description'] = 'Zamówienie ID:'.$_GET['id'];
$order['currencyCode'] = 'PLN';
$order['totalAmount'] = round($dane['zaplacono']*100,0);
$order['extOrderId'] = uniqid('', true);
$order['products'][0]['name'] = $dane['cokupil'];
$order['products'][0]['unitPrice'] = round($dane['zaplacono']*100,0);
$order['products'][0]['quantity'] = 1;
$order['buyer']['email'] = $dane['email'];
$order['buyer']['phone'] = $dane['tel'];
$order['buyer']['firstName'] = $dane['imie'];
$order['buyer']['lastName'] = '';
$response = OpenPayU_Order::create($order);
$ordid= $response->getResponse()->orderId;
$dane['orderid'] = $ordid;
$admin->AktualizujOrderId($dane);
header('Location:'.$response->getResponse()->redirectUri);
?>