#rakesh_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1285157371651293195
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! what error exactly?
its al long error ```* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform paymentsheet-20.48.6.aar (com.stripe:paymentsheet:20.48.6) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
Execution failed for DexingWithClasspathTransform: C:\Users\Rakesh.gradle\caches\transforms-3\d71b399fe0c349af405986d655cfe422\transformed\jetified-paymentsheet-20.48.6-runtime.jar.
Error while dexing.```
i also changed compileSdkVersion = 34 targetSdkVersion = 34 from 33 to 34
can you share the full stack trace of the error?
hmm. I'd suggest starting a fresh project with the latest version of react-native and try installing the library in that, you're probably using some older/incompatible dependencies in your existing project
it didnt work. is there any other way i can add card details to stripe account from my react native app?
Hi
May I invite you first to pull the official Stripe React native app and run it first in your local dev env:
https://github.com/stripe/stripe-react-native/tree/master/example
i dont see "@stripe/stripe-react-native" in package.json but it is being used in the components
Yes the react native page is pulled from the root directly, but it's the same at the end...
Have you managed to load that Example project successfully?
im getting the below error on running the example project ```error: Error: Unable to resolve module @babel/runtime/helpers/interopRequireDefault from D:\stripe-react-native\src\components\AddressSheet.tsx: @babel/runtime/helpers/interopRequireDefault could not be found within the project.
1 | import React from 'react';
2 | import {
3 | AccessibilityProps,
4 | requireNativeComponent,
at ModuleResolver.resolveDependency (D:\stripe-react-native\example\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:158:15)
at DependencyGraph.resolveDependency (D:\stripe-react-native\example\node_modules\metro\src\node-haste\DependencyGraph.js:231:43)
at Object.resolve (D:\stripe-react-native\example\node_modules\metro\src\lib\transformHelpers.js:129:24)
at resolve (D:\stripe-react-native\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:396:33)
at D:\stripe-react-native\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:412:26
at Array.reduce (<anonymous>)
at resolveDependencies (D:\stripe-react-native\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:411:33)
at processModule (D:\stripe-react-native\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:140:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async addDependency (D:\stripe-react-native\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:230:18)
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
I require to store the card details of the customer in the Stripe dashboard, through React native app
as im not able to send raw card data to the API as i got the below error StripeInvalidRequestError: Sending credit card numbers directly to the Stripe API is generally unsafe. We suggest you use test tokens that map to the test card you are using, see https://stripe.com/docs/testing. To enable raw card data APIs in test mode, see https://support.stripe.com/questions/enabling-access-to-raw-card-data-apis.
Is your app PCI-compliant?
nope
Then you should not be handling raw card data, and Stripe will not enable this feature for your account.
What are you trying to achieve exactly?
im trying to install "@stripe/stripe-react-native" but the app is not running after i install that. should i need to config something to make it work? or any supporting packages needs to be installed?
hi! I'm taking over this thread.
do you get this error on the example app that was shared earlier? https://github.com/stripe/stripe-react-native/tree/master/example
as im not able to send raw card data to the API as i got the below error
that's expected. we strongly recommend not doing this, since it would require your company to be PCI compliant. you can learn more about this here: https://stripe.com/guides/pci-compliance
yes, all i need is to install "@stripe/stripe-react-native", get card details input from user, and recevie payment.
then you should use the Payment Sheet by following this guide: https://docs.stripe.com/payments/accept-a-payment?platform=react-native
but still it needs "@stripe/stripe-react-native" which is not working
Are you sure the Android requirements are covered: https://github.com/stripe/stripe-react-native/tree/master?tab=readme-ov-file#android
yes
Android gradle plugin: 7.4.2
Gradle: 8.0.1
buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 34
Are you adding stripe-react-native to an existing project?
no its a new one but started a few months back
Could you try creating a new project and installing stripe-react-native in it? This way we will understand if the problem is in the global env or in the existing project
let me try that but why dont this work ```const stripe = require('stripe')('sk_test_51PzYHhC2Q8ver3bkH3vPYy7Qf0vLGawOq7UaGalYt6ZqqHmpn38wtRF03lDpbPSLkNK6CpwRTXM0YcTybZt26Ha400L4QR6KSc');
const paymentMethod = await stripe.paymentMethods.create({
type: 'card',
card: {
number: '4242424242424242',
exp_month: 8,
exp_year: 2026,
cvc: '314',
},
});```
As me and my colleague suggested earlier, your app needs to be PCI-compliant to send raw card data to Stripe. In most cases you will not need this, e.g. if you use Mobile Payment Sheet.