#sandaru

1 messages · Page 1 of 1 (latest)

radiant streamBOT
ebon jungle
#

Hi there!

#

Can you share the PaymentIntent ID (pi_xxx)?

bold holly
#

pi_3N8ireEh0S58XxDe0k5lslcH

ebon jungle
#

This PaymentIntent has a requires_payment_method status.

#

So the next step is to confirm the PaymentIntent on the frontend with a payment method

bold holly
#

So this is what I done. According to the stripe firebase extention I created an doc like below documentation

#

client: ‘mobile’
mode: ‘payment’
amount: {payment amount}
currency: {currency code}
#

Here is the code for that. dart Future<String?> createCheckoutSession() async { try { return await firestoreService.addDocument( 'Users/${authService.user.value!.uid}/checkout_sessions', { 'client': 'mobile', 'mode': 'payment', 'amount': int.parse(receiverData.price ?? '') * 100, 'currency': 'USD', }); } catch (e) { closeLoadingDialog(); rethrow; } }

#

Then I initiated the payment sheet with those data like below dart Future<void> initPaymentSheet(String paymentDocID) async { try { final paymentData = await firestoreService.getDocument( 'Users/${authService.user.value!.uid}/checkout_sessions', paymentDocID, ); await Stripe.instance.initPaymentSheet( paymentSheetParameters: SetupPaymentSheetParameters( customFlow: true, merchantDisplayName: 'ShoutOut', paymentIntentClientSecret: paymentData!['paymentIntentClientSecret'], customerEphemeralKeySecret: paymentData['ephemeralKeySecret'], style: ThemeMode.light, appearance: PaymentSheetAppearance( colors: PaymentSheetAppearanceColors( background: kBottomSheetColor, secondaryText: Colors.grey.shade200, ), ), ), ); } catch (e) { rethrow; } }

#

Then after I presented the payment sheet.

#

Is there any other thing that need to done

quiet pumice
bold holly
#

Yeah I entered a test card

quiet pumice
#

cool, so what other question do you have?

bold holly
#

I tried again but the payment shows as incomplete in the dashboard.

#

I used 4242 4242 4242 4242 as the card

quiet pumice
#

can you take a screenshot of the UI you're looking at when you enter the card?

#

also , please add a line before Stripe.instance.initPaymentSheet and print the value of paymentData!['paymentIntentClientSecret'] and tell me what that prints

bold holly
#

{mode: payment, setupIntentClientSecret: null, amount: 150000, ephemeralKeySecret: ek_test_YWNjdF8xQzl3OG9FaDBTNThYeERlLGo3MjZqT0JqanlkOGZMM1ZnSW8wQzZkZmk1UzIxaFI_00z5d7dk95, paymentIntentClientSecret: pi_3N8jnXEh0S58XxDe0zB4bi5J_secret_6oSqx8d5o2POB9JY22xWzvazj, created: Timestamp(seconds=1684327784, nanoseconds=45000000), client: mobile, currency: USD, customer: cus_Nt45c1NLF30h6u}

quiet pumice
#

so that's a PaymentIntent

bold holly
quiet pumice
#

so you should not be using SetupPaymentSheetParameters

#

ah no, sorry, that's incorrect, ignore me.

#

we don't support that third party flutter library, so I don't really know how it works

quiet pumice
bold holly
#

I am using flutter_stripe: ^9.2.0

#

Nothing happened. when pressing continue the sheet close.

quiet pumice
#

can you show me the full code? like including where you call presentPaymentSheet.

#

ah also you are using customFlow: true,

#

that's the issue really. The integration is different that way . Maybe that flutter's library's docs are wrong

#

try it with that value set to false instead and see if it works.

radiant streamBOT
quiet pumice
#

that flutter library's docs are incomplete and don't mention that. You should probably open an issue on their Github page to let them know they should probably change their docs to either not use customFlow:true, or include how to do the extra step.

bold holly
#

It works. I set it to the false. Now it shows sucess.

#

Yeah. In the docs they mentioned as customflow true

#

And also I have another question. How I can confirm the payment is sucess or not.

bold holly
#

Ok. I will check that. Thank you

#

Hey I checked that. But I have the problem that with that firebase extension how I call webhook event. There is no documentation about that.

quiet fox
#

Hello 👋
Taking over as karllekko had to step away

#

You can create a test object for the events you're listening for and as long as you've configured the webhook correctly, it should receive the event