echo 'Error: Record could not be found'; break; } catch (Recurly_ValidationError $e) { $messages = explode(',', $e->getMessage()); echo 'Error: Validation problems: ' . implode("\n", $messages); break; } catch (Recurly_ServerError $e) { echo 'Error: Problem communicating with Recurly'; break; } catch (Exception $e) { echo "Error: " . $e->getMessage(); echo "Error: " . $e; break; } } $resp = $api->sign_up($_POST['email'], $_POST['password'], '', '', '', '', '', '', $paymentId, $paymentState, $paymentLicense, $accountCode, $createdAt); // $resp =$api->sign_up($_POST['email'], $_POST['password'], $_POST['firstname'], $_POST['lastname'], $_POST['company'], $_POST['city'], $_POST['state'], $_POST['country']); } $json = new stdClass(); if ($resp != null) { if (isset($resp->returnCode)) { $json->code = (string) $resp->returnCode; $respDecr = (string) $resp->description; if (strpos($respDecr, ';;;') !== False) { list($textDesc, $urlToDecode) = explode(";;;", $respDecr); $urlToDecode = base64_decode($urlToDecode); $respDecr = $textDesc . ";;;" . $urlToDecode; } $json->description = $respDecr; } else { $json->code = "FAIL";