Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 2 additions & 37 deletions include/session/pro_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,43 +104,8 @@ struct session_pro_backend_payment_provider_metadata {

/// The centralised list of common URLs and properties for handling payment provider specific
/// integrations. Especially useful for cross-device management of Session Pro subscriptions.
// clang-format off
const session_pro_backend_payment_provider_metadata SESSION_PRO_BACKEND_PAYMENT_PROVIDER_METADATA[SESSION_PRO_BACKEND_PAYMENT_PROVIDER_COUNT] = {
/*SESSION_PRO_PAYMENT_PROVIDER_NIL*/ {
.device = string8_literal(""),
.store = string8_literal(""),
.platform = string8_literal(""),
.platform_account = string8_literal(""),
.refund_platform_url = string8_literal(""),
.refund_support_url = string8_literal(""),
.refund_status_url = string8_literal(""),
.update_subscription_url = string8_literal(""),
.cancel_subscription_url = string8_literal(""),
},
/*SESSION_PRO_PAYMENT_PROVIDER_GOOGLE_PLAY_STORE*/ {
.device = string8_literal("Android"),
.store = string8_literal("Google Play Store"),
.platform = string8_literal("Google"),
.platform_account = string8_literal("Google account"),
.refund_platform_url = string8_literal("https://support.google.com/googleplay/workflow/9813244?"),
.refund_support_url = string8_literal("https://getsession.org/android-refund"),
.refund_status_url = string8_literal("https://getsession.org/android-refund"),
.update_subscription_url = string8_literal("https://play.google.com/store/account/subscriptions?package=network.loki.messenger"),
.cancel_subscription_url = string8_literal("https://play.google.com/store/account/subscriptions?package=network.loki.messenger"),
},
/*SESSION_PRO_PAYMENT_PROVIDER_IOS_APP_STORE*/ {
.device = string8_literal("iOS"),
.store = string8_literal("Apple App Store"),
.platform = string8_literal("Apple"),
.platform_account = string8_literal("Apple account"),
.refund_platform_url = string8_literal("https://support.apple.com/118223"),
.refund_support_url = string8_literal("https://support.apple.com/118223"),
.refund_status_url = string8_literal("https://support.apple.com/118224"),
.update_subscription_url = string8_literal("https://apps.apple.com/account/subscriptions"),
.cancel_subscription_url = string8_literal("https://account.apple.com/account/manage/section/subscriptions"),
}
};
// clang-format on
extern const session_pro_backend_payment_provider_metadata
SESSION_PRO_BACKEND_PAYMENT_PROVIDER_METADATA[SESSION_PRO_BACKEND_PAYMENT_PROVIDER_COUNT];

typedef struct session_pro_backend_response_header session_pro_backend_response_header;
struct session_pro_backend_response_header {
Expand Down
29 changes: 1 addition & 28 deletions include/session/session_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,7 @@ struct session_protocol_strings {
string8 url_token;
string8 url_translate;
};

// clang-format off
const session_protocol_strings SESSION_PROTOCOL_STRINGS = {
.build_variant_apk = string8_literal("APK"),
.build_variant_fdroid = string8_literal("F-Droid Store"),
.build_variant_huawei = string8_literal("Huawei App Gallery"),
.build_variant_ipa = string8_literal("IPA"),
.url_donations = string8_literal("https://getsession.org/donate"),
.url_donations_app = string8_literal("https://getsession.org/donate#app"),
.url_download = string8_literal("https://getsession.org/download"),
.url_faq = string8_literal("https://getsession.org/faq"),
.url_feedback = string8_literal("https://getsession.org/feedback"),
.url_network = string8_literal("https://docs.getsession.org/session-network"),
.url_privacy_policy = string8_literal("https://getsession.org/privacy-policy"),
.url_pro_access_not_found = string8_literal("https://sessionapp.zendesk.com/hc/sections/4416517450649-Support"),
.url_pro_faq = string8_literal("https://getsession.org/faq#pro"),
.url_pro_privacy_policy = string8_literal("https://getsession.org/pro/privacy"),
.url_pro_roadmap = string8_literal("https://getsession.org/pro-roadmap"),
.url_pro_support = string8_literal("https://getsession.org/pro-form"),
.url_pro_terms_of_service = string8_literal("https://getsession.org/pro/terms"),
.url_staking = string8_literal("https://docs.getsession.org/session-network/staking"),
.url_support = string8_literal("https://getsession.org/support"),
.url_survey = string8_literal("https://getsession.org/survey"),
.url_terms_of_service = string8_literal("https://getsession.org/terms-of-service"),
.url_token = string8_literal("https://token.getsession.org"),
.url_translate = string8_literal("https://getsession.org/translate"),
};
// clang-format on
extern const session_protocol_strings SESSION_PROTOCOL_STRINGS;

typedef enum SESSION_PROTOCOL_PRO_STATUS { // See session::ProStatus
SESSION_PROTOCOL_PRO_STATUS_NIL,
Expand Down
37 changes: 37 additions & 0 deletions src/pro_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,43 @@
#include <session/sodium_array.hpp>
#include <session/types.hpp>

// clang-format off
const session_pro_backend_payment_provider_metadata SESSION_PRO_BACKEND_PAYMENT_PROVIDER_METADATA[SESSION_PRO_BACKEND_PAYMENT_PROVIDER_COUNT] = {
/*SESSION_PRO_PAYMENT_PROVIDER_NIL*/ {
.device = string8_literal(""),
.store = string8_literal(""),
.platform = string8_literal(""),
.platform_account = string8_literal(""),
.refund_platform_url = string8_literal(""),
.refund_support_url = string8_literal(""),
.refund_status_url = string8_literal(""),
.update_subscription_url = string8_literal(""),
.cancel_subscription_url = string8_literal(""),
},
/*SESSION_PRO_PAYMENT_PROVIDER_GOOGLE_PLAY_STORE*/ {
.device = string8_literal("Android"),
.store = string8_literal("Google Play Store"),
.platform = string8_literal("Google"),
.platform_account = string8_literal("Google account"),
.refund_platform_url = string8_literal("https://support.google.com/googleplay/workflow/9813244?"),
.refund_support_url = string8_literal("https://getsession.org/android-refund"),
.refund_status_url = string8_literal("https://getsession.org/android-refund"),
.update_subscription_url = string8_literal("https://play.google.com/store/account/subscriptions?package=network.loki.messenger"),
.cancel_subscription_url = string8_literal("https://play.google.com/store/account/subscriptions?package=network.loki.messenger"),
},
/*SESSION_PRO_PAYMENT_PROVIDER_IOS_APP_STORE*/ {
.device = string8_literal("iOS"),
.store = string8_literal("Apple App Store"),
.platform = string8_literal("Apple"),
.platform_account = string8_literal("Apple account"),
.refund_platform_url = string8_literal("https://support.apple.com/118223"),
.refund_support_url = string8_literal("https://support.apple.com/118223"),
.refund_status_url = string8_literal("https://support.apple.com/118224"),
.update_subscription_url = string8_literal("https://apps.apple.com/account/subscriptions"),
.cancel_subscription_url = string8_literal("https://account.apple.com/account/manage/section/subscriptions"),
}
};

namespace {
const nlohmann::json json_parse(std::string_view json, std::vector<std::string>& errors) {
nlohmann::json result;
Expand Down
28 changes: 28 additions & 0 deletions src/session_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,34 @@ static_assert(
sizeof(SESSION_PROTOCOL_GET_PRO_DETAILS_HASH_PERSONALISATION) - 1 ==
crypto_generichash_blake2b_PERSONALBYTES);

// clang-format off
const session_protocol_strings SESSION_PROTOCOL_STRINGS = {
.build_variant_apk = string8_literal("APK"),
.build_variant_fdroid = string8_literal("F-Droid Store"),
.build_variant_huawei = string8_literal("Huawei App Gallery"),
.build_variant_ipa = string8_literal("IPA"),
.url_donations = string8_literal("https://getsession.org/donate"),
.url_donations_app = string8_literal("https://getsession.org/donate#app"),
.url_download = string8_literal("https://getsession.org/download"),
.url_faq = string8_literal("https://getsession.org/faq"),
.url_feedback = string8_literal("https://getsession.org/feedback"),
.url_network = string8_literal("https://docs.getsession.org/session-network"),
.url_privacy_policy = string8_literal("https://getsession.org/privacy-policy"),
.url_pro_access_not_found = string8_literal("https://sessionapp.zendesk.com/hc/sections/4416517450649-Support"),
.url_pro_faq = string8_literal("https://getsession.org/faq#pro"),
.url_pro_privacy_policy = string8_literal("https://getsession.org/pro/privacy"),
.url_pro_roadmap = string8_literal("https://getsession.org/pro-roadmap"),
.url_pro_support = string8_literal("https://getsession.org/pro-form"),
.url_pro_terms_of_service = string8_literal("https://getsession.org/pro/terms"),
.url_staking = string8_literal("https://docs.getsession.org/session-network/staking"),
.url_support = string8_literal("https://getsession.org/support"),
.url_survey = string8_literal("https://getsession.org/survey"),
.url_terms_of_service = string8_literal("https://getsession.org/terms-of-service"),
.url_token = string8_literal("https://token.getsession.org"),
.url_translate = string8_literal("https://getsession.org/translate"),
};
// clang-format on

namespace {
session::array_uc32 proof_hash_internal(
std::uint8_t version,
Expand Down