3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 * */ session_start(); var_dump($_SESSION['current_token']); require_once realpath(dirname(__FILE__)) . '/../../../lib/openpayu.php'; require_once realpath(dirname(__FILE__)) . '/../../config.php'; $currentToken = $_SESSION['current_token']; $order = array( 'customerIp' => '127.0.0.1', 'notifyUrl' => 'http://oskartestserver.net/examples/v2/order/Notify.php', 'merchantPosId' =>'185641', 'continueUrl' =>'http://oskartestserver.net/positive', 'description' => 'popis transakce', 'currencyCode' => 'CZK', 'totalAmount' => '999', 'buyer' => array( 'email' => 'email@exampledomain.com', 'firstName' => 'Jan', 'lastName' => 'Novak', 'delivery' => array( 'recipientName' => 'Jan Novak', 'countryCode' => 'CZ') ), 'products' => array( array('name' => 'Mouse', 'unitPrice' => '999', 'quantity' => '1') ), 'payMethods' => array( 'payMethod' => array( 'type' =>'CARD_TOKEN', 'value' => $currentToken) ), 'settings' => array( 'agreement' => 'true') ); ?> <!doctype html> <html lang="en-US"> <head> <meta charset="UTF-8"> <title>Create Order - OpenPayU v2</title> <link rel="stylesheet" href="../../layout/css/bootstrap.min.css"> <link rel="stylesheet" href="../../layout/css/style.css"> </head> <body> <div class="container"> <div class="page-header"> <h1>Create Order - OpenPayU v2</h1> </div> <?php try { $response = OpenPayU_Order::create($order); $status_desc = OpenPayU_Util::statusDesc($response->getStatus()); if($response->getStatus() == 'SUCCESS'){ echo '<div class="alert alert-success">SUCCESS: '.$status_desc; echo '</div>'; }else{ echo '<div class="alert alert-warning">'.$response->getStatus().': '.$status_desc; echo '</div>'; } }catch (OpenPayU_Exception $e){ echo '<pre>'; var_dump((string)$e); echo '</pre>'; } ?> <h1>Request</h1> <div id="unregisteredCardData"> <?php var_dump($order); ?> </div> <table class="table table-hover table-bordered"> <thead> <tr> <th colspan="2">Important data from response</th> </tr> </thead> <tbody> <tr> <td>Order status</td> <td><?= $response->getStatus() ?></td> </tr> <tr> <td>Order id</td> <td><?= $response->getResponse()->orderId ?></td> <?php file_put_contents(__DIR__.'/orderID.log', $response->getResponse()->orderId); ?> </tr> <tr> <td>Redirect Uri</td> <td><a href="<?= $response->getResponse()->redirectUri ?>"><?= $response->getResponse()->redirectUri ?></a> </td> </tr> </tbody> </table> <h1>Response</h1> <div id="unregisteredCardData"> <?php var_dump($response); ?> </div> </div> </html>
based on uSOnI
Output for 5.3.0 - 7.2.0
Notice: Undefined index: current_token in /in/sW5uc on line 16 NULL Warning: require_once(/in/../../../lib/openpayu.php): failed to open stream: No such file or directory in /in/sW5uc on line 18 Fatal error: require_once(): Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc on line 18
Process exited with code 255.
Output for 5.2.3 - 5.2.17
Notice: Undefined index: current_token in /in/sW5uc on line 16 NULL Warning: require_once(/in/../../../lib/openpayu.php): failed to open stream: No such file or directory in /in/sW5uc on line 18 Fatal error: require_once(): Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc on line 18
Process exited with code 255.
Output for 5.1.0 - 5.2.2
Warning: session_start(): Cannot send session cookie - headers already sent in /in/sW5uc on line 14 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/sW5uc:14) in /in/sW5uc on line 14 Notice: Undefined index: current_token in /in/sW5uc on line 16 NULL Warning: require_once(/in/../../../lib/openpayu.php): failed to open stream: No such file or directory in /in/sW5uc on line 18 Fatal error: require_once(): Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc on line 18
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: session_start(): Cannot send session cookie - headers already sent in /in/sW5uc on line 14 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/sW5uc:14) in /in/sW5uc on line 14 Notice: Undefined index: current_token in /in/sW5uc on line 16 NULL Warning: main(/in/../../../lib/openpayu.php): failed to open stream: No such file or directory in /in/sW5uc on line 18 Fatal error: main(): Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc on line 18
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/sW5uc on line 69
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/sW5uc on line 69
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/sW5uc on line 69
Process exited with code 255.