Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

save card for future usage without payment #760

Closed
prox2 opened this issue Apr 29, 2021 · 5 comments
Closed

save card for future usage without payment #760

prox2 opened this issue Apr 29, 2021 · 5 comments

Comments

@prox2
Copy link

prox2 commented Apr 29, 2021

Before I have submitted the issue

[ ] I have read an installation guide
[ ] I know that for an iOS I need to install pods because I've read the installation guide
[ ] I have read a linking guide and checked that everything is OK like in manual linking guide
[ ] I know that before using tipsi-stripe I need to set options for my app as described in usage guide

The problem

I am trying to add card without payment for future usage, but as showing in example, is to add card during payment of the order .
i have tried the fowling (stripe.confirmSetupIntent) after retrieve the client secret from backend

// this will open card from to retrieve the data and pass it with `confirmSetupIntent` method
const token = await stripe.paymentRequestWithCardForm({
            smsAutofillDisabled: true,
            requiredBillingAddressFields: 'full',
            prefilledInformation: {
                billingAddress: {
                    name: "myname",
                    line1: "streetname",
                    line2: '',
                    city: "city",
                    state: "state",
                    country: 'MY',
                    postalCode: "postalcode",
                    email: "[email protected]",
                },
            },
        })
// here the `confirmSetupIntent` method
 try {
            const result = await stripe.confirmSetupIntent({
                clientSecret,
                token
            })
            console.log('Result', result)
            if (result.status == 'succeeded') {
                setLoading(false)
                Alert.alert('card added')
            }

        } catch (error) {
            setLoading(false)
            console.log('PaymentIntent Error', error)
        } 

But awlays end up with this error : Exception in native call from JS
I am spending till 3 days trying to figure it out, and all what i found is so confusing and there is no clear documentation, i hope can someone give me idea of the basic implement of saving cards for future usage without do payment.

Environment

  • tipsi-stripe version: 9.0.0
  • Last tipsi-stripe version where the issue was not reproduced (if applicable): N/A
  • iOS or Android: Android
  • OS version: windows version 2004
  • React-Native version: "react": "16.13.1", "react-native": "0.63.4",
  • (Android only) com.google.firebase:firebase-core version: The Firebase Android library firebase-core is no longer needed based on firebase documentation so i don't have installed version in my app

Links to logs and sources

For Android, please provide the following sections from android/app/build.gradle:
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29

Screenshots, GIFs (Must to have)

Screenshot_20210429-094430

@sandipgupta55
Copy link

sandipgupta55 commented Apr 30, 2021

In java code, they are expecting paymentMethod or paymentMethodId, clientSecret parameters, which might be not in document after adding paymentMethodId my code is working

@prox2
Copy link
Author

prox2 commented Apr 30, 2021

@sandipgupta55 thank you for replying , could you please show me sample code

@sandipgupta55
Copy link

@sandipgupta55 thank you for replying , could you please show me sample code

const result = await stripe.confirmSetupIntent({
clientSecret:
'seti_xxxxxxxxxxxxxxx',
paymentMethodId: 'pm_xxxxxxxxxxxx',
});

@prox2
Copy link
Author

prox2 commented Apr 30, 2021

@sandipgupta55 oh I see alright I will try that

@fbartho
Copy link
Collaborator

fbartho commented Jun 20, 2023

Closing this ticket, so that new users don't think this project is still active.

Stripe does not want you using this, and you will find pain if you do; Please migrate to the official @stripe/stripe-react-native package, for your user's safety, and your developer's sanity!

See more:

@fbartho fbartho closed this as completed Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants