question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Card details not complete` when confirming a setup intent, using PaymentSheet

See original GitHub issue

Describe the bug I’m using the PaymentSheet to collect card details. We’re using setup intents as we intend to process the payment later. We are able to create the intent and collect the card details, but when I use confirmSetupIntent, I get the error from the title:

{
  "code": "Failed",
  "declineCode": null,
  "localizedMessage": "Card details not complete",
  "message": "Card details not complete",
  "stripeErrorCode": null,
  "type": null,
}

I’m getting confirmSetupIntent from the useStripe hook:

const { confirmSetupIntent } = useStripe();

Without confirming the setup intent, the card isn’t saved and the payment won’t be processed.

To Reproduce

  1. Create setup intent.
  2. Initialize payment sheet with setup intent.
  3. Collect card details.
  4. Confirm setup intent.

Expected behavior The setup intent is confirmed without error.

Screenshots n/a

Smartphone (please complete the following information):

  • Device: iPhoneX
  • OS: iOS 15.3.1
  • React Native 0.64.2
  • Stripe SDK 0.3.0

Additional context I looked into the iOS/Android code and I think this isn’t supported by the SDK. The PaymentMethodFactory that is responsible for creating paymentMethodParams only seems to take a CardFormView or a CardFieldView. It doesn’t check for values in the PaymentSheet.

Is there another way to confirm the SetupIntent? The PaymentSheet is important for our business needs.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
charliecruzan-stripecommented, Apr 18, 2022

Hi! Sorry, lost track of this issue 😦

You can indeed use setupintents with the paymentsheet. I think the problem here is your are attempting to use confirmSetupIntent, where you should be using confirmPaymentSheetPayment (or you can confirm outside of the client app, see the docs for more details on that and the rest of the flow). let me know if that helps

0reactions
charliecruzan-stripecommented, Apr 21, 2022

Gotchya, I have a todo item to update the doc strings for all the components/methods, so you should have to rely less on the actual integration docs and get a better idea of exactly what to do right in your editor. This will be at the top of that list!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Confirm a SetupIntent - Stripe API reference
Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a...
Read more >
Payment Sheet - Flutter Stripe - docs.page
Securely accept payments online. Integrate Stripe's prebuilt payment UI into the checkout of your app with the PaymentSheet class.
Read more >
SetupFutureUsage - Stripe Developer Resources
Setup FutureUsage ... Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will attach the payment ......
Read more >
"You must provide card details, token or paymentMethodId ...
confirm the payment if (error) { console.log("Unable to process payment"); } else { const { paymentIntent, error } = await confirmPayment( ...
Read more >
PaymentFlow - capacitor-community/stripe Documentation
This plugin is wrapper, so there information seems useful for you. Complete the payment in your own UI(iOS). This plugin use PaymentSheet.FlowController on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found