summaryrefslogtreecommitdiffhomepage
path: root/mullvad-api/src/lib.rs
diff options
context:
space:
mode:
authorJonathan <jonathan@mullvad.net>2023-10-16 15:20:47 +0200
committerJonathan <jonathan@mullvad.net>2023-10-16 18:34:07 +0200
commit3d5cbe67e09bd3fb06b21397a3142714dd8924ea (patch)
tree3aeeedb1efe3dd755c732075eb66afc93fa00b66 /mullvad-api/src/lib.rs
parentd59972f5b20724cc9df24b77e5c0aa8aa31a504f (diff)
downloadmullvadvpn-3d5cbe67e09bd3fb06b21397a3142714dd8924ea.tar.xz
mullvadvpn-3d5cbe67e09bd3fb06b21397a3142714dd8924ea.zip
Add android conditional compilation for google pay
Add conditional compilation for google pay API access for only android. Also allow new error type to be parsed. Additionally fix review comments, formatting and warnings.
Diffstat (limited to 'mullvad-api/src/lib.rs')
-rw-r--r--mullvad-api/src/lib.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/mullvad-api/src/lib.rs b/mullvad-api/src/lib.rs
index 647b5cf071..63f5c2ad5b 100644
--- a/mullvad-api/src/lib.rs
+++ b/mullvad-api/src/lib.rs
@@ -5,8 +5,10 @@ use chrono::{offset::Utc, DateTime};
use futures::channel::mpsc;
use futures::Stream;
use hyper::Method;
+#[cfg(target_os = "android")]
+use mullvad_types::account::{PlayPurchase, PlayPurchasePaymentToken};
use mullvad_types::{
- account::{AccountToken, PlayPurchase, PlayPurchasePaymentToken, VoucherSubmission},
+ account::{AccountToken, VoucherSubmission},
version::AppVersion,
};
use proxy::ApiConnectionMode;
@@ -63,6 +65,7 @@ pub const API_IP_CACHE_FILENAME: &str = "api-ip-address.txt";
const ACCOUNTS_URL_PREFIX: &str = "accounts/v1";
const APP_URL_PREFIX: &str = "app/v1";
+#[cfg(target_os = "android")]
const GOOGLE_PAYMENTS_URL_PREFIX: &str = "payments/google-play/v1";
pub static API: LazyManual<ApiEndpoint> = LazyManual::new(ApiEndpoint::from_env_vars);
@@ -458,6 +461,7 @@ impl AccountsProxy {
}
}
+ #[cfg(target_os = "android")]
pub fn init_play_purchase(
&mut self,
account_token: AccountToken,
@@ -490,6 +494,7 @@ impl AccountsProxy {
}
}
+ #[cfg(target_os = "android")]
pub fn verify_play_purchase(
&mut self,
account_token: AccountToken,