Git Product home page Git Product logo

cashfree / react-native-cashfree-pg-sdk Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 11.0 2.31 MB

Sample app demonstrating integration of Cashfree's payment gateway in your React native project

Home Page: https://docs.cashfree.com/docs/react-native-integration

License: MIT License

Shell 0.17% Java 23.63% JavaScript 24.16% TypeScript 22.66% Objective-C 3.93% Swift 20.68% Ruby 3.42% Objective-C++ 1.34%
bnpl card cardless-emi cashfree emi net-banking payment-gateway payment-integration payments upi

react-native-cashfree-pg-sdk's Introduction

react-native-cashfree-pg-sdk

GitHub Discord GitHub last commit (branch) GitHub release (with filter) npm GitHub forks GitHub Repo stars

The Cashfree React Native SDK allows you to integrate Cashfree Payment Gateway into your application and start collecting payments from your customers. The React Native SDK has been designed to minimise the complexity of handling and integrating payments in your React Native project.

Click here for more Documentation.

Installation

npm install react-native-cashfree-pg-sdk

iOS

Add the following code to application's info.plist file.

<key>LSApplicationCategoryType</key>
<string></string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>phonepe</string>
<string>tez</string>
<string>paytm</string>
<string>bhim</string>
</array>

Usage

import {
  CFCallback,
  CFErrorResponse,
  CFPaymentGatewayService,
} from 'react-native-cashfree-pg-sdk';
import {
  CFDropCheckoutPayment,
  CFEnvironment,
  CFSession,
  CFThemeBuilder,
} from 'cashfree-pg-api-contract';

// ...

try {
  const session = new CFSession(
    'order_token',
    'order_id',
    CFEnvironment.SANDBOX
  );
  const theme = new CFThemeBuilder()
    .setNavigationBarBackgroundColor('#E64A19')
    .setNavigationBarTextColor('#FFFFFF')
    .setButtonBackgroundColor('#FFC107')
    .setButtonTextColor('#FFFFFF')
    .setPrimaryTextColor('#212121')
    .setSecondaryTextColor('#757575')
    .build();
  const dropPayment = new CFDropCheckoutPayment(session, null, theme);
  CFPaymentGatewayService.doPayment(dropPayment);
} catch (e: any) {
  console.log(e.message);
}

Contributing

If you want to contribute please read the Contributing guidelines.

License

The Cashfree React Native SDK is licensed under the MIT License.
See the LICENSE file distributed with this work for additional
information regarding copyright ownership.

Except as contained in the LICENSE file, the name(s) of the above copyright
holders shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written authorization.

react-native-cashfree-pg-sdk's People

Contributors

aabhasr1 avatar arjun-cashfree avatar kishan-cashfree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-cashfree-pg-sdk's Issues

Android release build failed

  • What went wrong:
    Execution failed for task ':react-native-cashfree-pg-sdk:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
Android resource linking failed
ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:3: AAPT: error: resource android:color/system_neutral1_1000 not found.

 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:4: AAPT: error: resource android:color/system_neutral1_900 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:5: AAPT: error: resource android:color/system_neutral1_0 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:6: AAPT: error: resource android:color/system_neutral1_800 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:7: AAPT: error: resource android:color/system_neutral1_700 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:8: AAPT: error: resource android:color/system_neutral1_600 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:9: AAPT: error: resource android:color/system_neutral1_500 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:10: AAPT: error: resource android:color/system_neutral1_400 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:11: AAPT: error: resource android:color/system_neutral1_300 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:12: AAPT: error: resource android:color/system_neutral1_200 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:13: AAPT: error: resource android:color/system_neutral1_100 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:14: AAPT: error: resource android:color/system_neutral1_50 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:15: AAPT: error: resource android:color/system_neutral1_10 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:16: AAPT: error: resource android:color/system_neutral2_1000 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:17: AAPT: error: resource android:color/system_neutral2_900 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:18: AAPT: error: resource android:color/system_neutral2_0 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:19: AAPT: error: resource android:color/system_neutral2_800 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:20: AAPT: error: resource android:color/system_neutral2_700 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:21: AAPT: error: resource android:color/system_neutral2_600 not found.
     
 ERROR:/Users/Desktop/All/Projects/node_modules/react-native-cashfree-pg-sdk/android/build/intermediates/merged_res/release/values-v31/values-v31.xml:22: AAPT: error: resource android:color/system_neutral2_500 not found.

Here is the all dependencies of package.json file

"dependencies": {
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-clipboard/clipboard": "^1.11.1",
"@react-navigation/bottom-tabs": "^6.5.7",
"@react-navigation/native": "^6.0.13",
"@react-navigation/native-stack": "^6.9.0",
"axios": "^0.27.2",
"cashfree-pg-api-contract": "^2.0.1",
"class-transformer": "^0.5.1",
"formik": "^2.2.9",
"i18next": "^21.10.0",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
"lottie-react-native": "^5.1.5",
"mobx": "^6.6.2",
"mobx-react": "^7.5.3",
"moment": "^2.29.4",
"react": "18.1.0",
"react-i18next": "^11.18.6",
"react-native": "^0.70.1",
"react-native-base64": "^0.2.1",
"react-native-blob-util": "^0.17.3",
"react-native-cashfree-pg-sdk": "^2.0.7",
"react-native-circular-progress-indicator": "^4.4.2",
"react-native-curved-bottom-bar": "^3.2.2",
"react-native-fast-image": "^8.6.1",
"react-native-flash-message": "^0.4.0",
"react-native-floating-label-input": "^1.4.2",
"react-native-gesture-handler": "^2.9.0",
"react-native-gifted-charts": "^1.2.42",
"react-native-image-crop-picker": "^0.38.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-linear-gradient": "^2.6.2",
"react-native-modalize": "^2.1.1",
"react-native-orientation-locker": "^1.5.0",
"react-native-otp-inputs": "^7.4.0",
"react-native-outside-press": "^1.1.0",
"react-native-pdf": "^6.6.2",
"react-native-permissions": "^3.6.1",
"react-native-portalize": "^1.0.7",
"react-native-reanimated": "^2.15.0",
"react-native-reanimated-carousel": "^3.0.6",
"react-native-render-html": "^6.3.4",
"react-native-responsive-screen": "^1.4.2",
"react-native-safe-area-context": "^4.4.1",
"react-native-screens": "^3.17.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "^13.9.0",
"react-native-toast-message": "^2.1.5",
"react-native-vector-icons": "^9.2.0",
"react-native-video": "^5.2.1",
"react-native-video-controls": "^2.8.1",
"react-native-video-player": "^0.14.0",
"react-native-webview": "^12.0.1",
"yarn": "^1.22.19",
"yup": "^1.0.2"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.72.1",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "18.1.0"
},

