mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
fix: add logs billing
This commit is contained in:
@@ -220,6 +220,8 @@ ErrorCode ServicesCatalogController::fillAvailableServices(QJsonObject &services
|
||||
|
||||
QByteArray responseBody;
|
||||
ErrorCode errorCode = executeRequest(QString("%1v1/services"), apiPayload, responseBody);
|
||||
qWarning() << "[ServicesCatalog] errorCode:" << static_cast<int>(errorCode)
|
||||
<< "response:" << QString::fromLocal8Bit(responseBody);
|
||||
if (errorCode == ErrorCode::NoError) {
|
||||
if (!responseBody.contains(apiDefs::key::services.data())) {
|
||||
errorCode = ErrorCode::ApiServicesMissingError;
|
||||
@@ -241,7 +243,10 @@ ErrorCode ServicesCatalogController::fillAvailableServices(QJsonObject &services
|
||||
|
||||
ErrorCode ServicesCatalogController::executeRequest(const QString &endpoint, const QJsonObject &apiPayload, QByteArray &responseBody)
|
||||
{
|
||||
GatewayController gatewayController(m_appSettingsRepository->getGatewayEndpoint(), m_appSettingsRepository->isDevGatewayEnv(), apiDefs::requestTimeoutMsecs,
|
||||
QString gatewayEndpoint = m_appSettingsRepository->getGatewayEndpoint();
|
||||
qWarning() << "[ServicesCatalog] request URL:" << endpoint.arg(gatewayEndpoint)
|
||||
<< "isDevEnv:" << m_appSettingsRepository->isDevGatewayEnv();
|
||||
GatewayController gatewayController(gatewayEndpoint, m_appSettingsRepository->isDevGatewayEnv(), apiDefs::requestTimeoutMsecs,
|
||||
m_appSettingsRepository->isStrictKillSwitchEnabled());
|
||||
return gatewayController.post(endpoint, apiPayload, responseBody);
|
||||
}
|
||||
|
||||
@@ -888,7 +888,9 @@ ErrorCode SubscriptionController::processPlayMarketPurchase(const QString &userC
|
||||
checkPayload[apiDefs::key::transactionId] = purchaseToken;
|
||||
|
||||
QByteArray checkResponse;
|
||||
qWarning() << "[Billing][processPlayMarketPurchase] v1/subscriptions request:" << QJsonDocument(checkPayload).toJson(QJsonDocument::Compact);
|
||||
ErrorCode checkError = executeRequest(QString("%1v1/subscriptions"), checkPayload, checkResponse, false);
|
||||
qWarning() << "[Billing][processPlayMarketPurchase] v1/subscriptions errorCode:" << static_cast<int>(checkError) << "response:" << checkResponse;
|
||||
if (checkError != ErrorCode::NoError) {
|
||||
qWarning().noquote() << "[Billing] Initial subscriptions check failed:" << static_cast<int>(checkError);
|
||||
return checkError;
|
||||
@@ -1083,7 +1085,9 @@ SubscriptionController::PlayMarketRestoreResult SubscriptionController::processP
|
||||
checkPayload[apiDefs::key::transactionId] = purchaseToken;
|
||||
|
||||
QByteArray checkResponse;
|
||||
qWarning() << "[Billing] v1/subscriptions request:" << QJsonDocument(checkPayload).toJson(QJsonDocument::Compact);
|
||||
ErrorCode checkError = executeRequest(QString("%1v1/subscriptions"), checkPayload, checkResponse, false);
|
||||
qWarning() << "[Billing] v1/subscriptions errorCode:" << static_cast<int>(checkError) << "response:" << checkResponse;
|
||||
if (checkError != ErrorCode::NoError) {
|
||||
qWarning().noquote() << "[Billing] Initial subscriptions check failed:" << static_cast<int>(checkError);
|
||||
result.errorCode = checkError;
|
||||
|
||||
@@ -6,8 +6,36 @@ Menu {
|
||||
|
||||
popupType: Popup.Native
|
||||
|
||||
onAboutToShow: blocker.enabled = true
|
||||
onClosed: blocker.enabled = false
|
||||
property Item inputBlocker: null
|
||||
|
||||
Component {
|
||||
id: inputBlockerComponent
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
preventStealing: true
|
||||
}
|
||||
}
|
||||
|
||||
onAboutToShow: {
|
||||
if (!textObj || !textObj.window) {
|
||||
return
|
||||
}
|
||||
|
||||
const contentItem = textObj.window.contentItem
|
||||
if (!inputBlocker) {
|
||||
inputBlocker = inputBlockerComponent.createObject(contentItem)
|
||||
} else {
|
||||
inputBlocker.parent = contentItem
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
if (inputBlocker) {
|
||||
inputBlocker.destroy()
|
||||
inputBlocker = null
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: qsTr("C&ut")
|
||||
@@ -31,11 +59,4 @@ Menu {
|
||||
enabled: textObj.length > 0
|
||||
onTriggered: textObj.selectAll()
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: blocker
|
||||
z: 2
|
||||
enabled: false
|
||||
preventStealing: true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user