Giter VIP home page Giter VIP logo

chargebee-react-native's People

Contributors

cb-amutha avatar cb-anurags avatar cb-bharathvaj avatar cb-dinesh avatar cb-haripriyan avatar cb-harishbharadwaj avatar cb-imayaselvan avatar cb-pravinrajmohan avatar cb-prem avatar cb-seenivasan avatar cb-sriramthiagarajan avatar cb-vinay avatar dependabot[bot] avatar lovubuntu avatar zhulduz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chargebee-react-native's Issues

Getting an error while retrieving all product identifiers

Error: Invalid catalog version
at Object.promiseMethodWrapper [as retrieveProductIdentifiers] (NativeModules.js:105:51)
at Function. (Chargebee.ts:68:33)
at Generator.next ()
at asyncGeneratorStep (asyncToGenerator.js:3:16)
at _next (asyncToGenerator.js:25:9)
at asyncToGenerator.js:32:7
at tryCallTwo (core.js:45:5)
at doResolve (core.js:200:13)
at new Promise (core.js:66:3)
at Function. (asyncToGenerator.js:21:12)

following is the code:
const queryParams = new Map();
queryParams.set("limit", "1");
try {
const result = await Chargebee.retrieveProductIdentifiers(queryParams);
console.log(result);
} catch (error) {
console.log(error);
}

'ChargebeeReactNative-Swift.h' file not found

Hi, I added "@chargebee/react-native-chargebee": "^2.4.5" to my project and now all builds fail with the the following error:

node_modules/@chargebee/react-native-chargebee/ios/ChargebeeReactNative.mm:2:9)

1 | #import "ChargebeeReactNative.h"

2 | #import <ChargebeeReactNative-Swift.h>
| ^ 'ChargebeeReactNative-Swift.h' file not found
3 |
4 | @implementation ChargebeeReactNative
5 | RCT_EXPORT_MODULE()
The following build commands failed:
โ–ธ CompileC /Users/expo/Library/Developer/Xcode/DerivedData/Tallio-bbielmlrqyffaodyqcvcjhdlhgly/Build/Intermediates.noindex/ArchiveIntermediates/Tallio/IntermediateBuildFilesPath/Pods.build/Debug-iphoneos/ChargebeeReactNative.build/Objects-normal/arm64/ChargebeeReactNative.o /Users/expo/workingdir/build/node_modules/@chargebee/react-native-chargebee/ios/ChargebeeReactNative.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'ChargebeeReactNative' from project 'Pods')
โ–ธ (1 failure)
** ARCHIVE FAILED **
The following build commands failed:
CompileC /Users/expo/Library/Developer/Xcode/DerivedData/Tallio-bbielmlrqyffaodyqcvcjhdlhgly/Build/Intermediates.noindex/ArchiveIntermediates/Tallio/IntermediateBuildFilesPath/Pods.build/Debug-iphoneos/ChargebeeReactNative.build/Objects-normal/arm64/ChargebeeReactNative.o /Users/expo/workingdir/build/node_modules/@chargebee/react-native-chargebee/ios/ChargebeeReactNative.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'ChargebeeReactNative' from project 'Pods')
(1 failure)

Adding @chargebee/react-native-chargebee to a new project doesn't cause and failed builds, so I am wondering if this has to do with another library that I imported for my project. One of the other libraries I am using (@react-native-firebase/app) uses static frameworks. Here is the implementation instructions from that package:

Open the file ./ios/Podfile and add this line inside your targets (right before the use_react_native line in current react-native releases that calls the react native Podfile function to get the native modules config):

use_frameworks! :linkage => :static
To use Static Frameworks on iOS, you also need to manually enable this for the project with the following global to your /ios/Podfile file:

right after use_frameworks! :linkage => :static

$RNFirebaseAsStaticFramework = true

Would static frameworks be causing the compatibility issues? If not, have you ran into this problem in any other scenarios?

I can not retrieve products even though i can retrieve the product identifiers

I have an issue retrieving products on my iOS platform even though I can retrieve their identifiers.
this is how i fetch the product identifiers and i get them back:
const fetchProductsIdentifiers = async () => {
const queryParams = new Map();
queryParams.set("limit", "10");
try {
const result = await Chargebee.retrieveProductIdentifiers(queryParams);
console.log("product identifiers:", result);
} catch (error) {
console.log("Error when fetching product identifiers", error);
console.log(
"=========================",
Platform.OS,
"========================="
);
}
};

but when i call the fetchProducts api with the array returned from the endpoint, i get an [Error: Products not found.]
const fetchProducts = async () => {
try {
const productList = await Chargebee.retrieveProducts([
"Gold_999_1m",
"Silver_199_1m",
"Gold_999_1y",
"Half_yearly_plan_1",
"Yearly_plan_1",
"Monthly_plan_1",
"Weekly_plan_1",
"Daily_plan_1",
]);
setProductIds(productList);
console.log("products:", productList);
} catch (error) {
console.log("Error when fetching product", error);
console.log(
"=========================",
Platform.OS,
"========================="
);
}
};