Can't downgrade database from version 2 to 1 after upgrading to react-native-cashfree-pg-sdk: "2.1.7", cashfree-pg-api-contract: "^2.0.5"

I updated cashfree versions to
"cashfree-pg-api-contract": "^2.0.5",
"react-native-cashfree-pg-sdk": "2.1.7",

after this my app was installing first time and afterwards when opening, app crashing with following error

android.database.sqlite.SQLiteException: Can't downgrade database from version 2 to 1
android.database.sqlite.SQLiteOpenHelper.onDowngrade(SQLiteOpenHelper.java:640)
android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:512)
android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:437)
com.cashfree.pg.analytics.database.CFDatabaseService.lambda$checkIfPaymentsPresent$3$CFDatabaseService(Unknown Source:2)
com.cashfree.pg.analytics.database.-$$Lambda$CFDatabaseService$DscKZq0oUzPPdCcoRl_XPVTLWpg.run(Unknown Source:4)

detox testing build issue to this react-native-cashfree-pg-sdk

Task failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-cashfree-pg-sdk:processDebugAndroidTestManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [com.facebook.react:react-android:0.71.10] C:\Users\userName\ .gradle\caches\transforms-3\7c3a4a2f910d9373e61e00a8f2b2185e\transformed\jetified-react-android-0.71.10-debug\AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures)

Swift Compiler Error in iOS while archiving

Getting Swift Compiler Error in Xcode while archiving, although build works fine in debug.
Cannot find type 'CFPaymentGatewayService' in scope

Please find the below configurations that I am using
"react-native-cashfree-pg-sdk": "1.0.2",
"react-native": "0.63.3"

Please check the attached screenshot.

Screenshot 2022-12-13 at 1 33 07 PM

IOS app crash while doing payment

try {
const session = new CFSession(
res?.data?.payment_session_id,
res?.data?.order_id,
CFEnvironment.PRODUCTION
);
CFPaymentGatewayService.doWebPayment(JSON.stringify(session));
after this above method .doWebPayment my app crashed without any logs*
CFPaymentGatewayService.setCallback({
onVerify(res) {
addDataIntoFirebase(res, amount);
},
onError(error) {
toastWithIcon(Transaction Failed!);
setLoading2(false);
},
});

Payment components are either not enabled or not applicable for this order

CFPaymentGatewayService.doPayment() throws error following exception:

{"status":"ERROR","message":"Payment components are either not enabled or not applicable for this order","code":"payment_failed","type":"request_failed"}
Screenshot 2022-11-25 at 12 25 12

Same code used to work couple of days ago. Is there any change in the API?
This is a blocker for us. Kindly advise, what needs to be done to avoid this error.

Thank you

payment_session_id is not present or is invalid

I am able to create order successfully. and getting intialing payment checkout but getting error after entering card detail and pressing pay button

### exception is : {"status":"FAILED","message":"payment_session_id is not present or is invalid","code":"payment_session_id_invalid","type":"request_failed"}

const headers = {
     'Content-Type': 'application/json',
     'x-client-id': CASH_FREE.API_KEY,
     'x-client-secret': CASH_FREE.SECREAT_KEY,
     'x-api-version': '2021-05-21',
   };
   configureBaseURL(URLS.CASHFREE_BASE_URL);
   try {
     const order = await cashFreeServices.createCashFreeOrder(params, headers);
     console.log('order', order);
     const session = new CFSession(order.order_token, order.order_id, CFEnvironment.SANDBOX);
     const paymentModes = new CFPaymentComponentBuilder()
       .add(CFPaymentModes.CARD)
       .add(CFPaymentModes.UPI)
       .add(CFPaymentModes.NB)
       .add(CFPaymentModes.WALLET)
       .add(CFPaymentModes.PAY_LATER)
       .build();
     const theme = new CFThemeBuilder()
       .setNavigationBarBackgroundColor('#E64A19')
       .setNavigationBarTextColor('#FFFFFF')
       .setButtonBackgroundColor('#FFC107')
       .setButtonTextColor('#FFFFFF')
       .setPrimaryTextColor('#212121')
       .setSecondaryTextColor('#757575')
       .build();
     const dropPayment = new CFDropCheckoutPayment(session, paymentModes, theme);
     console.log(JSON.stringify(dropPayment));
     CFPaymentGatewayService.doPayment(dropPayment);

something went wrong, Request_failed

Screenshot 2024-01-19 at 5 52 49 PM

after some time loading, i get this repsonse :

LOG errorString :{"status":"FAILED","message":"something went wrong","code":"payment_failed","type":"request_failed"}
LOG errorStringObject :[object Object]
LOG exception is : {"status":"FAILED","message":"something went wrong","code":"payment_failed","type":"request_failed"}
orderId is :ONERP-ORD-0000000064
LOG UPDATE STATUS : {"status":"FAILED","message":"something went wrong","code":"payment_failed","type":"request_failed"}

SQL Injection security issue (EXTERNAL DATA IN SQL QUERIES) CFDatabaseHelper

Team,
We are facing a SQL Injection security issue (EXTERNAL DATA IN SQL QUERIES) in the following code which is present in CFDatabaseHelper.class , is there any way to update this code to overcome this.

public void onCreate(SQLiteDatabase db) {
    db.execSQL("create table PAYMENT_EVENT(_id TEXT PRIMARY KEY, environment TEXT NOT NULL, app_id TEXT NOT NULL, sdk_version TEXT NOT NULL, release_version TEXT NOT NULL, source TEXT NOT NULL, request_id TEXT NOT NULL, contexts TEXT NOT NULL, timestamp INTEGER NOT NULL);");
    db.execSQL("create table USER_EVENT(_id TEXT NOT NULL, name TEXT NOT NULL, network_type TEXT NOT NULL, free_ram TEXT NOT NULL, extra_params TEXT , timestamp INTEGER NOT NULL);");
    db.execSQL("create table USER_EXCEPTION(_id TEXT NOT NULL, exception_level TEXT NOT NULL, exception_culprit TEXT NOT NULL, exception_values TEXT NOT NULL, timestamp INTEGER NOT NULL);");
}

public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    db.execSQL(this.dropTableQuery("PAYMENT_EVENT"));
    db.execSQL(this.dropTableQuery("USER_EVENT"));
    db.execSQL(this.dropTableQuery("USER_EXCEPTION"));
    db.execSQL("create table PAYMENT_EVENT(_id TEXT PRIMARY KEY, environment TEXT NOT NULL, app_id TEXT NOT NULL, sdk_version TEXT NOT NULL, release_version TEXT NOT NULL, source TEXT NOT NULL, request_id TEXT NOT NULL, contexts TEXT NOT NULL, timestamp INTEGER NOT NULL);");
    db.execSQL("create table USER_EVENT(_id TEXT NOT NULL, name TEXT NOT NULL, network_type TEXT NOT NULL, free_ram TEXT NOT NULL, extra_params TEXT , timestamp INTEGER NOT NULL);");
    db.execSQL("create table USER_EXCEPTION(_id TEXT NOT NULL, exception_level TEXT NOT NULL, exception_culprit TEXT NOT NULL, exception_values TEXT NOT NULL, timestamp INTEGER NOT NULL);");
}

Not able to run the Repo

Error: The package 'react-native-cashfree-pg-api' doesn't seem to be linked. Make sure:

  • You rebuilt the app after installing the package
  • You are not using Expo managed workflow

This error is located at:
in NavigationContainer (at App.tsx:225)
in RCTView (at SafeAreaView.js:40)
in SafeAreaView (at App.tsx:224)
in EnsureSingleNavigator (at BaseNavigationContainer.tsx:411)
in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91)
in ThemeProvider (at NavigationContainer.tsx:90)
in ForwardRef(NavigationContainer) (at App.tsx:223)
in App (at renderApplication.js:40)
in RCTView (at AppContainer.js:101)
Screenshot 2022-12-19 at 1 51 59 PM

