#rakesh_code

1 messages ยท Page 1 of 1 (latest)

plush gulchBOT
#

๐Ÿ‘‹ 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.

tulip imp
#

hi! what error exactly?

coarse dagger
#

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

tulip imp
#

can you share the full stack trace of the error?

coarse dagger
tulip imp
#

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

plush gulchBOT
coarse dagger
#

it didnt work. is there any other way i can add card details to stripe account from my react native app?

hybrid bane
coarse dagger
#

i dont see "@stripe/stripe-react-native" in package.json but it is being used in the components

hybrid bane
#

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?

plush gulchBOT
coarse dagger
#

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)

unreal summit
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

coarse dagger
#

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.

coarse dagger
#

nope

unreal summit
#

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?

coarse dagger
#

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?

upper badger
#

hi! I'm taking over this thread.

#

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

coarse dagger
#

yes, all i need is to install "@stripe/stripe-react-native", get card details input from user, and recevie payment.

upper badger
coarse dagger
#

but still it needs "@stripe/stripe-react-native" which is not working

unreal summit
coarse dagger
#

yes

#

Android gradle plugin: 7.4.2
Gradle: 8.0.1
buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 34

unreal summit
#

Are you adding stripe-react-native to an existing project?

coarse dagger
#

no its a new one but started a few months back

unreal summit
#

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

coarse dagger
#

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',
},
});```

unreal summit
#

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.