I have the products i have called all setup on app store connect
So I don't know what might be wrong.

restorePurchases doesn't work

Hi guys, I found out that in 2.4.4 version API restorePurchases doesn't work,
I also tried an example with own config credentials.

Could you please try also, maybe something missing in docs.

Chargebee.retrieveProductIdentifiers crash even within try-catch block

Chargebee.retrieveProducts with specific identifiers work perfectly, but Chargebee.retrieveProductIdentifiers crashes even in try-catch block with message "Signal 6 was raised".

 const test = async () => {
    try {
      console.log('>>>>>test>>>> configure')
      await Chargebee.configure({
        site: 'secret',
        publishableApiKey: 'secret',
        androidSdkKey: 'secret',
        iOsSdkKey: 'secret',
      })
      console.log('>>>>>test>>>> configure done')
      console.log('>>>>>test>>>> start')
      const results = await Chargebee.retrieveProductIdentifiers({
        limit: 10,
      })
      // const results = await Chargebee.retrieveProducts(['specific_product_id']) // working
      console.log('>>>>>test>>>> end', results)
    } catch (err) {
      console.log('>>>test err', err)
    }
  }

IMG_81549959FE9F-1

Environment:
iPhone Xs
iOS 16.6
React Native 0.72.7

Get a `Product Family` field in retrieveSubscriptions API

Hello guys,
I am curious it is possible to get Product Family Chargebee.retrieveSubscriptions end-point?

It would be great to identify on each platform whether the subscription is from appstore/googlestore?

or maybe extra provide filter query for retrieveSubscriptions with platform field.

Error with Using ChargeBee API's 2.0

Initially, I was using 1 Version APIs to fetch and Subscribe, I haven't faced any issues, but now I am Using 2 Version APIs to fetch the response and Tried to implement it with @chargebee/Chargebee-react-native. I am facing the error as
Error :
"Subscription with New Item Model cannot be created using this Endpoint, Please use create a subscription with item endpoint to create subscription "

Screenshot at Jul 14 18-53-58

Attaching Screenshot for Ref: :
https://lh6.googleusercontent.com/hbin13_kfMjYCveOVgAwpswJmGGsq11unmhdSkPhSSlwou0Ei44AJKxXnmRQERuxlwaV_gn2ReU7F9dKzKJONL_HbnrkvRfHVSMRvfe9VBEWkuc_D8eNrNEF9mYJ-lJtDqL_L3yx-Vis1_WnBfzJf-w3pUydOj6x5b4FYJ9mBBB8DgjRzllDaEdQ4ltMo9-co9Z3HZOMRNSx=w319-h639

<CheckoutCart success={(hostedPageId: string) => successfulPurchase(hostedPageId)} step={(stepName: string) => handleStep(stepName)} site={site} // site Name planName={name} // Plan Name planId={id}. // I am Passing plan Id />

  • Attaching Postman Response screenshot.
  • Thanks in Advance.
    Screenshot at Jul 14 18-35-08

Issue with TypeScript Purchases and OneTime Purchase

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch @chargebee/[email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@chargebee/react-native-chargebee/lib/typescript/Purchases.d.ts b/node_modules/@chargebee/react-native-chargebee/lib/typescript/Purchases.d.ts
index 06a1e22..407a0e0 100644
--- a/node_modules/@chargebee/react-native-chargebee/lib/typescript/Purchases.d.ts
+++ b/node_modules/@chargebee/react-native-chargebee/lib/typescript/Purchases.d.ts
@@ -24,9 +24,9 @@ export interface Purchase {
     readonly status: string;
 }
 export interface OneTimePurchase {
-    readonly invoiceId: string;
-    readonly chargeId: string;
-    readonly customerId: string;
+    readonly invoice_id: string;
+    readonly charge_id: string;
+    readonly customer_id: string;
 }
 export declare enum ProductType {
     UNKNOWN = "unknown",
diff --git a/node_modules/@chargebee/react-native-chargebee/src/Purchases.ts b/node_modules/@chargebee/react-native-chargebee/src/Purchases.ts
index 4c339d2..e10bfe5 100644
--- a/node_modules/@chargebee/react-native-chargebee/src/Purchases.ts
+++ b/node_modules/@chargebee/react-native-chargebee/src/Purchases.ts
@@ -30,9 +30,9 @@ export interface Purchase {
 }
 
 export interface OneTimePurchase {
-  readonly invoiceId: string;
-  readonly chargeId: string;
-  readonly customerId: string;
+  readonly invoice_id: string;
+  readonly charge_id: string;
+  readonly customer_id: string;
 }
 
 export enum ProductType {

This issue body was partially generated by patch-package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.