in RCTView (at AppContainer.js:119)

Android Build Issue RN 0.72

After I upgraded the React Native version to 0.72 I am getting this error while building Android project.

Screenshot 2023-06-23 at 12 43 14 PM

Error: Cannot find module '../package.json' from 'node_modules/react-native-cashfree-pg-sdk/lib/commonjs/index.js'

Bug foung inside node_modules\react-native-cashfree-pg-sdk\lib\commonjs\index.js. You are trying to import package.json file:
image
Here it is clearly checking the package.json file in lib where as the package.js is provided in react-native-cashfree-pg-sdk folder. Due to this we are facing the issue.

Lib Folder Contents:
image
This clearly doesnot contain the package.json file

react-native-cashfree-pg-sdk Contents:

image
This folder contains the package.json file.

Solution to solve the problem: Changing the path for acquiring package.json in index.js will solve this issue (or) copying the package.json from react-native-cashfree-pg-sdk and pasting it into lib folder.

Cashfree-react-native-sdk not working after recent "create-order" api update

Official documentation of react-native sdk integration cashfree is not updated yet according to new changes. So the payment is failing in our end. Order is creating successfully but after passing payment session id to sdk payment fails.

Error:
reason: "{"error":"{\"status\":\"FAILED\",\"message\":\"api Request Failed\",\"code\":\"request_failed\",\"type\":\"api_error\"}","orderID":"7a1a39e0a1c94ff6aff7139ac941f8b2"}"
CFErrorResponse.ts:11
errorString :{"status":"FAILED","message":"api Request Failed","code":"request_failed","type":"api_error"}

Android build error

Could not find a declaration file for module 'react-native-cashfree-pg-sdk'. '/Users/sagar/Desktop/consulting_2.0/node_modules/react-native-cashfree-pg-sdk/lib/commonjs/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/react-native-cashfree-pg-sdkif it exists or add a new declaration (.d.ts) file containingdeclare module 'react-native-cashfree-pg-sdk';ts(7016)

I am getting this error while trying to build for android. Kindly provide a solution.

payments working in emulator but failing in Real device

reason: "{"error":"{\"status\":\"FAILED\",\"message\":\"com.packagename is not trusted. App should be installed from app store.\",\"code\":\"android_package_not_approved\",\"type\":\"feature_not_enabled\"}","orderID":"xxxxxxx"}"

App package name is already approoved .

function doWebPayment(JSON.stringify(session)) is working fine but when we are doPayment(dropPayment) , It is showing the above error

