public static function doPayment($data) { $data['req_basket'] = Doku_Library::formatBasket($data['req_basket']); $ch = curl_init(Doku_Initiate::paymentUrl); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'data=' . json_encode($data)); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $responseJson = curl_exec($ch); curl_close($ch); if (is_string($responseJson)) { return json_decode($responseJson); } else { return $responseJson; } }