react-native-iap 15.3.4 → 15.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/HybridRnIap.swift +5 -2
- package/lib/module/index.js +42 -61
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/error.js +98 -15
- package/lib/module/utils/error.js.map +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +10 -6
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +59 -5
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/error.d.ts +1 -1
- package/lib/typescript/src/utils/error.d.ts.map +1 -1
- package/nitrogen/generated/android/NitroIap+autolinking.cmake +2 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +14 -0
- package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroRequestPurchaseIos.hpp +11 -5
- package/nitrogen/generated/android/c++/JPurchase.hpp +8 -0
- package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +17 -1
- package/nitrogen/generated/android/c++/JRenewalCommitmentInfoIOS.hpp +75 -0
- package/nitrogen/generated/android/c++/JRenewalInfoIOS.hpp +14 -1
- package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +8 -0
- package/nitrogen/generated/android/c++/JSubscriptionBillingPlanTypeIOS.hpp +61 -0
- package/nitrogen/generated/android/c++/JTransactionCommitmentInfoIOS.hpp +69 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_NitroRequestPurchaseIos.hpp +2 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RenewalCommitmentInfoIOS.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RenewalCommitmentInfoIOS.hpp +74 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_RenewalInfoIOS.hpp +5 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_TransactionCommitmentInfoIOS.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_TransactionCommitmentInfoIOS.hpp +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseIos.kt +6 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +8 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RenewalCommitmentInfoIOS.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RenewalInfoIOS.kt +8 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/SubscriptionBillingPlanTypeIOS.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/TransactionCommitmentInfoIOS.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_RenewalCommitmentInfoIOS.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_TransactionCommitmentInfoIOS.kt +53 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +112 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/swift/NitroRequestPurchaseIos.swift +24 -13
- package/nitrogen/generated/ios/swift/PurchaseIOS.swift +49 -1
- package/nitrogen/generated/ios/swift/RenewalCommitmentInfoIOS.swift +49 -0
- package/nitrogen/generated/ios/swift/RenewalInfoIOS.swift +49 -1
- package/nitrogen/generated/ios/swift/SubscriptionBillingPlanTypeIOS.swift +44 -0
- package/nitrogen/generated/ios/swift/TransactionCommitmentInfoIOS.swift +44 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_RenewalCommitmentInfoIOS.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_TransactionCommitmentInfoIOS.swift +18 -0
- package/nitrogen/generated/shared/c++/NitroRequestPurchaseIos.hpp +12 -5
- package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +15 -1
- package/nitrogen/generated/shared/c++/RenewalCommitmentInfoIOS.hpp +101 -0
- package/nitrogen/generated/shared/c++/RenewalInfoIOS.hpp +15 -2
- package/nitrogen/generated/shared/c++/SubscriptionBillingPlanTypeIOS.hpp +80 -0
- package/nitrogen/generated/shared/c++/TransactionCommitmentInfoIOS.hpp +95 -0
- package/openiap-versions.json +3 -3
- package/package.json +1 -1
- package/src/index.ts +127 -64
- package/src/specs/RnIap.nitro.ts +10 -5
- package/src/types.ts +64 -5
- package/src/utils/error.ts +127 -14
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType_TransactionCommitmentInfoIOS.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
+
* JS type: `null | struct`
|
|
13
|
+
*/
|
|
14
|
+
@frozen
|
|
15
|
+
public indirect enum Variant_NullType_TransactionCommitmentInfoIOS {
|
|
16
|
+
case first(NullType)
|
|
17
|
+
case second(TransactionCommitmentInfoIOS)
|
|
18
|
+
}
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
29
|
#endif
|
|
30
30
|
|
|
31
|
+
// Forward declaration of `SubscriptionBillingPlanTypeIOS` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::iap { enum class SubscriptionBillingPlanTypeIOS; }
|
|
31
33
|
// Forward declaration of `PromotionalOfferJwsInputIOS` to properly resolve imports.
|
|
32
34
|
namespace margelo::nitro::iap { struct PromotionalOfferJwsInputIOS; }
|
|
33
35
|
// Forward declaration of `WinBackOfferInputIOS` to properly resolve imports.
|
|
@@ -38,6 +40,7 @@ namespace margelo::nitro::iap { struct WinBackOfferInputIOS; }
|
|
|
38
40
|
#include <variant>
|
|
39
41
|
#include <optional>
|
|
40
42
|
#include <unordered_map>
|
|
43
|
+
#include "SubscriptionBillingPlanTypeIOS.hpp"
|
|
41
44
|
#include "PromotionalOfferJwsInputIOS.hpp"
|
|
42
45
|
#include "WinBackOfferInputIOS.hpp"
|
|
43
46
|
|
|
@@ -54,13 +57,14 @@ namespace margelo::nitro::iap {
|
|
|
54
57
|
std::optional<std::variant<nitro::NullType, double>> quantity SWIFT_PRIVATE;
|
|
55
58
|
std::optional<std::variant<nitro::NullType, std::unordered_map<std::string, std::string>>> withOffer SWIFT_PRIVATE;
|
|
56
59
|
std::optional<std::variant<nitro::NullType, std::string>> advancedCommerceData SWIFT_PRIVATE;
|
|
57
|
-
std::optional<
|
|
60
|
+
std::optional<SubscriptionBillingPlanTypeIOS> billingPlanType SWIFT_PRIVATE;
|
|
61
|
+
std::optional<std::variant<nitro::NullType, std::string>> compactJWS SWIFT_PRIVATE;
|
|
58
62
|
std::optional<std::variant<nitro::NullType, PromotionalOfferJwsInputIOS>> promotionalOfferJWS SWIFT_PRIVATE;
|
|
59
63
|
std::optional<std::variant<nitro::NullType, WinBackOfferInputIOS>> winBackOffer SWIFT_PRIVATE;
|
|
60
64
|
|
|
61
65
|
public:
|
|
62
66
|
NitroRequestPurchaseIos() = default;
|
|
63
|
-
explicit NitroRequestPurchaseIos(std::string sku, std::optional<std::variant<nitro::NullType, bool>> andDangerouslyFinishTransactionAutomatically, std::optional<std::variant<nitro::NullType, std::string>> appAccountToken, std::optional<std::variant<nitro::NullType, double>> quantity, std::optional<std::variant<nitro::NullType, std::unordered_map<std::string, std::string>>> withOffer, std::optional<std::variant<nitro::NullType, std::string>> advancedCommerceData, std::optional<std::variant<nitro::NullType,
|
|
67
|
+
explicit NitroRequestPurchaseIos(std::string sku, std::optional<std::variant<nitro::NullType, bool>> andDangerouslyFinishTransactionAutomatically, std::optional<std::variant<nitro::NullType, std::string>> appAccountToken, std::optional<std::variant<nitro::NullType, double>> quantity, std::optional<std::variant<nitro::NullType, std::unordered_map<std::string, std::string>>> withOffer, std::optional<std::variant<nitro::NullType, std::string>> advancedCommerceData, std::optional<SubscriptionBillingPlanTypeIOS> billingPlanType, std::optional<std::variant<nitro::NullType, std::string>> compactJWS, std::optional<std::variant<nitro::NullType, PromotionalOfferJwsInputIOS>> promotionalOfferJWS, std::optional<std::variant<nitro::NullType, WinBackOfferInputIOS>> winBackOffer): sku(sku), andDangerouslyFinishTransactionAutomatically(andDangerouslyFinishTransactionAutomatically), appAccountToken(appAccountToken), quantity(quantity), withOffer(withOffer), advancedCommerceData(advancedCommerceData), billingPlanType(billingPlanType), compactJWS(compactJWS), promotionalOfferJWS(promotionalOfferJWS), winBackOffer(winBackOffer) {}
|
|
64
68
|
|
|
65
69
|
public:
|
|
66
70
|
friend bool operator==(const NitroRequestPurchaseIos& lhs, const NitroRequestPurchaseIos& rhs) = default;
|
|
@@ -82,7 +86,8 @@ namespace margelo::nitro {
|
|
|
82
86
|
JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "quantity"))),
|
|
83
87
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::unordered_map<std::string, std::string>>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "withOffer"))),
|
|
84
88
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "advancedCommerceData"))),
|
|
85
|
-
JSIConverter<std::optional<
|
|
89
|
+
JSIConverter<std::optional<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingPlanType"))),
|
|
90
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "compactJWS"))),
|
|
86
91
|
JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::PromotionalOfferJwsInputIOS>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "promotionalOfferJWS"))),
|
|
87
92
|
JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::WinBackOfferInputIOS>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "winBackOffer")))
|
|
88
93
|
);
|
|
@@ -95,7 +100,8 @@ namespace margelo::nitro {
|
|
|
95
100
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "quantity"), JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::toJSI(runtime, arg.quantity));
|
|
96
101
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "withOffer"), JSIConverter<std::optional<std::variant<nitro::NullType, std::unordered_map<std::string, std::string>>>>::toJSI(runtime, arg.withOffer));
|
|
97
102
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "advancedCommerceData"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.advancedCommerceData));
|
|
98
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "
|
|
103
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "billingPlanType"), JSIConverter<std::optional<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>>::toJSI(runtime, arg.billingPlanType));
|
|
104
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "compactJWS"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.compactJWS));
|
|
99
105
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "promotionalOfferJWS"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::PromotionalOfferJwsInputIOS>>>::toJSI(runtime, arg.promotionalOfferJWS));
|
|
100
106
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "winBackOffer"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::WinBackOfferInputIOS>>>::toJSI(runtime, arg.winBackOffer));
|
|
101
107
|
return obj;
|
|
@@ -114,7 +120,8 @@ namespace margelo::nitro {
|
|
|
114
120
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "quantity")))) return false;
|
|
115
121
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::unordered_map<std::string, std::string>>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "withOffer")))) return false;
|
|
116
122
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "advancedCommerceData")))) return false;
|
|
117
|
-
if (!JSIConverter<std::optional<
|
|
123
|
+
if (!JSIConverter<std::optional<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingPlanType")))) return false;
|
|
124
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "compactJWS")))) return false;
|
|
118
125
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::PromotionalOfferJwsInputIOS>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "promotionalOfferJWS")))) return false;
|
|
119
126
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::WinBackOfferInputIOS>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "winBackOffer")))) return false;
|
|
120
127
|
return true;
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
|
|
31
31
|
// Forward declaration of `AdvancedCommerceInfoIOS` to properly resolve imports.
|
|
32
32
|
namespace margelo::nitro::iap { struct AdvancedCommerceInfoIOS; }
|
|
33
|
+
// Forward declaration of `SubscriptionBillingPlanTypeIOS` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::iap { enum class SubscriptionBillingPlanTypeIOS; }
|
|
35
|
+
// Forward declaration of `TransactionCommitmentInfoIOS` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::iap { struct TransactionCommitmentInfoIOS; }
|
|
33
37
|
// Forward declaration of `PurchaseOfferIOS` to properly resolve imports.
|
|
34
38
|
namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
|
|
35
39
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
@@ -46,6 +50,8 @@ namespace margelo::nitro::iap { enum class IapStore; }
|
|
|
46
50
|
#include <variant>
|
|
47
51
|
#include <optional>
|
|
48
52
|
#include <string>
|
|
53
|
+
#include "SubscriptionBillingPlanTypeIOS.hpp"
|
|
54
|
+
#include "TransactionCommitmentInfoIOS.hpp"
|
|
49
55
|
#include <vector>
|
|
50
56
|
#include "PurchaseOfferIOS.hpp"
|
|
51
57
|
#include "IapPlatform.hpp"
|
|
@@ -63,6 +69,8 @@ namespace margelo::nitro::iap {
|
|
|
63
69
|
std::optional<std::variant<nitro::NullType, AdvancedCommerceInfoIOS>> advancedCommerceInfoIOS SWIFT_PRIVATE;
|
|
64
70
|
std::optional<std::variant<nitro::NullType, std::string>> appAccountToken SWIFT_PRIVATE;
|
|
65
71
|
std::optional<std::variant<nitro::NullType, std::string>> appBundleIdIOS SWIFT_PRIVATE;
|
|
72
|
+
std::optional<SubscriptionBillingPlanTypeIOS> billingPlanTypeIOS SWIFT_PRIVATE;
|
|
73
|
+
std::optional<std::variant<nitro::NullType, TransactionCommitmentInfoIOS>> commitmentInfoIOS SWIFT_PRIVATE;
|
|
66
74
|
std::optional<std::variant<nitro::NullType, std::string>> countryCodeIOS SWIFT_PRIVATE;
|
|
67
75
|
std::optional<std::variant<nitro::NullType, std::string>> currencyCodeIOS SWIFT_PRIVATE;
|
|
68
76
|
std::optional<std::variant<nitro::NullType, std::string>> currencySymbolIOS SWIFT_PRIVATE;
|
|
@@ -98,7 +106,7 @@ namespace margelo::nitro::iap {
|
|
|
98
106
|
|
|
99
107
|
public:
|
|
100
108
|
PurchaseIOS() = default;
|
|
101
|
-
explicit PurchaseIOS(std::optional<std::variant<nitro::NullType, AdvancedCommerceInfoIOS>> advancedCommerceInfoIOS, std::optional<std::variant<nitro::NullType, std::string>> appAccountToken, std::optional<std::variant<nitro::NullType, std::string>> appBundleIdIOS, std::optional<std::variant<nitro::NullType, std::string>> countryCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> currencyCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> currencySymbolIOS, std::optional<std::variant<nitro::NullType, std::string>> currentPlanId, std::optional<std::variant<nitro::NullType, std::string>> environmentIOS, std::optional<std::variant<nitro::NullType, double>> expirationDateIOS, std::string id, std::optional<std::variant<nitro::NullType, std::vector<std::string>>> ids, bool isAutoRenewing, std::optional<std::variant<nitro::NullType, bool>> isUpgradedIOS, std::optional<std::variant<nitro::NullType, PurchaseOfferIOS>> offerIOS, std::optional<std::variant<nitro::NullType, double>> originalTransactionDateIOS, std::optional<std::variant<nitro::NullType, std::string>> originalTransactionIdentifierIOS, std::optional<std::variant<nitro::NullType, std::string>> ownershipTypeIOS, IapPlatform platform, std::string productId, PurchaseState purchaseState, std::optional<std::variant<nitro::NullType, std::string>> purchaseToken, double quantity, std::optional<std::variant<nitro::NullType, double>> quantityIOS, std::optional<std::variant<nitro::NullType, std::string>> reasonIOS, std::optional<std::variant<nitro::NullType, std::string>> reasonStringRepresentationIOS, std::optional<std::variant<nitro::NullType, RenewalInfoIOS>> renewalInfoIOS, std::optional<std::variant<nitro::NullType, double>> revocationDateIOS, std::optional<std::variant<nitro::NullType, std::string>> revocationReasonIOS, IapStore store, std::optional<std::variant<nitro::NullType, std::string>> storefrontCountryCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> subscriptionGroupIdIOS, double transactionDate, std::string transactionId, std::optional<std::variant<nitro::NullType, std::string>> transactionReasonIOS, std::optional<std::variant<nitro::NullType, std::string>> webOrderLineItemIdIOS): advancedCommerceInfoIOS(advancedCommerceInfoIOS), appAccountToken(appAccountToken), appBundleIdIOS(appBundleIdIOS), countryCodeIOS(countryCodeIOS), currencyCodeIOS(currencyCodeIOS), currencySymbolIOS(currencySymbolIOS), currentPlanId(currentPlanId), environmentIOS(environmentIOS), expirationDateIOS(expirationDateIOS), id(id), ids(ids), isAutoRenewing(isAutoRenewing), isUpgradedIOS(isUpgradedIOS), offerIOS(offerIOS), originalTransactionDateIOS(originalTransactionDateIOS), originalTransactionIdentifierIOS(originalTransactionIdentifierIOS), ownershipTypeIOS(ownershipTypeIOS), platform(platform), productId(productId), purchaseState(purchaseState), purchaseToken(purchaseToken), quantity(quantity), quantityIOS(quantityIOS), reasonIOS(reasonIOS), reasonStringRepresentationIOS(reasonStringRepresentationIOS), renewalInfoIOS(renewalInfoIOS), revocationDateIOS(revocationDateIOS), revocationReasonIOS(revocationReasonIOS), store(store), storefrontCountryCodeIOS(storefrontCountryCodeIOS), subscriptionGroupIdIOS(subscriptionGroupIdIOS), transactionDate(transactionDate), transactionId(transactionId), transactionReasonIOS(transactionReasonIOS), webOrderLineItemIdIOS(webOrderLineItemIdIOS) {}
|
|
109
|
+
explicit PurchaseIOS(std::optional<std::variant<nitro::NullType, AdvancedCommerceInfoIOS>> advancedCommerceInfoIOS, std::optional<std::variant<nitro::NullType, std::string>> appAccountToken, std::optional<std::variant<nitro::NullType, std::string>> appBundleIdIOS, std::optional<SubscriptionBillingPlanTypeIOS> billingPlanTypeIOS, std::optional<std::variant<nitro::NullType, TransactionCommitmentInfoIOS>> commitmentInfoIOS, std::optional<std::variant<nitro::NullType, std::string>> countryCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> currencyCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> currencySymbolIOS, std::optional<std::variant<nitro::NullType, std::string>> currentPlanId, std::optional<std::variant<nitro::NullType, std::string>> environmentIOS, std::optional<std::variant<nitro::NullType, double>> expirationDateIOS, std::string id, std::optional<std::variant<nitro::NullType, std::vector<std::string>>> ids, bool isAutoRenewing, std::optional<std::variant<nitro::NullType, bool>> isUpgradedIOS, std::optional<std::variant<nitro::NullType, PurchaseOfferIOS>> offerIOS, std::optional<std::variant<nitro::NullType, double>> originalTransactionDateIOS, std::optional<std::variant<nitro::NullType, std::string>> originalTransactionIdentifierIOS, std::optional<std::variant<nitro::NullType, std::string>> ownershipTypeIOS, IapPlatform platform, std::string productId, PurchaseState purchaseState, std::optional<std::variant<nitro::NullType, std::string>> purchaseToken, double quantity, std::optional<std::variant<nitro::NullType, double>> quantityIOS, std::optional<std::variant<nitro::NullType, std::string>> reasonIOS, std::optional<std::variant<nitro::NullType, std::string>> reasonStringRepresentationIOS, std::optional<std::variant<nitro::NullType, RenewalInfoIOS>> renewalInfoIOS, std::optional<std::variant<nitro::NullType, double>> revocationDateIOS, std::optional<std::variant<nitro::NullType, std::string>> revocationReasonIOS, IapStore store, std::optional<std::variant<nitro::NullType, std::string>> storefrontCountryCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> subscriptionGroupIdIOS, double transactionDate, std::string transactionId, std::optional<std::variant<nitro::NullType, std::string>> transactionReasonIOS, std::optional<std::variant<nitro::NullType, std::string>> webOrderLineItemIdIOS): advancedCommerceInfoIOS(advancedCommerceInfoIOS), appAccountToken(appAccountToken), appBundleIdIOS(appBundleIdIOS), billingPlanTypeIOS(billingPlanTypeIOS), commitmentInfoIOS(commitmentInfoIOS), countryCodeIOS(countryCodeIOS), currencyCodeIOS(currencyCodeIOS), currencySymbolIOS(currencySymbolIOS), currentPlanId(currentPlanId), environmentIOS(environmentIOS), expirationDateIOS(expirationDateIOS), id(id), ids(ids), isAutoRenewing(isAutoRenewing), isUpgradedIOS(isUpgradedIOS), offerIOS(offerIOS), originalTransactionDateIOS(originalTransactionDateIOS), originalTransactionIdentifierIOS(originalTransactionIdentifierIOS), ownershipTypeIOS(ownershipTypeIOS), platform(platform), productId(productId), purchaseState(purchaseState), purchaseToken(purchaseToken), quantity(quantity), quantityIOS(quantityIOS), reasonIOS(reasonIOS), reasonStringRepresentationIOS(reasonStringRepresentationIOS), renewalInfoIOS(renewalInfoIOS), revocationDateIOS(revocationDateIOS), revocationReasonIOS(revocationReasonIOS), store(store), storefrontCountryCodeIOS(storefrontCountryCodeIOS), subscriptionGroupIdIOS(subscriptionGroupIdIOS), transactionDate(transactionDate), transactionId(transactionId), transactionReasonIOS(transactionReasonIOS), webOrderLineItemIdIOS(webOrderLineItemIdIOS) {}
|
|
102
110
|
|
|
103
111
|
public:
|
|
104
112
|
friend bool operator==(const PurchaseIOS& lhs, const PurchaseIOS& rhs) = default;
|
|
@@ -117,6 +125,8 @@ namespace margelo::nitro {
|
|
|
117
125
|
JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::AdvancedCommerceInfoIOS>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "advancedCommerceInfoIOS"))),
|
|
118
126
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appAccountToken"))),
|
|
119
127
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appBundleIdIOS"))),
|
|
128
|
+
JSIConverter<std::optional<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingPlanTypeIOS"))),
|
|
129
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::TransactionCommitmentInfoIOS>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentInfoIOS"))),
|
|
120
130
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "countryCodeIOS"))),
|
|
121
131
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currencyCodeIOS"))),
|
|
122
132
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currencySymbolIOS"))),
|
|
@@ -156,6 +166,8 @@ namespace margelo::nitro {
|
|
|
156
166
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "advancedCommerceInfoIOS"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::AdvancedCommerceInfoIOS>>>::toJSI(runtime, arg.advancedCommerceInfoIOS));
|
|
157
167
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "appAccountToken"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.appAccountToken));
|
|
158
168
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "appBundleIdIOS"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.appBundleIdIOS));
|
|
169
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "billingPlanTypeIOS"), JSIConverter<std::optional<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>>::toJSI(runtime, arg.billingPlanTypeIOS));
|
|
170
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "commitmentInfoIOS"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::TransactionCommitmentInfoIOS>>>::toJSI(runtime, arg.commitmentInfoIOS));
|
|
159
171
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "countryCodeIOS"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.countryCodeIOS));
|
|
160
172
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "currencyCodeIOS"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.currencyCodeIOS));
|
|
161
173
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "currencySymbolIOS"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.currencySymbolIOS));
|
|
@@ -201,6 +213,8 @@ namespace margelo::nitro {
|
|
|
201
213
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::AdvancedCommerceInfoIOS>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "advancedCommerceInfoIOS")))) return false;
|
|
202
214
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appAccountToken")))) return false;
|
|
203
215
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appBundleIdIOS")))) return false;
|
|
216
|
+
if (!JSIConverter<std::optional<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingPlanTypeIOS")))) return false;
|
|
217
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::TransactionCommitmentInfoIOS>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentInfoIOS")))) return false;
|
|
204
218
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "countryCodeIOS")))) return false;
|
|
205
219
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currencyCodeIOS")))) return false;
|
|
206
220
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "currencySymbolIOS")))) return false;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RenewalCommitmentInfoIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `SubscriptionBillingPlanTypeIOS` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::iap { enum class SubscriptionBillingPlanTypeIOS; }
|
|
33
|
+
|
|
34
|
+
#include <string>
|
|
35
|
+
#include "SubscriptionBillingPlanTypeIOS.hpp"
|
|
36
|
+
|
|
37
|
+
namespace margelo::nitro::iap {
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A struct which can be represented as a JavaScript object (RenewalCommitmentInfoIOS).
|
|
41
|
+
*/
|
|
42
|
+
struct RenewalCommitmentInfoIOS final {
|
|
43
|
+
public:
|
|
44
|
+
std::string commitmentAutoRenewProductId SWIFT_PRIVATE;
|
|
45
|
+
bool commitmentAutoRenewStatus SWIFT_PRIVATE;
|
|
46
|
+
SubscriptionBillingPlanTypeIOS commitmentRenewalBillingPlanType SWIFT_PRIVATE;
|
|
47
|
+
double commitmentRenewalDate SWIFT_PRIVATE;
|
|
48
|
+
double commitmentRenewalPrice SWIFT_PRIVATE;
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
RenewalCommitmentInfoIOS() = default;
|
|
52
|
+
explicit RenewalCommitmentInfoIOS(std::string commitmentAutoRenewProductId, bool commitmentAutoRenewStatus, SubscriptionBillingPlanTypeIOS commitmentRenewalBillingPlanType, double commitmentRenewalDate, double commitmentRenewalPrice): commitmentAutoRenewProductId(commitmentAutoRenewProductId), commitmentAutoRenewStatus(commitmentAutoRenewStatus), commitmentRenewalBillingPlanType(commitmentRenewalBillingPlanType), commitmentRenewalDate(commitmentRenewalDate), commitmentRenewalPrice(commitmentRenewalPrice) {}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
friend bool operator==(const RenewalCommitmentInfoIOS& lhs, const RenewalCommitmentInfoIOS& rhs) = default;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::iap
|
|
59
|
+
|
|
60
|
+
namespace margelo::nitro {
|
|
61
|
+
|
|
62
|
+
// C++ RenewalCommitmentInfoIOS <> JS RenewalCommitmentInfoIOS (object)
|
|
63
|
+
template <>
|
|
64
|
+
struct JSIConverter<margelo::nitro::iap::RenewalCommitmentInfoIOS> final {
|
|
65
|
+
static inline margelo::nitro::iap::RenewalCommitmentInfoIOS fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
+
return margelo::nitro::iap::RenewalCommitmentInfoIOS(
|
|
68
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentAutoRenewProductId"))),
|
|
69
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentAutoRenewStatus"))),
|
|
70
|
+
JSIConverter<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentRenewalBillingPlanType"))),
|
|
71
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentRenewalDate"))),
|
|
72
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentRenewalPrice")))
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::RenewalCommitmentInfoIOS& arg) {
|
|
76
|
+
jsi::Object obj(runtime);
|
|
77
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "commitmentAutoRenewProductId"), JSIConverter<std::string>::toJSI(runtime, arg.commitmentAutoRenewProductId));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "commitmentAutoRenewStatus"), JSIConverter<bool>::toJSI(runtime, arg.commitmentAutoRenewStatus));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "commitmentRenewalBillingPlanType"), JSIConverter<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>::toJSI(runtime, arg.commitmentRenewalBillingPlanType));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "commitmentRenewalDate"), JSIConverter<double>::toJSI(runtime, arg.commitmentRenewalDate));
|
|
81
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "commitmentRenewalPrice"), JSIConverter<double>::toJSI(runtime, arg.commitmentRenewalPrice));
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
85
|
+
if (!value.isObject()) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
jsi::Object obj = value.getObject(runtime);
|
|
89
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentAutoRenewProductId")))) return false;
|
|
93
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentAutoRenewStatus")))) return false;
|
|
94
|
+
if (!JSIConverter<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentRenewalBillingPlanType")))) return false;
|
|
95
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentRenewalDate")))) return false;
|
|
96
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentRenewalPrice")))) return false;
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
} // namespace margelo::nitro
|
|
@@ -28,12 +28,17 @@
|
|
|
28
28
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
29
|
#endif
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
// Forward declaration of `RenewalCommitmentInfoIOS` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::iap { struct RenewalCommitmentInfoIOS; }
|
|
33
|
+
// Forward declaration of `SubscriptionBillingPlanTypeIOS` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::iap { enum class SubscriptionBillingPlanTypeIOS; }
|
|
32
35
|
|
|
33
36
|
#include <NitroModules/Null.hpp>
|
|
34
37
|
#include <string>
|
|
35
38
|
#include <variant>
|
|
36
39
|
#include <optional>
|
|
40
|
+
#include "RenewalCommitmentInfoIOS.hpp"
|
|
41
|
+
#include "SubscriptionBillingPlanTypeIOS.hpp"
|
|
37
42
|
|
|
38
43
|
namespace margelo::nitro::iap {
|
|
39
44
|
|
|
@@ -43,12 +48,14 @@ namespace margelo::nitro::iap {
|
|
|
43
48
|
struct RenewalInfoIOS final {
|
|
44
49
|
public:
|
|
45
50
|
std::optional<std::variant<nitro::NullType, std::string>> autoRenewPreference SWIFT_PRIVATE;
|
|
51
|
+
std::optional<std::variant<nitro::NullType, RenewalCommitmentInfoIOS>> commitmentInfo SWIFT_PRIVATE;
|
|
46
52
|
std::optional<std::variant<nitro::NullType, std::string>> expirationReason SWIFT_PRIVATE;
|
|
47
53
|
std::optional<std::variant<nitro::NullType, double>> gracePeriodExpirationDate SWIFT_PRIVATE;
|
|
48
54
|
std::optional<std::variant<nitro::NullType, bool>> isInBillingRetry SWIFT_PRIVATE;
|
|
49
55
|
std::optional<std::variant<nitro::NullType, std::string>> jsonRepresentation SWIFT_PRIVATE;
|
|
50
56
|
std::optional<std::variant<nitro::NullType, std::string>> pendingUpgradeProductId SWIFT_PRIVATE;
|
|
51
57
|
std::optional<std::variant<nitro::NullType, std::string>> priceIncreaseStatus SWIFT_PRIVATE;
|
|
58
|
+
std::optional<SubscriptionBillingPlanTypeIOS> renewalBillingPlanType SWIFT_PRIVATE;
|
|
52
59
|
std::optional<std::variant<nitro::NullType, double>> renewalDate SWIFT_PRIVATE;
|
|
53
60
|
std::optional<std::variant<nitro::NullType, std::string>> renewalOfferId SWIFT_PRIVATE;
|
|
54
61
|
std::optional<std::variant<nitro::NullType, std::string>> renewalOfferType SWIFT_PRIVATE;
|
|
@@ -56,7 +63,7 @@ namespace margelo::nitro::iap {
|
|
|
56
63
|
|
|
57
64
|
public:
|
|
58
65
|
RenewalInfoIOS() = default;
|
|
59
|
-
explicit RenewalInfoIOS(std::optional<std::variant<nitro::NullType, std::string>> autoRenewPreference, std::optional<std::variant<nitro::NullType, std::string>> expirationReason, std::optional<std::variant<nitro::NullType, double>> gracePeriodExpirationDate, std::optional<std::variant<nitro::NullType, bool>> isInBillingRetry, std::optional<std::variant<nitro::NullType, std::string>> jsonRepresentation, std::optional<std::variant<nitro::NullType, std::string>> pendingUpgradeProductId, std::optional<std::variant<nitro::NullType, std::string>> priceIncreaseStatus, std::optional<std::variant<nitro::NullType, double>> renewalDate, std::optional<std::variant<nitro::NullType, std::string>> renewalOfferId, std::optional<std::variant<nitro::NullType, std::string>> renewalOfferType, bool willAutoRenew): autoRenewPreference(autoRenewPreference), expirationReason(expirationReason), gracePeriodExpirationDate(gracePeriodExpirationDate), isInBillingRetry(isInBillingRetry), jsonRepresentation(jsonRepresentation), pendingUpgradeProductId(pendingUpgradeProductId), priceIncreaseStatus(priceIncreaseStatus), renewalDate(renewalDate), renewalOfferId(renewalOfferId), renewalOfferType(renewalOfferType), willAutoRenew(willAutoRenew) {}
|
|
66
|
+
explicit RenewalInfoIOS(std::optional<std::variant<nitro::NullType, std::string>> autoRenewPreference, std::optional<std::variant<nitro::NullType, RenewalCommitmentInfoIOS>> commitmentInfo, std::optional<std::variant<nitro::NullType, std::string>> expirationReason, std::optional<std::variant<nitro::NullType, double>> gracePeriodExpirationDate, std::optional<std::variant<nitro::NullType, bool>> isInBillingRetry, std::optional<std::variant<nitro::NullType, std::string>> jsonRepresentation, std::optional<std::variant<nitro::NullType, std::string>> pendingUpgradeProductId, std::optional<std::variant<nitro::NullType, std::string>> priceIncreaseStatus, std::optional<SubscriptionBillingPlanTypeIOS> renewalBillingPlanType, std::optional<std::variant<nitro::NullType, double>> renewalDate, std::optional<std::variant<nitro::NullType, std::string>> renewalOfferId, std::optional<std::variant<nitro::NullType, std::string>> renewalOfferType, bool willAutoRenew): autoRenewPreference(autoRenewPreference), commitmentInfo(commitmentInfo), expirationReason(expirationReason), gracePeriodExpirationDate(gracePeriodExpirationDate), isInBillingRetry(isInBillingRetry), jsonRepresentation(jsonRepresentation), pendingUpgradeProductId(pendingUpgradeProductId), priceIncreaseStatus(priceIncreaseStatus), renewalBillingPlanType(renewalBillingPlanType), renewalDate(renewalDate), renewalOfferId(renewalOfferId), renewalOfferType(renewalOfferType), willAutoRenew(willAutoRenew) {}
|
|
60
67
|
|
|
61
68
|
public:
|
|
62
69
|
friend bool operator==(const RenewalInfoIOS& lhs, const RenewalInfoIOS& rhs) = default;
|
|
@@ -73,12 +80,14 @@ namespace margelo::nitro {
|
|
|
73
80
|
jsi::Object obj = arg.asObject(runtime);
|
|
74
81
|
return margelo::nitro::iap::RenewalInfoIOS(
|
|
75
82
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoRenewPreference"))),
|
|
83
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::RenewalCommitmentInfoIOS>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentInfo"))),
|
|
76
84
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expirationReason"))),
|
|
77
85
|
JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "gracePeriodExpirationDate"))),
|
|
78
86
|
JSIConverter<std::optional<std::variant<nitro::NullType, bool>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isInBillingRetry"))),
|
|
79
87
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "jsonRepresentation"))),
|
|
80
88
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pendingUpgradeProductId"))),
|
|
81
89
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "priceIncreaseStatus"))),
|
|
90
|
+
JSIConverter<std::optional<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "renewalBillingPlanType"))),
|
|
82
91
|
JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "renewalDate"))),
|
|
83
92
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "renewalOfferId"))),
|
|
84
93
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "renewalOfferType"))),
|
|
@@ -88,12 +97,14 @@ namespace margelo::nitro {
|
|
|
88
97
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::RenewalInfoIOS& arg) {
|
|
89
98
|
jsi::Object obj(runtime);
|
|
90
99
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "autoRenewPreference"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.autoRenewPreference));
|
|
100
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "commitmentInfo"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::RenewalCommitmentInfoIOS>>>::toJSI(runtime, arg.commitmentInfo));
|
|
91
101
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "expirationReason"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.expirationReason));
|
|
92
102
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "gracePeriodExpirationDate"), JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::toJSI(runtime, arg.gracePeriodExpirationDate));
|
|
93
103
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "isInBillingRetry"), JSIConverter<std::optional<std::variant<nitro::NullType, bool>>>::toJSI(runtime, arg.isInBillingRetry));
|
|
94
104
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "jsonRepresentation"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.jsonRepresentation));
|
|
95
105
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pendingUpgradeProductId"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.pendingUpgradeProductId));
|
|
96
106
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "priceIncreaseStatus"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.priceIncreaseStatus));
|
|
107
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "renewalBillingPlanType"), JSIConverter<std::optional<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>>::toJSI(runtime, arg.renewalBillingPlanType));
|
|
97
108
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "renewalDate"), JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::toJSI(runtime, arg.renewalDate));
|
|
98
109
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "renewalOfferId"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.renewalOfferId));
|
|
99
110
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "renewalOfferType"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.renewalOfferType));
|
|
@@ -109,12 +120,14 @@ namespace margelo::nitro {
|
|
|
109
120
|
return false;
|
|
110
121
|
}
|
|
111
122
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoRenewPreference")))) return false;
|
|
123
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::RenewalCommitmentInfoIOS>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentInfo")))) return false;
|
|
112
124
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "expirationReason")))) return false;
|
|
113
125
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "gracePeriodExpirationDate")))) return false;
|
|
114
126
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, bool>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isInBillingRetry")))) return false;
|
|
115
127
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "jsonRepresentation")))) return false;
|
|
116
128
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pendingUpgradeProductId")))) return false;
|
|
117
129
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "priceIncreaseStatus")))) return false;
|
|
130
|
+
if (!JSIConverter<std::optional<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "renewalBillingPlanType")))) return false;
|
|
118
131
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "renewalDate")))) return false;
|
|
119
132
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "renewalOfferId")))) return false;
|
|
120
133
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "renewalOfferType")))) return false;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SubscriptionBillingPlanTypeIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::iap {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (SubscriptionBillingPlanTypeIOS).
|
|
30
|
+
*/
|
|
31
|
+
enum class SubscriptionBillingPlanTypeIOS {
|
|
32
|
+
UNKNOWN SWIFT_NAME(unknown) = 0,
|
|
33
|
+
MONTHLY SWIFT_NAME(monthly) = 1,
|
|
34
|
+
UP_FRONT SWIFT_NAME(upFront) = 2,
|
|
35
|
+
} CLOSED_ENUM;
|
|
36
|
+
|
|
37
|
+
} // namespace margelo::nitro::iap
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro {
|
|
40
|
+
|
|
41
|
+
// C++ SubscriptionBillingPlanTypeIOS <> JS SubscriptionBillingPlanTypeIOS (union)
|
|
42
|
+
template <>
|
|
43
|
+
struct JSIConverter<margelo::nitro::iap::SubscriptionBillingPlanTypeIOS> final {
|
|
44
|
+
static inline margelo::nitro::iap::SubscriptionBillingPlanTypeIOS fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
45
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
46
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
47
|
+
case hashString("unknown"): return margelo::nitro::iap::SubscriptionBillingPlanTypeIOS::UNKNOWN;
|
|
48
|
+
case hashString("monthly"): return margelo::nitro::iap::SubscriptionBillingPlanTypeIOS::MONTHLY;
|
|
49
|
+
case hashString("up-front"): return margelo::nitro::iap::SubscriptionBillingPlanTypeIOS::UP_FRONT;
|
|
50
|
+
default: [[unlikely]]
|
|
51
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum SubscriptionBillingPlanTypeIOS - invalid value!");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::iap::SubscriptionBillingPlanTypeIOS arg) {
|
|
55
|
+
switch (arg) {
|
|
56
|
+
case margelo::nitro::iap::SubscriptionBillingPlanTypeIOS::UNKNOWN: return JSIConverter<std::string>::toJSI(runtime, "unknown");
|
|
57
|
+
case margelo::nitro::iap::SubscriptionBillingPlanTypeIOS::MONTHLY: return JSIConverter<std::string>::toJSI(runtime, "monthly");
|
|
58
|
+
case margelo::nitro::iap::SubscriptionBillingPlanTypeIOS::UP_FRONT: return JSIConverter<std::string>::toJSI(runtime, "up-front");
|
|
59
|
+
default: [[unlikely]]
|
|
60
|
+
throw std::invalid_argument("Cannot convert SubscriptionBillingPlanTypeIOS to JS - invalid value: "
|
|
61
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isString()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
69
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
70
|
+
case hashString("unknown"):
|
|
71
|
+
case hashString("monthly"):
|
|
72
|
+
case hashString("up-front"):
|
|
73
|
+
return true;
|
|
74
|
+
default:
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TransactionCommitmentInfoIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::iap {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (TransactionCommitmentInfoIOS).
|
|
39
|
+
*/
|
|
40
|
+
struct TransactionCommitmentInfoIOS final {
|
|
41
|
+
public:
|
|
42
|
+
double billingPeriodNumber SWIFT_PRIVATE;
|
|
43
|
+
double commitmentExpiresDate SWIFT_PRIVATE;
|
|
44
|
+
double commitmentPrice SWIFT_PRIVATE;
|
|
45
|
+
double totalBillingPeriods SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
TransactionCommitmentInfoIOS() = default;
|
|
49
|
+
explicit TransactionCommitmentInfoIOS(double billingPeriodNumber, double commitmentExpiresDate, double commitmentPrice, double totalBillingPeriods): billingPeriodNumber(billingPeriodNumber), commitmentExpiresDate(commitmentExpiresDate), commitmentPrice(commitmentPrice), totalBillingPeriods(totalBillingPeriods) {}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
friend bool operator==(const TransactionCommitmentInfoIOS& lhs, const TransactionCommitmentInfoIOS& rhs) = default;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace margelo::nitro::iap
|
|
56
|
+
|
|
57
|
+
namespace margelo::nitro {
|
|
58
|
+
|
|
59
|
+
// C++ TransactionCommitmentInfoIOS <> JS TransactionCommitmentInfoIOS (object)
|
|
60
|
+
template <>
|
|
61
|
+
struct JSIConverter<margelo::nitro::iap::TransactionCommitmentInfoIOS> final {
|
|
62
|
+
static inline margelo::nitro::iap::TransactionCommitmentInfoIOS fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
+
return margelo::nitro::iap::TransactionCommitmentInfoIOS(
|
|
65
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingPeriodNumber"))),
|
|
66
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentExpiresDate"))),
|
|
67
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentPrice"))),
|
|
68
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "totalBillingPeriods")))
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::TransactionCommitmentInfoIOS& arg) {
|
|
72
|
+
jsi::Object obj(runtime);
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "billingPeriodNumber"), JSIConverter<double>::toJSI(runtime, arg.billingPeriodNumber));
|
|
74
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "commitmentExpiresDate"), JSIConverter<double>::toJSI(runtime, arg.commitmentExpiresDate));
|
|
75
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "commitmentPrice"), JSIConverter<double>::toJSI(runtime, arg.commitmentPrice));
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "totalBillingPeriods"), JSIConverter<double>::toJSI(runtime, arg.totalBillingPeriods));
|
|
77
|
+
return obj;
|
|
78
|
+
}
|
|
79
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
80
|
+
if (!value.isObject()) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
jsi::Object obj = value.getObject(runtime);
|
|
84
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "billingPeriodNumber")))) return false;
|
|
88
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentExpiresDate")))) return false;
|
|
89
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "commitmentPrice")))) return false;
|
|
90
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "totalBillingPeriods")))) return false;
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
} // namespace margelo::nitro
|
package/openiap-versions.json
CHANGED
package/package.json
CHANGED