Skip to content

Commit

Permalink
Add play purchasing models
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-mullvad authored and Pururun committed Oct 12, 2023
1 parent f0064d0 commit 841c0c6
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package net.mullvad.mullvadvpn.model

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

@Parcelize data class PlayPurchase(val productId: String, val purchaseToken: String) : Parcelable
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package net.mullvad.mullvadvpn.model

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

@Parcelize
enum class PlayPurchaseInitError : Parcelable {
// TODO: Add more errors here.
OtherError
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.mullvad.mullvadvpn.model

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

sealed class PlayPurchaseInitResult : Parcelable {
@Parcelize data class Ok(val transactionId: String) : PlayPurchaseInitResult()

@Parcelize
data class Error(val error: PlayPurchaseInitError) :
PlayPurchaseInitResult()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package net.mullvad.mullvadvpn.model

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

@Parcelize
enum class PlayPurchaseVerifyError : Parcelable {
// TODO: Add more errors here.
OtherError
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.mullvad.mullvadvpn.model

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

sealed class PlayPurchaseVerifyResult : Parcelable {
@Parcelize data object Ok : PlayPurchaseVerifyResult()

@Parcelize
data class Error(val error: PlayPurchaseVerifyError) : PlayPurchaseVerifyResult()
}
5 changes: 5 additions & 0 deletions mullvad-jni/src/classes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ pub const CLASSES: &[&str] = &[
"net/mullvad/mullvadvpn/model/LocationConstraint$Location",
"net/mullvad/mullvadvpn/model/LocationConstraint$CustomList",
"net/mullvad/mullvadvpn/model/ObfuscationSettings",
"net/mullvad/mullvadvpn/model/PlayPurchase",
"net/mullvad/mullvadvpn/model/PlayPurchaseInitError",
"net/mullvad/mullvadvpn/model/PlayPurchaseInitResult",
"net/mullvad/mullvadvpn/model/PlayPurchaseVerifyError",
"net/mullvad/mullvadvpn/model/PlayPurchaseVerifyResult",
"net/mullvad/mullvadvpn/model/PublicKey",
"net/mullvad/mullvadvpn/model/QuantumResistantState",
"net/mullvad/mullvadvpn/model/Port",
Expand Down

0 comments on commit 841c0c6

Please sign in to comment.