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
2 changes: 1 addition & 1 deletion RevenueCat/Scripts/Offering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public override string ToString()
{
return $"{nameof(Identifier)}: {Identifier}\n" +
$"{nameof(ServerDescription)}: {ServerDescription}\n" +
$"{nameof(AvailablePackages)}: {AvailablePackages}\n" +
$"{nameof(AvailablePackages)}: {string.Join(", ", AvailablePackages)}\n" +
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just printing that it was an array, not printing the content

$"{nameof(Metadata)}: {DictToString(Metadata)}\n" +
$"{nameof(Lifetime)}: {Lifetime}\n" +
$"{nameof(Annual)}: {Annual}\n" +
Expand Down
71 changes: 66 additions & 5 deletions RevenueCat/Scripts/StoreProduct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,83 @@ public partial class Purchases
/// </summary>
public class StoreProduct
{
/// <summary>
/// Title of the product.
/// </summary>
/// <returns></returns>
public readonly string Title;

/// <summary>
/// Product Id.
/// </summary>
/// <returns></returns>
public readonly string Identifier;

/// <summary>
/// Description of the product.
/// </summary>
/// <returns></returns>
public readonly string Description;

/// <summary>
/// Price of the product in the local currency.
/// Contains the price value of DefaultOption for Google Play.
/// </summary>
/// <returns></returns>
public readonly float Price;

/// <summary>
/// Formatted price of the item, including its currency sign.
/// Contains the formatted price value of DefaultOption for Google Play.
/// </summary>
/// <returns></returns>
public readonly string PriceString;

/// <summary>
/// Currency code for price and original price.
/// Contains the currency code of DefaultOption for Google Play.
/// </summary>
/// <returns></returns>
[CanBeNull] public readonly string CurrencyCode;

/// <summary>
/// Introductory price of the product. Null if no introductory price is available.
/// It contains the free trial if available and user is eligible for it.
/// Otherwise, it contains the introductory price of the product if the user is eligible for it.
/// This will be null for non-subscription products.
/// </summary>
/// <returns></returns>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This docs will make sense after RevenueCat/purchases-hybrid-common#952

public IntroductoryPrice IntroductoryPrice;

/// <summary>
/// Product category of the product.
/// </summary>
/// <returns></returns>
[CanBeNull] public readonly ProductCategory ProductCategory;

/// <summary>
/// Default subscription option for a product. Google Play only.
/// </summary>
/// <returns></returns>
[CanBeNull] public readonly SubscriptionOption DefaultOption;

/// <summary>
/// Collection of subscription options for a product. Google Play only.
/// </summary>
/// <returns></returns>
[CanBeNull] public readonly SubscriptionOption[] SubscriptionOptions;

/// <summary>
/// Offering context this package belongs to.
/// Null if not using offerings or if fetched directly from store via GetProducts.
/// </summary>
[CanBeNull] public readonly PresentedOfferingContext PresentedOfferingContext;

[Obsolete("Deprecated, use PresentedOfferingContext instead.", false)]
[CanBeNull] public readonly string PresentedOfferingIdentifier;

/// <summary>
/// Collection of iOS promotional offers for a product. Null for Android.
/// Collection of iOS promotional offers for a product. Null for Android and Amazon.
/// </summary>
/// <returns></returns>
[CanBeNull] public readonly Discount[] Discounts;
Expand Down Expand Up @@ -111,11 +171,12 @@ public override string ToString()
$"{nameof(Price)}: {Price}\n" +
$"{nameof(PriceString)}: {PriceString}\n" +
$"{nameof(CurrencyCode)}: {CurrencyCode}\n" +
$"{nameof(ProductCategory)}: {ProductCategory}\n" +
$"{nameof(ProductCategory)}: {ProductCategory}\n" +
$"{nameof(PresentedOfferingIdentifier)}: {PresentedOfferingIdentifier}\n" +
$"{DefaultOption}\n" +
$"{SubscriptionOptions}\n" +
$"{IntroductoryPrice}\n" +
$"{nameof(PresentedOfferingContext)}: {PresentedOfferingContext}\n" +
$"{nameof(DefaultOption)}: {DefaultOption}\n" +
$"{nameof(SubscriptionOptions)}: {SubscriptionOptions}\n" +
$"{nameof(IntroductoryPrice)}: {IntroductoryPrice}\n" +
$"{nameof(Discounts)}: {Discounts}\n" +
$"{nameof(SubscriptionPeriod)}: {SubscriptionPeriod}";
}
Expand Down