forked from PayU-EMEA/openpayu_php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrderForm.php
More file actions
78 lines (68 loc) · 2.22 KB
/
OrderForm.php
File metadata and controls
78 lines (68 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* OpenPayU
*
* @copyright Copyright (c) 2014 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
*
* http://www.payu.com
* http://developers.payu.com
* http://twitter.com/openpayu
*
*/
require_once realpath(dirname(__FILE__)) . '/../../../lib/openpayu.php';
require_once realpath(dirname(__FILE__)) . '/../../config.php';
$order = array();
$order['notifyUrl'] = 'http://localhost'.dirname($_SERVER['REQUEST_URI']).'/OrderNotify.php';
$order['continueUrl'] = 'http://localhost'.dirname($_SERVER['REQUEST_URI']).'/../../layout/success.php';
$order['customerIp'] = '127.0.0.1';
$order['merchantPosId'] = OpenPayU_Configuration::getMerchantPosId();
$order['description'] = 'New order';
$order['currencyCode'] = 'PLN';
$order['totalAmount'] = 3200;
$order['extOrderId'] = rand(1000, 1000000);
$order['products'][0]['name'] = 'Product1';
$order['products'][0]['unitPrice'] = 1000;
$order['products'][0]['quantity'] = 1;
$order['products'][1]['name'] = 'Product2';
$order['products'][1]['unitPrice'] = 2200;
$order['products'][1]['quantity'] = 1;
$order['buyer']['email'] = 'dd@ddd.pl';
$order['buyer']['phone'] = '123123123';
$order['buyer']['firstName'] = 'Jan';
$order['buyer']['lastName'] = 'Kowalski';
$rsp = OpenPayU_Order::hostedOrderForm($order);
?>
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Generated Order Form - OpenPayU v2</title>
<link rel="stylesheet" href="../../layout/css/bootstrap.min.css">
<link rel="stylesheet" href="../../layout/css/style.css">
<style type="text/css">
#payu-payment-form button[type=submit]{
border: 0px;
height: 35px;
width: 140px;
background: url('http://static.payu.com/pl/standard/partners/buttons/payu_account_button_long_03.png');
background-repeat: no-repeat;
cursor: pointer;
}
</style>
</head>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>Generated Order Form - OpenPayU v2.1</h1>
</div>
<div id="message"></div>
<div id="unregisteredCardData">
<pre>
<?php echo htmlentities($rsp); ?>
</pre>
<?php echo $rsp; ?>
</div>
</div>
</html>