Module CashfreePgApi requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`

I am getting the following error when using Cashfree SDK with ios:

Module CashfreePgApi requires main queue setup since it overrides init but doesn't implement requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of

  • Environment: Development.
  • React Version: 18.0.0
  • React-Native Version: ^0.67.2
  • react-native-cashfree-pg-sdk Version: 1.0.1
  • Tested on iOS Simulator

Here is the full dependency list:

"dependencies": {
"@hookstate/core": "^3.0.13",
"@react-native-clipboard/clipboard": "^1.10.0",
"@react-native-community/blur": "^3.6.0",
"@react-native-community/geolocation": "^2.1.0",
"@react-navigation/bottom-tabs": "^6.2.0",
"@react-navigation/devtools": "^6.0.8",
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.5.2",
"@sentry/react-native": "^4.1.3",
"@types/react-native-global-props": "^1.1.1",
"axios": "^0.27.2",
"core-js": "^3.6.5",
"form-data": "^4.0.0",
"lodash": "^4.17.21",
"node-libs-react-native": "^1.2.1",
"phosphor-react-native": "^1.1.1",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "^0.67.2",
"react-native-camera": "^4.2.1",
"react-native-cashfree-pg-sdk": "^1.0.1",
"react-native-chart-kit": "^6.12.0",
"react-native-contacts": "^7.0.4",
"react-native-date-picker": "^4.2.2",
"react-native-draggable-flatlist": "^3.1.2",
"react-native-gesture-handler": "^2.5.0",
"react-native-global-font": "^1.0.3",
"react-native-global-props": "^1.1.5",
"react-native-image-picker": "^4.8.4",
"react-native-maps": "^0.31.1",
"react-native-paper": "^4.12.0",
"react-native-permissions": "^3.3.1",
"react-native-qrcode-scanner": "^1.5.5",
"react-native-reanimated": "^2.9.1",
"react-native-safe-area-context": "^4.2.4",
"react-native-screens": "^3.13.1",
"react-native-shadow-2": "^6.0.4",
"react-qr-code": "^2.0.7",
"react-query": "^3.39.0",
"react-router-dom": "^6.3.0",
"regenerator-runtime": "0.13.7",
"simple-socket-client": "github:Subhrajyotimodak/Simple-Socket-Client",
"tslib": "^2.0.0",
"url-search-params-polyfill": "^8.1.1"
},
"devDependencies": {
"@nrwl/cli": "13.9.5",
"@nrwl/detox": "13.9.5",
"@nrwl/eslint-plugin-nx": "13.9.5",
"@nrwl/jest": "13.9.5",
"@nrwl/linter": "13.9.5",
"@nrwl/react": "13.9.5",
"@nrwl/react-native": "13.9.5",
"@nrwl/web": "13.9.5",
"@nrwl/workspace": "13.9.5",
"@react-native-async-storage/async-storage": "1.16.1",
"@react-native-community/cli": "7.0.1",
"@react-native-community/cli-platform-android": "7.0.1",
"@react-native-community/cli-platform-ios": "7.0.1",
"@swc/core": "~1.2.143",
"@testing-library/jest-dom": "5.16.2",
"@testing-library/jest-native": "4.0.4",
"@testing-library/react": "12.1.4",
"@testing-library/react-hooks": "7.0.2",
"@testing-library/react-native": "9.0.0",
"@types/jest": "27.0.2",
"@types/lodash": "^4.14.182",
"@types/node": "^16.11.34",
"@types/react": "18.0.0",
"@types/react-dom": "18.0.0",
"@types/react-native": "0.67.2",
"@typescript-eslint/eslint-plugin": "~5.10.0",
"@typescript-eslint/parser": "~5.10.0",
"babel-jest": "27.2.3",
"detox": "19.5.1",
"eslint": "~8.7.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "^7.29.3",
"eslint-plugin-react-hooks": "4.3.0",
"jest": "27.2.3",
"jest-circus": "27.2.3",
"jest-react-native": "18.0.0",
"metro": "0.69.0",
"metro-react-native-babel-preset": "0.69.0",
"metro-resolver": "0.69.0",
"nx": "13.9.5",
"prettier": "^2.5.1",
"react-native-config": "1.4.5",
"react-native-flipper": "^0.155.0",
"react-native-svg": "12.3.0",
"react-native-svg-transformer": "1.0.0",
"react-test-renderer": "17.0.2",
"swc-loader": "0.1.15",
"ts-jest": "27.0.5",
"ts-transformer-keys": "^0.4.3",
"typescript": "~4.5.2"
}

Package name not enabled or approved

Hello, we are using react-native-cashfree-pg-sdk 2.0.2 for payment. It works fine in staging, However, in Production environment it's failed with error like com.abc (packagename) is not enabled or approved
can anyone please suggest me any solution for this ?

android app is crashing after simply installing the library

I have latest gradle version in my react native app

buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
build:gradle: 7.2.1

"react": "18.1.0",
"react-native": "0.70.3",
"react-native-cashfree-pg-sdk": "^1.0.2",

with checkout intent quick checkout not opening

import React, { useEffect, useState } from 'react';
import { FlatList, StyleSheet, TouchableOpacity, View } from 'react-native';
import { usePaymentGatewayMutation } from '../../../../redux/api/paymentGateway/paymentGateway.api';
import { textScale } from '../../../../styles/responsiveStyles';
import { spacing } from '../../../../styles/spacing';
import { fontNames } from '../../../../styles/typography';
import Strings from '../../../../translation/language';
import colors from '../../../../utility/colors';
import { APP_PADDING_HORIZONTAL, CURRENCY, STATUS_BAR_CONSTANTS } from '../../../../utility/constants';
import { Images } from '../../../../utility/imagePaths';
import CommonButton from '../../../common/buttons/CommonButton';
import CommonHeader from '../../../common/header/CommonHeader';
import RegularText from '../../../common/RegularText';
import WalletFloatingCardComponent from '../../../modules/WalletFloatingCardComponent';
import {
    // CFCallback,
    // CFErrorResponse,
    CFPaymentGatewayService,
} from 'react-native-cashfree-pg-sdk';
import {
    CFDropCheckoutPayment,
    CFEnvironment,
    CFPaymentComponentBuilder,
    CFPaymentModes,
    CFSession,
    CFThemeBuilder,
} from 'cashfree-pg-api-contract';
import { navigate } from '../../../../utility/commonFunctions';

function RenderAddMoneySuggestions({ onPressSuggestedValue }) {

    const data = [
        { label: `${CURRENCY} 10.00`, value: 10 },
        { label: `${CURRENCY} 20.00`, value: 20 },
        { label: `${CURRENCY} 50.00`, value: 50 },
        { label: `${CURRENCY} 100.00`, value: 100 },
        { label: `${CURRENCY} 150.00`, value: 150 },
        { label: `${CURRENCY} 200.00`, value: 200 },
        { label: `${CURRENCY} 250.00`, value: 250 },
        { label: `${CURRENCY} 300.00`, value: 300 },
    ]

    return (
        // <View  >
        <FlatList
            data={data}
            renderItem={({ item, index }) => {
                return (
                    <TouchableOpacity
                        onPress={() => onPressSuggestedValue(item)}
                        style={[styles.renderAddMoneySuggestionsRowMainContainer, data.length == (index + 1) && { marginRight: 0 }]}
                    >
                        <RegularText style={styles.suggestionAmountText} >{item.label}</RegularText>
                    </TouchableOpacity>
                )
            }}
            horizontal
            showsHorizontalScrollIndicator={false}
        // style={{ marginHorizontal: -APP_PADDING_HORIZONTAL }}
        />
        // </View>
    )
}


const AddMoney = ({ }) => {

    const [money, setMoney] = useState(`${CURRENCY} `)

    const [paymentGateway] = usePaymentGatewayMutation()

    useEffect(() => {
        console.log('MOUNTED');
        CFPaymentGatewayService.setEventSubscriber({
            onReceivedEvent(eventName, map) {
                console.log('Event recieved on screen: ' +
                    eventName +
                    ' map: ' +
                    JSON.stringify(map));
            },
        });
        CFPaymentGatewayService.setCallback({
            onVerify(orderID) {
                console.log('orderId is :' + orderID);
            },
            onError(error, orderID) {
                console.log('exception is : ' + JSON.stringify(error) + '\norderId is :' + orderID);
            },
        });

        return () => {
            console.log('UNMOUNTED');
            CFPaymentGatewayService.removeCallback();
            CFPaymentGatewayService.removeEventSubscriber();
        }
    }, [])

    function onChangeMoney(money) {
        if (money == CURRENCY) return
        setMoney(`${money}`)
    }

    function onPressSuggestedValue(item) {
        setMoney(` ${item.value}`)
    }

    async function onPressAddMoney() {
        const payload = {
            customer_details: {
                customer_id: JSON.stringify(Date.now()),
                customer_email: "[email protected]",
                customer_phone: "8983980024"
            },
            order_amount: parseInt(money),
            order_currency: "INR",
            order_id: `order_${JSON.stringify(Date.now())}`
        }
        try {
            const paymentGatewayRes = await paymentGateway(payload)
            console.log(paymentGatewayRes);

            const session = new CFSession(paymentGatewayRes?.data?.payment_session_id, paymentGatewayRes?.data?.order_id, CFEnvironment.SANDBOX);
            const paymentModes = new CFPaymentComponentBuilder()
                .add(CFPaymentModes.CARD)
                .add(CFPaymentModes.UPI)
                .add(CFPaymentModes.WALLET)
                .build();
            const theme = new CFThemeBuilder()
                .setNavigationBarBackgroundColor(colors.theme)
                .setNavigationBarTextColor('#FFFFFF')
                .setButtonBackgroundColor(colors.theme)
                .setButtonTextColor('#FFFFFF')
                .setPrimaryTextColor('#212121')
                .setSecondaryTextColor('#757575')
                .build();
            const dropPayment = new CFDropCheckoutPayment(session, paymentModes, theme);
            CFPaymentGatewayService.doPayment(dropPayment);
            console.log(JSON.stringify(dropPayment));
        }
        catch (e) {
            console.log(e.message);
        }
    }



    return (
        <View style={styles.mainContainer} >
            <CommonHeader backgroundColor={colors.theme} hideWallet={true} backArrowTintColor={colors.white} statusBartheme={STATUS_BAR_CONSTANTS.LIGHT} />
            <WalletFloatingCardComponent
                title={Strings.my_wallet}
                subTitle={Strings.total_balance}
                hasAddMoneyButton={true}
                icon={Images.IMG_MY_WALLET}
                hasAddMoneyComponent
                // money={(userWalletRes?.data?.bonusMoney + userWalletRes?.data?.redeemableMoney)}
                // onPressAddMoney={onPressAddMoney}
                money={`${money}`}
                onChangeMoney={onChangeMoney}
                addMoneyPlaceholder={`${CURRENCY} Amount`}
                bottomComponent={<RenderAddMoneySuggestions onPressSuggestedValue={onPressSuggestedValue} />}
            />
            <View style={{ flex: 1 }} />
            <CommonButton
                title={'Add money'}
                buttonStyle={styles.buttonStyle}
                onPressButton={onPressAddMoney}
            />
        </View>
    )
}

const styles = StyleSheet.create({
    mainContainer: {
        flex: 1
    },
    renderAddMoneySuggestionsRowMainContainer: {
        borderWidth: spacing.WIDTH_1,
        borderColor: colors.grey300,
        borderRadius: spacing.RADIUS_90,
        paddingHorizontal: spacing.PADDING_12,
        paddingVertical: spacing.PADDING_6,
        marginRight: spacing.MARGIN_8
    },
    suggestionAmountText: {
        fontSize: textScale(14),
        fontFamily: fontNames.OPEN_SANS_MEDIUM

    },
    buttonStyle: {
        marginHorizontal: APP_PADDING_HORIZONTAL,
        marginVertical: spacing.MARGIN_20
    }
})

export default AddMoney;``

System:
OS: Windows 10 10.0.22621
CPU: (8) x64 Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz
Memory: 550.82 MB / 7.84 GB
Binaries:
Node: 16.17.1 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java: 11.0.16.1
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.2 => 0.70.2
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

Payment modal getting closes as soon as it opens on CFPaymentGatewayService.doPayment(dropPayment)

const session = new CFSession(
response.cftoken,
response.orderId,
CFEnvironment.SANDBOX
);
// console.log("CFPaymentComponentBuilder",CFPaymentComponentBuilder)
const paymentModes = new CFPaymentComponentBuilder()
.add(CFPaymentModes.CARD)
.add(CFPaymentModes.UPI)
.add(CFPaymentModes.NB)
.add(CFPaymentModes.WALLET)
.add(CFPaymentModes.PAY_LATER)
.build();
const theme = new CFThemeBuilder()
.setNavigationBarBackgroundColor('#E64A19')
.setNavigationBarTextColor('#FFFFFF')
.setButtonBackgroundColor('#FFC107')
.setButtonTextColor('#FFFFFF')
.setPrimaryTextColor('#212121')
.setSecondaryTextColor('#757575')
.build();

                const dropPayment = new CFDropCheckoutPayment(session, paymentModes, theme);

                CFPaymentGatewayService.doPayment(dropPayment)

Cashfree theme builder crashes app

While passing the CFThemeBuilder in CFDropCheckoutPayment class, following things are happening:
On iOS => app crashes without any error
On android => nothing happens

Below is a snippet of usage:

const createPayment = async (order_id: string) => {
    try {
      const token = await getCashFreeToken();
      if (!token) return;
      const session = new CFSession(token, order_id, CFEnvironment.SANDBOX);
      const paymentMode = new CFPaymentComponentBuilder()
        .add(CFPaymentModes.NB)
        .add(CFPaymentModes.UPI)
        .add(CFPaymentModes.EMI)
        .add(CFPaymentModes.CARD)
        .add(CFPaymentModes.PAYPAL)
        .add(CFPaymentModes.WALLET)
        .add(CFPaymentModes.PAY_LATER)
        .build();
      const theme = new CFThemeBuilder()
        .setButtonTextColor(colors.white_one)
        .setPrimaryTextColor(colors.black_one)
        .setSecondaryTextColor(colors.gray_two)
        .setButtonBackgroundColor(colors.black_five)
        .setNavigationBarTextColor(colors.black_five)
        .setNavigationBarBackgroundColor(colors.white_one)
        .build();
      const dropPayment = new CFDropCheckoutPayment(
        session,
        paymentMode,
        null
        // theme
      );
      CFPaymentGatewayService.doPayment(dropPayment);
    } catch (error) {
      console.error(error);
    }
  }

Following are the dependencies:

  "dependencies": {
    "@hookstate/core": "^3.0.13",
    "@react-native-clipboard/clipboard": "^1.10.0",
    "@react-native-community/blur": "^3.6.0",
    "@react-native-community/geolocation": "^2.1.0",
    "@react-native-community/netinfo": "^9.3.0",
    "@react-navigation/bottom-tabs": "^6.2.0",
    "@react-navigation/devtools": "^6.0.8",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/native-stack": "^6.5.2",
    "@sentry/react-native": "^4.1.3",
    "@types/react-native-global-props": "^1.1.1",
    "axios": "^0.27.2",
    "core-js": "^3.6.5",
    "form-data": "^4.0.0",
    "lodash": "^4.17.21",
    "moment": "^2.29.4",
    "node-libs-react-native": "^1.2.1",
    "phosphor-react-native": "^1.1.1",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-native": "^0.67.2",
    "react-native-camera": "^4.2.1",
    "react-native-cashfree-pg-sdk": "^1.0.1",
    "react-native-chart-kit": "^6.12.0",
    "react-native-contacts": "^7.0.4",
    "react-native-date-picker": "^4.2.2",
    "react-native-draggable-flatlist": "^3.1.2",
    "react-native-gesture-handler": "^2.5.0",
    "react-native-global-font": "^1.0.3",
    "react-native-global-props": "^1.1.5",
    "react-native-image-picker": "^4.8.4",
    "react-native-maps": "^0.31.1",
    "react-native-paper": "^4.12.0",
    "react-native-permissions": "^3.3.1",
    "react-native-qrcode-scanner": "^1.5.5",
    "react-native-reanimated": "^2.9.1",
    "react-native-safe-area-context": "^4.2.4",
    "react-native-screens": "^3.13.1",
    "react-native-shadow-2": "^6.0.4",
    "react-qr-code": "^2.0.7",
    "react-query": "^3.39.0",
    "react-router-dom": "^6.3.0",
    "regenerator-runtime": "0.13.7",
    "simple-socket-client": "github:Subhrajyotimodak/Simple-Socket-Client",
    "tslib": "^2.0.0",
    "url-search-params-polyfill": "^8.1.1"
  },
  "devDependencies": {
    "@nrwl/cli": "13.9.5",
    "@nrwl/detox": "13.9.5",
    "@nrwl/eslint-plugin-nx": "13.9.5",
    "@nrwl/jest": "13.9.5",
    "@nrwl/linter": "13.9.5",
    "@nrwl/react": "13.9.5",
    "@nrwl/react-native": "13.9.5",
    "@nrwl/web": "13.9.5",
    "@nrwl/workspace": "13.9.5",
    "@react-native-async-storage/async-storage": "1.16.1",
    "@react-native-community/cli": "7.0.1",
    "@react-native-community/cli-platform-android": "7.0.1",
    "@react-native-community/cli-platform-ios": "7.0.1",
    "@swc/core": "~1.2.143",
    "@testing-library/jest-dom": "5.16.2",
    "@testing-library/jest-native": "4.0.4",
    "@testing-library/react": "12.1.4",
    "@testing-library/react-hooks": "7.0.2",
    "@testing-library/react-native": "9.0.0",
    "@types/jest": "27.0.2",
    "@types/lodash": "^4.14.182",
    "@types/node": "^16.11.34",
    "@types/react": "18.0.0",
    "@types/react-dom": "18.0.0",
    "@types/react-native": "0.67.2",
    "@typescript-eslint/eslint-plugin": "~5.10.0",
    "@typescript-eslint/parser": "~5.10.0",
    "babel-jest": "27.2.3",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "detox": "19.5.1",
    "eslint": "~8.7.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-plugin-import": "2.25.4",
    "eslint-plugin-jsx-a11y": "6.5.1",
    "eslint-plugin-react": "^7.29.3",
    "eslint-plugin-react-hooks": "4.3.0",
    "jest": "27.2.3",
    "jest-circus": "27.2.3",
    "jest-react-native": "18.0.0",
    "metro": "0.69.0",
    "metro-react-native-babel-preset": "0.69.0",
    "metro-resolver": "0.69.0",
    "nx": "13.9.5",
    "prettier": "^2.5.1",
    "react-native-config": "^1.4.5",
    "react-native-flipper": "^0.155.0",
    "react-native-svg": "12.3.0",
    "react-native-svg-transformer": "1.0.0",
    "react-test-renderer": "17.0.2",
    "swc-loader": "0.1.15",
    "ts-jest": "27.0.5",
    "ts-transformer-keys": "^0.4.3",
    "typescript": "^4.5.2"
  }

EventEmitter.removeSubscription(...): Method has been deprecated. Please instead use `remove()` on the subscription itself

I am getting the following warning:

EventEmitter.removeSubscription(...): Method has been deprecated. Please instead use remove() on the subscription itself.

The stacktrace showed the following files:

  • instrumentFetch => instrument.js:117:28
  • EventEmitter#removeSubscription => _EventEmitter.js:86:5
  • CFPaymentGateway#removeCallback => index.js:66:7

Dependencies used:

"dependencies": {
"@hookstate/core": "^3.0.13",
"@react-native-clipboard/clipboard": "^1.10.0",
"@react-native-community/blur": "^3.6.0",
"@react-native-community/geolocation": "^2.1.0",
"@react-navigation/bottom-tabs": "^6.2.0",
"@react-navigation/devtools": "^6.0.8",
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.5.2",
"@sentry/react-native": "^4.1.3",
"@types/react-native-global-props": "^1.1.1",
"axios": "^0.27.2",
"core-js": "^3.6.5",
"form-data": "^4.0.0",
"lodash": "^4.17.21",
"node-libs-react-native": "^1.2.1",
"phosphor-react-native": "^1.1.1",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "^0.67.2",
"react-native-camera": "^4.2.1",
"react-native-cashfree-pg-sdk": "^1.0.1",
"react-native-chart-kit": "^6.12.0",
"react-native-contacts": "^7.0.4",
"react-native-date-picker": "^4.2.2",
"react-native-draggable-flatlist": "^3.1.2",
"react-native-gesture-handler": "^2.5.0",
"react-native-global-font": "^1.0.3",
"react-native-global-props": "^1.1.5",
"react-native-image-picker": "^4.8.4",
"react-native-maps": "^0.31.1",
"react-native-paper": "^4.12.0",
"react-native-permissions": "^3.3.1",
"react-native-qrcode-scanner": "^1.5.5",
"react-native-reanimated": "^2.9.1",
"react-native-safe-area-context": "^4.2.4",
"react-native-screens": "^3.13.1",
"react-native-shadow-2": "^6.0.4",
"react-qr-code": "^2.0.7",
"react-query": "^3.39.0",
"react-router-dom": "^6.3.0",
"regenerator-runtime": "0.13.7",
"simple-socket-client": "github:Subhrajyotimodak/Simple-Socket-Client",
"tslib": "^2.0.0",
"url-search-params-polyfill": "^8.1.1"
},
"devDependencies": {
"@nrwl/cli": "13.9.5",
"@nrwl/detox": "13.9.5",
"@nrwl/eslint-plugin-nx": "13.9.5",
"@nrwl/jest": "13.9.5",
"@nrwl/linter": "13.9.5",
"@nrwl/react": "13.9.5",
"@nrwl/react-native": "13.9.5",
"@nrwl/web": "13.9.5",
"@nrwl/workspace": "13.9.5",
"@react-native-async-storage/async-storage": "1.16.1",
"@react-native-community/cli": "7.0.1",
"@react-native-community/cli-platform-android": "7.0.1",
"@react-native-community/cli-platform-ios": "7.0.1",
"@swc/core": "~1.2.143",
"@testing-library/jest-dom": "5.16.2",
"@testing-library/jest-native": "4.0.4",
"@testing-library/react": "12.1.4",
"@testing-library/react-hooks": "7.0.2",
"@testing-library/react-native": "9.0.0",
"@types/jest": "27.0.2",
"@types/lodash": "^4.14.182",
"@types/node": "^16.11.34",
"@types/react": "18.0.0",
"@types/react-dom": "18.0.0",
"@types/react-native": "0.67.2",
"@typescript-eslint/eslint-plugin": "~5.10.0",
"@typescript-eslint/parser": "~5.10.0",
"babel-jest": "27.2.3",
"detox": "19.5.1",
"eslint": "~8.7.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "^7.29.3",
"eslint-plugin-react-hooks": "4.3.0",
"jest": "27.2.3",
"jest-circus": "27.2.3",
"jest-react-native": "18.0.0",
"metro": "0.69.0",
"metro-react-native-babel-preset": "0.69.0",
"metro-resolver": "0.69.0",
"nx": "13.9.5",
"prettier": "^2.5.1",
"react-native-config": "1.4.5",
"react-native-flipper": "^0.155.0",
"react-native-svg": "12.3.0",
"react-native-svg-transformer": "1.0.0",
"react-test-renderer": "17.0.2",
"swc-loader": "0.1.15",
"ts-jest": "27.0.5",
"ts-transformer-keys": "^0.4.3",
"typescript": "~4.5.2"
}

Thanks in advance.

Android build failed. Could not resolve com.cashfree.pg:api:1.0.11.

* What went wrong:
Could not determine the dependencies of task ':app:lintVitalWebsiteRelease'.
> Could not resolve all artifacts for configuration ':app:websiteDebugRuntimeClasspath'.
   > Could not resolve com.cashfree.pg:api:1.0.11.
     Required by:
         project :app > project :react-native-cashfree-pg-sdk
      > Could not resolve com.cashfree.pg:api:1.0.11.
         > Could not get resource 'https://www.jitpack.io/com/cashfree/pg/api/1.0.11/api-1.0.11.pom'.
            > Could not GET 'https://www.jitpack.io/com/cashfree/pg/api/1.0.11/api-1.0.11.pom'.
               > Read timed out

Archive Build failed

Screenshot 2022-08-27 at 4 18 33 PM

Development Target : 15.5,10.3,11.0,12.0,13.0 all are tested but same errors

and another error:
Could not find a declaration file for module 'react-native-cashfree-pg-sdk'. '/Users/Username/Documents/ProjectName/node_modules/react-native-cashfree-pg-sdk/lib/commonjs/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/react-native-cashfree-pg-sdk if it exists or add a new declaration (.d.ts) file containing declare module 'react-native-cashfree-pg-sdk';ts(7016)

Virus Total Flagging app with "react-native-cashfree-pg-sdk" as malware

My ads account was blocked due to malware detected in app, when checked deeper by removing dependencies one by one, we have found that "react-native-cashfree-pg-sdk" is causing the issue, we have also tested a boilerplate app with just one package installed, at was immediately, started flagging it, please check

Virus Total Link : https://www.virustotal.com/gui/file/063d400522a5992430f82dbace1e9e3f2d9693c7db4ffdd0c0b02231f6632c11

image

iOS: Archiving fails, build succeeds

Hi everyone,

image-1

react-native version: 0.64.3

getting this error when trying to archive a build for uploading to app store, removing the library allows the archive to succeed, I'm willing to give any additional that might be required, any help will be greatly appreciated.

Can't downgrade database from version 2 to 1

After making a debug install on the device, once am reopening the app its getting crashed with this error.

FATAL EXCEPTION: pool-13-thread-1
Process: com.sample, PID: 3858
android.database.sqlite.SQLiteException: Can't downgrade database from version 2 to 1
at android.database.sqlite.SQLiteOpenHelper.onDowngrade(SQLiteOpenHelper.java:640)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:512)
at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:437)
at com.cashfree.pg.analytics.database.CFDatabaseService.lambda$checkIfPaymentsPresent$3$com-cashfree-pg-analytics-database-CFDatabaseService(Unknown Source:2)
at com.cashfree.pg.analytics.database.CFDatabaseService$$ExternalSyntheticLambda3.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)

Could not find a declaration file for module 'react-native-cashfree-pg-sdk'.

After importing the react-native-cashfree-pg-sdk, I am getting the following error:

Could not find a declaration file for module 'react-native-cashfree-pg-sdk'. 
'<project-path>/node_modules/react-native-cashfree-pg-sdk/lib/commonjs/index.js' implicitly has an 'any' type. 
Try `npm i --save-dev @types/react-native-cashfree-pg-sdk` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-native-cashfree-pg-sdk'

got error while upgrading react native 0.71.7 to 0.72.0

im on latest version of react-native-cashFree-pg-sdk and I also upgrade react native to the latest version but i got error

`BUILD FAILED in 13s
error Failed to install the app. Command failed with exit code 1: gradlew.bat tasks FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':tasks'. > Could not create task ':react-native-cashfree-pg-sdk:compileDebugJavaWithJavac'. > In order to compile Java 9+ source, please set compileSdkVersion to 30 or above * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 13s

