function delete_xhr($type, $paymentProfileID) { if ($this->checkAuth()) { $headers = getallheaders(); $userPay = new PaymentSystem(); $userPay->loadUser(mb_strtolower($headers['Auth-User'])); if ($type == 'profiles') { if (isset($paymentProfileID) && $userPay->delPaymentProfile($paymentProfileID)) { echo json_encode(StatusReturn::S200()); } else { echo json_encode(StatusReturn::E400('Profile Missing!')); } } else { echo json_encode(StatusReturn::E404('404 Not Found!')); } } }