3v4l.org

run code in 300+ PHP versions simultaneously
<?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>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "current_token" in /in/sW5uc on line 16 NULL Warning: require_once(): open_basedir restriction in effect. File(/in/../../../lib/openpayu.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/sW5uc on line 18 Warning: require_once(/in/../../../lib/openpayu.php): Failed to open stream: Operation not permitted in /in/sW5uc on line 18 Fatal error: Uncaught Error: Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc:18 Stack trace: #0 {main} thrown in /in/sW5uc on line 18
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
76.14 ms | 401 KiB | 8 Q