Task :gradle-plugin:compileKotlin UP-TO-DATE > Task :gradle-plugin:compileJava NO-SOURCE > Task :gradle-plugin:pluginDescriptors UP-TO-DATE > Task :gradle-plugin:processResources UP-TO-DATE > Task :gradle-plugin:classes UP-TO-DATE > Task :gradle-plugin:jar UP-TO-DATE > Task :gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE > Configure project :app Reading env from: ./env/.env.dev > Configure project :react-native-firebase_analytics :react-native-firebase_analytics package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\analytics\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\app\package.json :react-native-firebase_analytics:firebase.bom using default value: 31.4.0 :react-native-firebase_analytics package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\analytics\package.json :react-native-firebase_analytics:version set from package.json: 17.5.0 (17,5,0 - 17005000) :react-native-firebase_analytics:android.compileSdk using custom value: 33 :react-native-firebase_analytics:android.targetSdk using custom value: 33 :react-native-firebase_analytics:android.minSdk using custom value: 21 :react-native-firebase_analytics:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_app :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\app\package.json :react-native-firebase_app:firebase.bom using default value: 31.4.0 :react-native-firebase_app:play.play-services-auth using default value: 20.3.0 :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\app\package.json :react-native-firebase_app:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_app:android.compileSdk using custom value: 33 :react-native-firebase_app:android.targetSdk using custom value: 33 :react-native-firebase_app:android.minSdk using custom value: 21 :react-native-firebase_app:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_crashlytics :react-native-firebase_crashlytics package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\crashlytics\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\app\package.json :react-native-firebase_crashlytics:firebase.bom using default value: 31.4.0 :react-native-firebase_crashlytics package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\crashlytics\package.json :react-native-firebase_crashlytics:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_crashlytics:android.compileSdk using custom value: 33 :react-native-firebase_crashlytics:android.targetSdk using custom value: 33 :react-native-firebase_crashlytics:android.minSdk using custom value: 21 :react-native-firebase_crashlytics:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_dynamic-links :react-native-firebase_dynamic-links package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\dynamic-links\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\app\package.json :react-native-firebase_dynamic-links:firebase.bom using default value: 31.4.0 :react-native-firebase_dynamic-links package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\dynamic-links\package.json :react-native-firebase_dynamic-links:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_dynamic-links:android.compileSdk using custom value: 33 :react-native-firebase_dynamic-links:android.targetSdk using custom value: 33 :react-native-firebase_dynamic-links:android.minSdk using custom value: 21 :react-native-firebase_dynamic-links:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_messaging :react-native-firebase_messaging package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\messaging\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\app\package.json :react-native-firebase_messaging:firebase.bom using default value: 31.4.0 :react-native-firebase_messaging package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\messaging\package.json :react-native-firebase_messaging:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_messaging:android.compileSdk using custom value: 33 :react-native-firebase_messaging:android.targetSdk using custom value: 33 :react-native-firebase_messaging:android.minSdk using custom value: 21 :react-native-firebase_messaging:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-firebase_perf :react-native-firebase_perf package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\perf\package.json :react-native-firebase_app package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\app\package.json :react-native-firebase_perf:firebase.bom using default value: 31.4.0 :react-native-firebase_perf package.json found at C:\Project_Repo\App_Frontend\IndigoLearn\node_modules@react-native-firebase\perf\package.json :react-native-firebase_perf:version set from package.json: 17.4.3 (17,4,3 - 17004003) :react-native-firebase_perf:android.compileSdk using custom value: 33 :react-native-firebase_perf:android.targetSdk using custom value: 33 :react-native-firebase_perf:android.minSdk using custom value: 21 :react-native-firebase_perf:reactNativeAndroidDir C:\Project_Repo\App_Frontend\IndigoLearn\node_modules\react-native\android > Configure project :react-native-reanimated No AAR for react-native-reanimated found. Attempting to build from source. Android gradle plugin: 7.4.2 Gradle: 8.0.1 WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL. > Task :tasks FAILED ReactNativeFirebase WARNING: NPM package '@react-native-firebase/analytics' depends on '@react-native-firebase/app' v17.5.0 but found v17.4.3, this might cause build issues or runtime crashes. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings 6 actionable tasks: 1 executed, 5 up-to-date.
error Command failed with exit code 1.`

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.