@capgo/native-purchases 6.0.25 → 6.0.27
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.
|
@@ -246,17 +246,20 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
246
246
|
Number quantity = call.getInt("quantity", 1);
|
|
247
247
|
// cannot use quantity, because it's done in native modal
|
|
248
248
|
Log.d("CapacitorPurchases", "purchaseProduct: " + productIdentifier);
|
|
249
|
-
if (productIdentifier.isEmpty()) {
|
|
249
|
+
if (productIdentifier == null || productIdentifier.isEmpty()) {
|
|
250
250
|
// Handle error: productIdentifier is empty
|
|
251
251
|
call.reject("productIdentifier is empty");
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
|
-
if (productType.isEmpty()) {
|
|
254
|
+
if (productType == null || productType.isEmpty()) {
|
|
255
255
|
// Handle error: productType is empty
|
|
256
256
|
call.reject("productType is empty");
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
|
-
if (
|
|
259
|
+
if (
|
|
260
|
+
productType.equals("subs") &&
|
|
261
|
+
(planIdentifier == null || planIdentifier.isEmpty())
|
|
262
|
+
) {
|
|
260
263
|
// Handle error: no planIdentifier with productType subs
|
|
261
264
|
call.reject("planIdentifier cannot be empty if productType is subs");
|
|
262
265
|
return;
|